- Timestamp:
- Apr 23, 2009, 11:09:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
noc/nagios/status-user/finger.sh
r1093 r1094 13 13 } 14 14 15 gethostgroups() { 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 19 gethgmembers() { 20 gethostgroups | grep "^$1\t" | cut -f 2 -d " " | sed 's/,/\n/g' | perl -pe 's/\n/|/g' | sed 's/|$//' 21 } 22 15 23 read line 16 24 case "$line" in … … 20 28 broken*) 21 29 docnagios -l w 30 ;; 31 xvm*) 32 docnagios -g "/$(gethgmembers "xvm.*")/" 22 33 ;; 23 34 *)
Note: See TracChangeset
for help on using the changeset viewer.