2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/processes/vserver_procs
2012-02-13 18:24:46 +01:00

36 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
# Written by Bernd Zeimetz <bernd@bzed.de>, Wed, 26 Sep 2007 03:04:34 +0200
# This script is public domain, do with it what ever you want.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#%# family=auto
#%# capabilities=autoconf
[ "$1" = "autoconf" ] && echo yes && exit 0
if [ "$1" = "config" ]; then
echo 'graph_title Vserver Process Overview'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel number of processes'
echo 'graph_category processes'
echo 'graph_info This graph shows the number of processes in each vserver context.'
for vserver in `vserver-stat | sed 1d | awk '{print $8}'`; do
echo "${vserver}.label ${vserver}"
echo "${vserver}.draw LINE2"
echo "${vserver}.info Processes in the vserver context ${vserver}."
done
exit 0
fi
vserver-stat | sed 1d | awk '{print $8" "$2}' | while read vserver procs; do
echo "${vserver}.value ${procs}"
done
exit 0