contrib-munin/plugins/power5/cpu_in_lpar

58 lines
1.3 KiB
Plaintext
Raw Normal View History

2007-04-10 12:48:57 +02:00
#!/bin/sh
#
# Copyright (C) 2006 Jens Schanz
#
# Plugin to monitor the potential and active processors for a LPAR
# on a power5 system for linux
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: lop5-cpu_in_lpar.sh,v $
# Revision 1.1 2006/12/08 10:08:33 schanz
# *** empty log message ***
#
#
# Revision 1.0 20.11.2006 - first build
#
# If you have any suggestions, questions, or enhancements, feel free to email
# me at mail@jensschanz.de
#
# Let's go ...
#
# Magick markers (optional - used by munin-config and some installation
# scripts):
#%# family=auto
#%# capabilities=autoconf
LPARCFG=/proc/ppc64/lparcfg
# check input parameters
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title CPU in LPAR'
echo 'graph_args -l 0'
echo 'graph_category Power5'
echo 'graph_vlabel CPUs in LPAR'
echo 'graph_info This graph shows potential and active processors for a LPAR.'
echo 'potentialLparCpu.label partition potential processors'
echo 'activeLparCpu.label partition active processors'
exit 0
fi
# let's do the main job
# get cpus in partition
echo -n "activeLparCpu.value "
cat $LPARCFG | grep partition_active_processors | awk -F = '{print $2}'
echo -n "potentialLparCpu.value "
cat $LPARCFG | grep partition_potential_processors | awk -F = '{print $2}'