Changeset 1094


Ignore:
Timestamp:
Apr 23, 2009, 11:09:11 PM (13 years ago)
Author:
quentin
Message:
Allow fingering of xvm information, too
File:
1 edited

Legend:

Unmodified
Added
Removed
  • noc/nagios/status-user/finger.sh

    r1093 r1094  
    1313}
    1414
     15gethostgroups() {
     16    cat /etc/nagios3/*.cfg | perl -ne 'print if ( /^(\s*)define hostgroup [\{[]/ ... /[\}\]]/ )' | perl -ne 'm|hostgroup_name\s+(\S+)| and $name = $1; m|members\s+(.+)\s*$| and $members = $1; m|\}| and print "$name\t$members\n"'
     17}
     18
     19gethgmembers() {
     20    gethostgroups | grep "^$1\t" | cut -f 2 -d "        " | sed 's/,/\n/g' | perl -pe 's/\n/|/g' | sed 's/|$//'
     21}
     22
    1523read line
    1624case "$line" in
     
    2028    broken*)
    2129        docnagios -l w
     30        ;;
     31    xvm*)
     32        docnagios -g "/$(gethgmembers "xvm.*")/"
    2233        ;;
    2334    *)
Note: See TracChangeset for help on using the changeset viewer.