diff --git a/munin-node b/munin-node index 5b79dfc..daa4c12 100755 --- a/munin-node +++ b/munin-node @@ -6,7 +6,7 @@ myname='openwrt-munin-node' ver='1.1' host=`cat /proc/sys/kernel/hostname` modules="" -register_module() { mn=`echo $1|sed 's/:$//'`;me=`echo $2|sed 's/:$//'`;shift 2;for f in config fetch;do rme=$me;[ "`echo $me|head -c1`" == "_" ]&&rme="$f$me";eval "${f}_$mn() { $rme `[ "$f" == "config" ]&&echo config` $@ \$@; };";done; } +register_module() { mn=`echo $1|sed 's/:$//'`;me=`echo $2|sed 's/:$//'`;shift 2;for f in config fetch;do rme=$me;[ "`echo $me|head -c1`" == "_" ]&&rme="$f$me";eval "${f}_$mn() { $rme `[ "$f" == "config" -a "$me" == "$rme" ]&&echo config` $@ \$@; };";done; } is_registered() { [ ! -z "`command -v config_$1`" ] && [ ! -z "`command -v fetch_$1`" ] && return 0;return 1; } register_modules() { for mod in `ls -1 $base/plugins.d/*`;do [ -f $mod -a -x $mod ] || continue;modn=`basename $mod`;[ "$modn" != "if" ]&&modules="$modules $modn";register_module $modn $mod;done; } register_iface_modules() { for iface in `ifconfig|grep '^\w'|awk '{print $1}'`;do [ "$iface" == "lo" ] && continue; iface_mod=`echo $iface|sed -e 's/\./VLAN/;s/\-/_/'`;modules="$modules if_$iface_mod";register_module if_$iface_mod _if $iface;done; } diff --git a/plugins.d/irqstats b/plugins.d/irqstats index 88a8615..7a779de 100755 --- a/plugins.d/irqstats +++ b/plugins.d/irqstats @@ -2,13 +2,13 @@ # this is just awful. -CPUS=`/bin/grep '^processor' /proc/cpuinfo` +CPUS=`/bin/grep -c '^processor' /proc/cpuinfo` IINFO=`/bin/sed -e 's/ \{1,\}/ /g;s/^ //' /proc/interrupts|/bin/grep '.:'` IDS=`echo "$IINFO"|/usr/bin/cut -d: -f1` if [ "$1" == "config" ];then echo "graph_title Individual interrupts -graph_args --base 1000 -l 0; +graph_args --base 1000 -l 0 graph_vlabel interrupts / \${graph_period} graph_category system" for ID in $IDS;do diff --git a/plugins.d/upnp b/plugins.d/upnp index 340827f..464386d 100755 --- a/plugins.d/upnp +++ b/plugins.d/upnp @@ -10,4 +10,4 @@ leases.label leases" exit 0 fi -echo "leases.value `cat /tmp/upnp.leases|/usr/bin/wc -l` +echo "leases.value `cat /tmp/upnp.leases|/usr/bin/wc -l`"