i have some Virtuozzo hosts. There is one parameter (at least for me) to watch out for: privvmpages
so now, this is how you can do it:
1. save this script somewhre (eg. /usr/local/bin)
2. add a UserParameter to zabbix_agendtd.conf (or whatever zabbix*.conf you are using:
3. edit the sudoers file (aka: visudo)
4. restart zabbix_agent
5. add new item with key "vz[privvmpages,held]", "vz[privvmpages,barrier]", vz[privvmpages,failcnt], etc. Have a look at /proc/user_beancounters what other counters and limits there are.
so now, this is how you can do it:
1. save this script somewhre (eg. /usr/local/bin)
PHP Code:
#!/bin/sh
if [ -z $1 ] ; then echo argument error && exit 1; fi;
COLUMN=1
case $2 in
held) COLUMN=1 ;;
maxheld) COLUMN=2 ;;
barrier) COLUMN=3 ;;
limit) COLUMN=4 ;;
failcnt) COLUMN=5 ;;
esac
REGEX='s| +[a-z]+ +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+)|'
REGEX="$REGEX\\${COLUMN}|"
cat /proc/user_beancounters | grep $1 | sed -r "$REGEX"
PHP Code:
UserParameter=vz[*],sudo <pathtoyoursavedscript> $1 $2
PHP Code:
zabbix ALL=(root) NOPASSWD: <pathtoyoursavedscript>
5. add new item with key "vz[privvmpages,held]", "vz[privvmpages,barrier]", vz[privvmpages,failcnt], etc. Have a look at /proc/user_beancounters what other counters and limits there are.