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 ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer "Postmaster" (verified OK))
	by (Postfix) with ESMTPS id 323B07A3DB
	for <>; Sat, 21 May 2016 11:22:48 +0000 (UTC)
Message-Id: <>
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>
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
Falling Raindrops

System: NetBSD 7.0_STABLE NetBSD 7.0_STABLE (BLACKBOX-$Revision: 1.85 $) #0: Wed Mar 23 14:55:17 CET 2016 amd64
Architecture: x86_64
Machine: amd64

	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.


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

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

	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.


	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.


NetBSD Home
NetBSD PR Database Search

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