summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2012-12-07 11:17:54 +0100
committermh <mh@immerda.ch>2012-12-07 11:17:54 +0100
commit61de53c6b99c18e309351c5e5cae5027ff2f4905 (patch)
tree1bbe6c3c0bc11e1a943856f3ce0278f4ddcf66c9 /files
parentaeeee144bf7e4740e9a8826e3d2086a4320c6ac8 (diff)
fix plugin to work on debian and centos
Diffstat (limited to 'files')
-rwxr-xr-xfiles/plugins/xen_vbd7
1 files changed, 2 insertions, 5 deletions
diff --git a/files/plugins/xen_vbd b/files/plugins/xen_vbd
index 4eca5a6..f3362c7 100755
--- a/files/plugins/xen_vbd
+++ b/files/plugins/xen_vbd
@@ -18,7 +18,7 @@ $XMTOP = '/usr/sbin/xentop';
# we cache xm list for 5 min for perfomance reasons
system('((find /var/lib/munin/plugin-state/xm_list.state -mmin -5 2>&1 | grep -qE \'^\/var\/lib\/munin\/plugin-state\/xm_list\.state$\') && [ `cat /var/lib/munin/plugin-state/xm_list.state | wc -l` -gt 1 ]) || /usr/sbin/xm list | grep -v "^Name .* Console$" > /var/lib/munin/plugin-state/xm_list.state');
-system('((find /var/lib/munin/plugin-state/xm_top.state -mmin -5 2>&1 | grep -qE \'^\/var\/lib\/munin\/plugin-state\/xm_top\.state$\') && [ `cat /var/lib/munin/plugin-state/xm_top.state | wc -l` -gt 1 ]) || /usr/sbin/xentop -b -i1 > /var/lib/munin/plugin-state/xm_top.state');
+system('((find /var/lib/munin/plugin-state/xm_top.state -mmin -5 2>&1 | grep -qE \'^\/var\/lib\/munin\/plugin-state\/xm_top\.state$\') && [ `cat /var/lib/munin/plugin-state/xm_top.state | wc -l` -gt 1 ]) || /usr/sbin/xentop -b -i1 | grep -E "^ " > /var/lib/munin/plugin-state/xm_top.state');
# ah, parameters coming in
if ( defined($ARGV[0]))
@@ -88,10 +88,7 @@ if ( defined($ARGV[0]))
# No args, get rolling
my @stats = `cat /var/lib/munin/plugin-state/xm_top.state`;
-# remove the first 4 items that are junk that we don't need.
-shift(@stats);
-shift(@stats);
-shift(@stats);
+# remove the first line
shift(@stats);
my %vals; undef(%vals);