NetBSD Problem Report #51156

From hauke@Espresso.Rhein-Neckar.DE  Sat May 21 11:22:48 2016
Return-Path: <hauke@Espresso.Rhein-Neckar.DE>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 323B07A3DB
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 21 May 2016 11:22:48 +0000 (UTC)
Message-Id: <201605211113.u4LBD3AF014185@pizza.causeuse.org>
Date: Sat, 21 May 2016 13:13:03 +0200 (CEST)
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Reply-To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Subject: net/mrtg's envstat2mrtg out of sync with envsys(8)
X-Send-Pr-Version: 3.95

>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:/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:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.