From 61de53c6b99c18e309351c5e5cae5027ff2f4905 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 7 Dec 2012 11:17:54 +0100 Subject: fix plugin to work on debian and centos --- files/plugins/xen_vbd | 7 ++----- 1 file 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); -- cgit v1.2.3