pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/51156: net/mrtg's envstat2mrtg out of sync with envsys(8)



>Number:         51156
>Category:       pkg
>Synopsis:       net/mrtg's envstat2mrtg out of sync with envsys(8)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 21 11:25:00 +0000 2016
>Originator:     Hauke Fath
>Release:        NetBSD 7.0_STABLE
>Organization:
Falling Raindrops
>Environment:
	
	
System: NetBSD pizza.causeuse.org 7.0_STABLE NetBSD 7.0_STABLE (BLACKBOX-$Revision: 1.85 $) #0: Wed Mar 23 14:55:17 CET 2016 hauke%pizza.causeuse.org@localhost:/var/obj/netbsd-builds/7/amd64/sys/arch/amd64/compile/BLACKBOX amd64
Architecture: x86_64
Machine: amd64
>Description:

	net/mrtg ships with an envstat2mrtg perl script that intends
	to process envstat(8) output to mrtg's
	expectations. Unfortunately, what the script expects as input
	is not quite what envstat(8) will produce, and so the former's
	output is not useful, and probably hasn't been in years.


>How-To-Repeat:

# envstat -s coretemp0:cpu0\ temperature
                      Current  CritMax  WarnMax  WarnMin  CritMin  Unit
[coretemp0]
  cpu0 temperature:    43.000                                      degC
#

# /usr/pkg/libexec/envstat2mrtg coretemp0:cpu0\ temperature
0
0
40 days, 21:15
pizza
#

	From the code, 

	chop $line;
	if ($line =~ m|^[\s\t]+(\w+)$|)
	{
		[...]

	envstat2mrtg expects one line starting with whitespace, then
	something alphanumeric (which it returns,) then EOL. 

	It is neither suited to multi-line input, nor would it
	recognize current envsys(8)'s '<whitespace> <label with
	optional whitespace> <colon> <whitespace> <value> <whitespace>
	<unit> <EOL>' format.


	
>Fix:

	Find a Perl hacker, then update the regexps.

	Or, better, use the output of 'envstat -s', which was made to
	be processed automatically. I guess perl could do that, but
	unfortunately, my XML fu is marginal.

	

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index