tech-pkg archive

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

package update sysutils/munin-node: fix irqstats



Hi,

the attached two patches (because of how those packages are set up)
fix the irqstats plugin producing garbage output on NetBSD.

Filed upstream: https://github.com/munin-monitoring/munin/issues/1537

I've manually replaced the packaged irqstats plugin on my NetBSD
systems for at least two years (usually because I noticed the
munin server directory exploding with 10k+ new files and several
GB of extra storage), time to actually fix it ;-)

Kind regards,
          Alex.
-- 
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison
diff -urN /usr/pkgsrc/sysutils/munin-node/Makefile wip/munin-node/Makefile
--- /usr/pkgsrc/sysutils/munin-node/Makefile	2023-03-26 21:52:18.105693754 +0000
+++ wip/munin-node/Makefile	2023-05-11 22:24:11.086265513 +0000
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile,v 1.49 2022/10/11 14:38:47 taca Exp $
 
 PKGNAME=	${DISTNAME:S/munin/munin-node/}
-PKGREVISION=	2
+PKGREVISION=	3
 COMMENT=	System monitoring tool, client version
 
 .include "../../sysutils/munin-common/Makefile.common"
diff -urN /usr/pkgsrc/sysutils/munin-common/Makefile wip/munin-common/Makefile
--- /usr/pkgsrc/sysutils/munin-common/Makefile	2023-03-26 21:52:18.098234588 +0000
+++ wip/munin-common/Makefile	2023-05-11 22:22:49.415207693 +0000
@@ -2,7 +2,7 @@
 #
 
 PKGNAME=	${DISTNAME:S/munin/munin-common/}
-PKGREVISION=	1
+PKGREVISION=	2
 COMMENT=	Common components between a munin node and master
 
 .include "../../sysutils/munin-common/Makefile.common"
diff -urN /usr/pkgsrc/sysutils/munin-common/distinfo wip/munin-common/distinfo
--- /usr/pkgsrc/sysutils/munin-common/distinfo	2023-03-26 21:52:18.098868198 +0000
+++ wip/munin-common/distinfo	2023-05-11 22:14:04.132122032 +0000
@@ -8,5 +8,6 @@
 SHA1 (patch-Makefile.config) = aeaae9374c58c6baf1901ddb9b55a8fac77cf30c
 SHA1 (patch-common_Build.PL) = 7d7f5afde978d0e5641f931d3f2585651ff40c1a
 SHA1 (patch-common_lib_Munin_Common_Defaults.pm) = 09b464d828e12da26d8f41916eb876863b4b4cb3
+SHA1 (patch-plugins-node.d.netbsd-irqstats) = 05251b15a26fb449278fe865bb676f2ef28f2188
 SHA1 (patch-plugins_node.d.sunos_if__.in) = 9fe08aebbd759c6fc374e8a43740d28ec8004c90
 SHA1 (patch-plugins_node.d.sunos_if__err__.in) = e905228aa8c5c0d1c3a4d9562d550a0d8c0fbd4c
diff -urN /usr/pkgsrc/sysutils/munin-common/patches/patch-plugins-node.d.netbsd-irqstats wip/munin-common/patches/patch-plugins-node.d.netbsd-irqstats
--- /usr/pkgsrc/sysutils/munin-common/patches/patch-plugins-node.d.netbsd-irqstats	1970-01-01 00:00:00.000000000 +0000
+++ wip/munin-common/patches/patch-plugins-node.d.netbsd-irqstats	2023-05-11 22:11:21.641220375 +0000
@@ -0,0 +1,74 @@
+$NetBSD$
+
+Fix irqstats plugin for NetBSD to provide correct output (upstream
+duplicates field value into field name, causing all kinds of annoyance).
+
+upstream bug: https://github.com/munin-monitoring/munin/issues/1537
+
+--- plugins/node.d.netbsd/irqstats.in.old	2023-05-11 21:13:03.318450301 +0000
++++ plugins/node.d.netbsd/irqstats.in	2023-05-11 21:18:29.075543005 +0000
+@@ -1,5 +1,5 @@
+ #!@@GOODSH@@
+-#
++# 
+ # Plugin to monitor the individual interrupt sources.
+ #
+ # Usage: Link or copy into /etc/munin/node.d/
+@@ -34,22 +34,12 @@
+     fi
+ fi
+ 
+-intr_sources () {
+-    /usr/bin/vmstat -i | awk '
+-/^interrupt/ { next; }
+-/^Total/ { next; }
+-{
+-    s=substr($0, 1, 24);
+-    gsub(" *$", "", s);
+-    gsub(" ", "_", s);
+-    print s;
+-}
+-'
+-}
++intr_sources=$(/usr/bin/vmstat -i|grep -v Total|grep -v 'total rate'|sed -E 's/ {2,}/|/g'|sed 's/ /_/g'|grep -e '[:alnum:]'|cut -d\| -f1)
++echo "intr_sources = |$intr_sources|"
+ 
+ # If run with the "config"-parameter, give out information on how the
+-# graphs should look.
+-
++# graphs should look. 
++ 
+ if [ "$1" = "config" ]; then
+ 
+     echo 'graph_title Individual interrupts'
+@@ -57,12 +47,12 @@
+     echo 'graph_vlabel interrupts / ${graph_period}'
+     echo 'graph_category system'
+     echo -n 'graph_order '
+-    for i in `intr_sources`; do
++    for i in $intr_sources; do
+ 	echo -n ' intr_'${i}
+     done
+     echo
+ 
+-    for i in `intr_sources`; do
++    for i in $intr_sources; do
+ #	echo 'intr_'${i}'.draw LINE'
+ 	echo 'intr_'${i}'.label' `echo $i | sed -e 's/_/ /g'`
+ 	echo 'intr_'${i}'.info Interrupt' `echo $i | sed -e 's/_/ /g'`
+@@ -72,13 +62,5 @@
+     exit 0
+ fi
+ 
+-/usr/bin/vmstat -i | awk '
+-/^interrupt/ { next; }
+-/^Total/ { next; }
+-/[0-9]/{
+-    s=substr($0, 1, 24);
+-    gsub(" *$", "", s);
+-    gsub(" ", "_", s);
+-    print "intr_" s ".value " $(NF-1);
+-}
+-'
++/usr/bin/vmstat -i|grep -v Total|grep -v 'total rate'|sed -E 's/ {2,}/|/g'|sed 's/ /_/g'|sed 's/|/ /g'|grep -E '[:alnum:]'|awk '{print $1 ".value " $2}'
++


Home | Main Index | Thread Index | Old Index