Ad Widget

Collapse

monitor virtuozzo privvmpages (and others)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • globifrosch
    Member
    • Sep 2005
    • 74

    #1

    monitor virtuozzo privvmpages (and others)

    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)

    PHP Code:
    #!/bin/sh

    if [ -$] ; then echo argument error && exit 1fi;

    COLUMN=1

    case $2 in
      held
    )    COLUMN=;;
      
    maxheldCOLUMN=;;
      
    barrierCOLUMN=;;
      
    limit)   COLUMN=;;
      
    failcntCOLUMN=;;
    esac


    REGEX
    ='s| +[a-z]+ +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+)|'
    REGEX="$REGEX\\${COLUMN}|"

    cat /proc/user_beancounters grep $sed -"$REGEX
    2. add a UserParameter to zabbix_agendtd.conf (or whatever zabbix*.conf you are using:

    PHP Code:
    UserParameter=vz[*],sudo <pathtoyoursavedscript> $$
    3. edit the sudoers file (aka: visudo)

    PHP Code:
    zabbix  ALL=(rootNOPASSWD: <pathtoyoursavedscript
    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.
Working...