Changeset 1107 for noc/nagios


Ignore:
Timestamp:
Apr 29, 2009, 2:00:26 PM (15 years ago)
Author:
quentin
Message:
Allow specifying a line size by fingering name-SIZE@syn
File:
1 edited

Legend:

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

    r1100 r1107  
    11#!/bin/bash
    22
     3export LINES=1000
     4export COLUMNS=80
    35docnagios() {
    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/
    57\[B/\n/g; s/
    68/\n/g' | perl -pe '
     
    2224
    2325read line
     26line=${line%[:blank:]}
     27line=${line%
     28}
     29
     30cols=${line##*-}
     31if [ "$cols" -eq "$cols" ] 2>/dev/null; then
     32    export COLUMNS="$cols"
     33    line=${line%-*}
     34fi
    2435case "$line" in
    25     status*)
     36    status)
    2637        docnagios
    2738        ;;
    28     broken*)
     39    broken)
    2940        docnagios -l w
    3041        ;;
    31     load*)
     42    load)
    3243        docnagios -g /LOAD/
    3344        ;;
    34     scripts-user*)
     45    scripts-user)
    3546        docnagios -g "/$(gethgmembers "scripts-user.*")/"
    3647        ;;
    37     scripts*)
     48    scripts)
    3849        docnagios -g "/$(gethgmembers "scripts.*")/"
    3950        ;;
    40     xvm*)
     51    xvm)
    4152        docnagios -g "/$(gethgmembers "xvm.*")/"
    4253        ;;
     
    5162finger xvm@sipb-noc    -- only XVM servers
    5263EOF
    53      
    5464        ;;
    5565esac
Note: See TracChangeset for help on using the changeset viewer.