#!/bin/sh
#
# Script to monitor disk usage.
#
# Parameters understood:
#
# 	config   (required)
# 	autoconf (optional - used by munin-config)

# Magic markers (optional - used by munin-config and installation
# scripts):
#
#%# family=auto
#%# capabilities=autoconf

if [ "$1" = "config" ]; then


	echo 'graph_title Zorp instances memory usage (in KBytes)'
	echo 'graph_args --base 1024 -l 0'
	echo 'graph_vlabel KBytes'
	echo 'graph_category Zorp'

	ps aufx | fgrep /usr/lib/zorp/zorp | fgrep -v grep | tr -s " " | cut -d " " -f14 | while read i; do
	echo $i"_vsz.label" $i"_VSZ"
	done
	exit 0
fi

	
ps aufx | fgrep /usr/lib/zorp/zorp | fgrep -v grep | tr -s " " | cut -d " " -f5,6,14 | while read i; do
	echo `echo $i | cut -d " " -f3`"_vsz.value "`echo $i | cut -d " " -f1` 
done
