From 1c8256d67160efd3b667cb9a8b16f2e2ea183a2e Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Wed, 26 Sep 2007 22:34:28 +0200 Subject: [PATCH] Initial version --- plugins/other/vserver_procs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 plugins/other/vserver_procs diff --git a/plugins/other/vserver_procs b/plugins/other/vserver_procs new file mode 100755 index 00000000..361b3776 --- /dev/null +++ b/plugins/other/vserver_procs @@ -0,0 +1,36 @@ +#!/bin/bash + +# Written by Bernd Zeimetz , 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