diff options
author | Micah Anderson <micah@riseup.net> | 2009-12-22 19:29:23 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2009-12-22 19:29:23 -0500 |
commit | 42c94b4fad526b25852c7bcaf053f441bac38c9e (patch) | |
tree | 89a8da279ba7190a350ade72bc52cda90362c4b7 /files/plugins/xen_memory | |
parent | 577ff440b791ab67de77b20440b5e385fe1c9572 (diff) | |
parent | 76352415fec5c2ab6975e3a8843dd4983f7cae6a (diff) |
Merge commit '76352415fec5c2ab6975e3a8843dd4983f7cae6a'
Conflicts:
README
lib/facter/acpi_available.rb
lib/facter/interfaces.rb
lib/facter/munin_interfaces.rb
manifests/client.pp
manifests/host.pp
manifests/init.pp
manifests/plugin.pp
plugins/facter/interfaces.rb
templates/defaultclient.erb
templates/munin-node.conf.Debian.lenny
Diffstat (limited to 'files/plugins/xen_memory')
-rwxr-xr-x | files/plugins/xen_memory | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/files/plugins/xen_memory b/files/plugins/xen_memory new file mode 100755 index 0000000..90bc705 --- /dev/null +++ b/files/plugins/xen_memory @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Script to monitor memory status of the xen host +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# + +MAXDOMAINS=16 + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + exit 0 + fi + echo "no (xm not found)" + exit 1 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Memory' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel MB' + echo 'graph_category xen' + echo 'graph_info This graph shows of many mS wall time where used by a domain' + # xm info | while read name bla value; do echo "$name $value"; done + /usr/sbin/xm info | while read name bla value; do + #total_memory 2047 + #free_memory 1476 + name=`echo $name | sed -e"s/-/_/"` + + if [ "$name" = "total_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.min 0" + echo "$name.info total memory" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.draw AREA" +# echo "$name.draw STACK" + echo "$name.min 0" + echo "$name.info free memory" + fi + done + exit 0 +fi + +/usr/sbin/xm info | while read name bla value; do + name=`echo $name | sed -e"s/-/_/"` + if [ "$name" = "total_memory" ]; then + echo "$name.value $value" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.value $value" + fi +done + |