Changes

Jump to: navigation, search

Monitoring openvz resources using nagios and snmp

405 bytes added, 09:12, 7 April 2009
check_vzquota Without SNMP: script cahnged ! surpress the "unknow" error in case that all is ok, but there are simple no containers running
#!/bin/bash
RET=0
DATA=`echo;sudo /usr/sbin/vzlist -1 2>/dev/null | xargs -I {} bash -c "echo {}:;sudo /usr/sbin/vzquota stat {} | sed 's/\*//g'"`
if [ -z "$DATA" ]; then
VPS_err=$(sudo /usr/sbin/vzlist -1 2>&1 1>/dev/null) if [ -n "$VPS_err" ] && [ "$VPS_err" == "Container(s) not found" ]; then echo "OK - $VPS_err"; exit 0; else if [ -n "$VPS_err" ]; then echo "UNKNOWN - Error: $VPS_err"; else echo "UNKNOWN - VZquota stats are not readable or empty. Maybe it is only readable for root and this script should be called by sudo."; fi exit 3; fi
fi
15
edits

Navigation menu