Ever had to stare at those maxheld, barrier, failcnt values in OpenVZ UBC Parameters in /proc/user_beancounters? Not anymore! Below script, taken from nagios plugin, will easily look through the /proc/user_beancounters file and list all UBC parameters that are under resource shortage.
chmod u+x check_ubc.sh
check_ubc.sh needs to be run twice, if its executed in the server for the first time, as it needs to compare failcnt values obtained from its previous execution.