From 2ac60fb5804ba23d61e12f3bbd5454e82ead5ac3 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 3 Oct 2009 14:46:38 +0200 Subject: add some xen munin plugins --- files/plugins/xen_vm | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 files/plugins/xen_vm (limited to 'files/plugins/xen_vm') diff --git a/files/plugins/xen_vm b/files/plugins/xen_vm new file mode 100644 index 0000000..a0dc0b7 --- /dev/null +++ b/files/plugins/xen_vm @@ -0,0 +1,67 @@ +#!/bin/sh +# +# Copyright (C) 2006 Rodolphe Quiedeville +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# +# Monitor number of vm running on a xen dom0. +# +# $Log$ +# Revision 1.0 2006/09/08 19:20:19 rodo +# Created by Rodolphe Quiedeville +# +# Need to be run as root, add the following lines ... +# +# [xen*] +# user root +# +# to /etc/munin/plugin-conf.d/munin-node +# +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# +# +# Magic markers (optional - used by munin-config and installation +# scripts): +# +#%# family=auto +#%# capabilities=autoconf + +XM="/usr/sbin/xm" + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Virtual Machines' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel vm' + echo 'graph_category xen' + echo 'graph_info This graph shows how many virtual machines runs on dom0.' + echo 'domains.label vm' + exit 0 +fi + +domains=`$XM list | wc -l` + +echo -n "domains.value " +echo $(($domains-2)) -- cgit v1.2.3