#!/usr/bin/perl -w # # (c) 2006 Tatu Wikman # tsw (at) backspace (dot) fi # # Plugin to monitor xen domains usage from dom0 # # # Usage: copy or link into /etc/munin/node.d/ # # Parameters: # # config (required) # # $Id$ # # $Log$ # Revision 1.1.2.1 2005/01/11 13:48:33 ilmari # Fix linux/users #! line. # # Revision 1.1 2004/12/20 13:43:36 jimmyo # Added plugin linux/users, created by Michael Kaiser. # # #%# family=contrib if ( $ARGV[0] and $ARGV[0] eq "config" ) { print "graph_title Xen time(s)\n"; print "graph_args -l 0\n"; print "graph_vlabel Count/min\n"; # print "graph_scale no\n"; open (NAME,"xm list|grep -v -i name |cut -c1-12 |cut -d ' ' -f1|"); @name = ; close (NAME); foreach $n (@name) { chop $n; $n =~ s/-//g; print "$n.label $n\n"; # print "$n.draw STACK\n"; } exit 0; } open (NAME,"xm list|grep -v -i name |cut -c1-12 |cut -d ' ' -f1|"); @name = ; close (NAME); open (TIMES,"xm list|grep -v -i name |cut -c45-50|cut -d ' ' -f1|"); @times = ; close (TIMES); $i=0; foreach $n (@name) { chop $n; $n =~ s/-//g; print "$n.value $times[$i]"; $i++; }