pkgsrc-WIP-changes archive

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

Fix munin-node irqstats plugin for NetBSD.



Module Name:	pkgsrc-wip
Committed By:	Alexander Schreiber <als%thangorodrim.de@localhost>
Pushed By:	als
Date:		Thu May 11 22:25:10 2023 +0000
Changeset:	93c1d35b1347009f576c1b0bd7aa0181f57b9232

Modified Files:
	munin-common/Makefile
	munin-common/distinfo
	munin-node/Makefile
Added Files:
	munin-common/patches/patch-plugins-node.d.netbsd-irqstats

Log Message:
Fix munin-node irqstats plugin for NetBSD.

The munin-node irqstats plugin produces invalid data by incorporating
the field value into the field name, leading to all kinds of annoyances

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

Signed-off-by: Alexander Schreiber <als%thangorodrim.de@localhost>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=93c1d35b1347009f576c1b0bd7aa0181f57b9232

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 munin-common/Makefile                              |  2 +-
 munin-common/distinfo                              |  1 +
 .../patches/patch-plugins-node.d.netbsd-irqstats   | 74 ++++++++++++++++++++++
 munin-node/Makefile                                |  2 +-
 4 files changed, 77 insertions(+), 2 deletions(-)

diffs:
diff --git a/munin-common/Makefile b/munin-common/Makefile
index d6b461baa0..7510ffa1dc 100644
--- a/munin-common/Makefile
+++ b/munin-common/Makefile
@@ -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 --git a/munin-common/distinfo b/munin-common/distinfo
index c5764bb1e1..2ccf5002bd 100644
--- a/munin-common/distinfo
+++ b/munin-common/distinfo
@@ -8,5 +8,6 @@ SHA1 (patch-Makefile) = f3fd52b56fcddda3efca61453c23243fac35568a
 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 --git a/munin-common/patches/patch-plugins-node.d.netbsd-irqstats b/munin-common/patches/patch-plugins-node.d.netbsd-irqstats
new file mode 100644
index 0000000000..4785101943
--- /dev/null
+++ b/munin-common/patches/patch-plugins-node.d.netbsd-irqstats
@@ -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}'
++
diff --git a/munin-node/Makefile b/munin-node/Makefile
index 3e8696907c..1d04bd6742 100644
--- a/munin-node/Makefile
+++ b/munin-node/Makefile
@@ -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"


Home | Main Index | Thread Index | Old Index