Changeset 1107 for noc/nagios
- Timestamp:
- Apr 29, 2009, 2:00:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
noc/nagios/status-user/finger.sh
r1100 r1107 1 1 #!/bin/bash 2 2 3 export LINES=1000 4 export COLUMNS=80 3 5 docnagios() { 4 echo q | env TERM=ansi LINES=1000 COLUMNS=80/usr/local/nagios/bin/cnagios -b "$@" | sed 's/6 echo q | env TERM=ansi /usr/local/nagios/bin/cnagios -b "$@" | sed 's/ 5 7 \[B/\n/g; s/ 6 8 /\n/g' | perl -pe ' … … 22 24 23 25 read line 26 line=${line%[:blank:]} 27 line=${line% 28 } 29 30 cols=${line##*-} 31 if [ "$cols" -eq "$cols" ] 2>/dev/null; then 32 export COLUMNS="$cols" 33 line=${line%-*} 34 fi 24 35 case "$line" in 25 status *)36 status) 26 37 docnagios 27 38 ;; 28 broken *)39 broken) 29 40 docnagios -l w 30 41 ;; 31 load *)42 load) 32 43 docnagios -g /LOAD/ 33 44 ;; 34 scripts-user *)45 scripts-user) 35 46 docnagios -g "/$(gethgmembers "scripts-user.*")/" 36 47 ;; 37 scripts *)48 scripts) 38 49 docnagios -g "/$(gethgmembers "scripts.*")/" 39 50 ;; 40 xvm *)51 xvm) 41 52 docnagios -g "/$(gethgmembers "xvm.*")/" 42 53 ;; … … 51 62 finger xvm@sipb-noc -- only XVM servers 52 63 EOF 53 54 64 ;; 55 65 esac
Note: See TracChangeset
for help on using the changeset viewer.