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(-) (limited to 'files/plugins/xen_vbd') 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 From 7bac1218e57c3092d52e4eb0734451e45cb78c94 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 7 Dec 2012 15:14:00 +0100 Subject: correct filtering --- files/plugins/xen_vbd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/plugins/xen_vbd') diff --git a/files/plugins/xen_vbd b/files/plugins/xen_vbd index f3362c7..ccea940 100755 --- a/files/plugins/xen_vbd +++ b/files/plugins/xen_vbd @@ -17,7 +17,7 @@ $XM = '/usr/sbin/xm'; $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_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 .* ID" > /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 | grep -E "^ " > /var/lib/munin/plugin-state/xm_top.state'); # ah, parameters coming in -- cgit v1.2.3 From 8cb10f7bcd7bb3084e20d5a26099d65a83fb0f56 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 7 Dec 2012 16:00:18 +0100 Subject: fix a few other issues --- files/plugins/xen_vbd | 1 - 1 file changed, 1 deletion(-) (limited to 'files/plugins/xen_vbd') diff --git a/files/plugins/xen_vbd b/files/plugins/xen_vbd index ccea940..a684839 100755 --- a/files/plugins/xen_vbd +++ b/files/plugins/xen_vbd @@ -51,7 +51,6 @@ if ( defined($ARGV[0])) ); @domains = `cat /var/lib/munin/plugin-state/xm_list.state`; - shift(@domains); # we don't need the header line foreach $domain ( @domains ) { -- cgit v1.2.3 From f34990e5a63bf3aeaaeafb7be2ed842c524a9926 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 15 Dec 2012 20:29:41 +0100 Subject: fix a few remaining things in xen plugins --- files/plugins/xen_vbd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/plugins/xen_vbd') diff --git a/files/plugins/xen_vbd b/files/plugins/xen_vbd index a684839..e34d41c 100755 --- a/files/plugins/xen_vbd +++ b/files/plugins/xen_vbd @@ -50,7 +50,7 @@ if ( defined($ARGV[0])) 'graph_info' => 'Display the I/O operations for each domain', ); - @domains = `cat /var/lib/munin/plugin-state/xm_list.state`; + @domains = `cat /var/lib/munin/plugin-state/xm_list.state | grep -v 'Domain-0'`; foreach $domain ( @domains ) { @@ -85,7 +85,7 @@ if ( defined($ARGV[0])) # No args, get rolling -my @stats = `cat /var/lib/munin/plugin-state/xm_top.state`; +my @stats = `cat /var/lib/munin/plugin-state/xm_top.state | grep -v 'Domain-0'`; # remove the first line shift(@stats); -- cgit v1.2.3