Ad Widget

Collapse

OpenVZ /proc/user_beancounters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pjdevries
    Junior Member
    • Jan 2007
    • 2

    #1

    OpenVZ /proc/user_beancounters

    In an attempt to implement a simple script which monitors resources from within an OpenVZ VPS, I'm running into a permission problem when trying to read /proc/user_beancounters. This confuses me because both /proc and /proc/user_beancounters is readable by the whole world and my script works perfectly fine when executed manually from the command line. However, once it gets executed by the ZABBIX Agent, I get a 'Permission denied' on /proc/user_beancounters.

    What am I overlooking here? Does anybody have a clue?
  • pjdevries
    Junior Member
    • Jan 2007
    • 2

    #2
    Solved!

    Apparently only root has access to /proc. A little utility created by Doug Robbins called 'beanc' (see http://www.labradordata.ca/home/35) solves this problem. The utility consist of a small c programme that prints the contents of /proc/user_beancounters to standarad output; a sort of specialized 'cat' if you will. Installed with the suid bit set, it will have no problem whatsoever to produce the desired output.

    Comment

    Working...