Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ((${#}!=3)); then
- err="Missing argument : usage $0 <warnlevel> <criticallevlel> <directory>"
- err2=" <directory> = <a directory>"
- echo $err
- echo $err2
- exit 2
- fi
- warninglevel=$1
- criticallevel=$2
- if (($warninglevel<$criticallevel)); then
- echo "Warning level must be greater than or equal critical level"
- exit 2
- fi
- directory=$3
- retval=0
- codlevel[0]="OK"
- codlevel[1]="WARN"
- codlevel[2]="CRIT"
- level=`ls $directory | wc -l `
- if [[ $level = "" ]]; then
- echo "File for $directory not found"
- exit 2
- fi
- if (($level> $warninglevel)); then
- retval=0
- elif (($level> $criticallevel)) ; then
- retval=1
- else
- retval=2
- fi
- echo "directory,$directory:level:$level,codlevel:${codlevel[$retval]}"
- exit $retval
- /var/log/nagios/countFiles.bash
- check_nrpe!ARG1
- check_nrpe_arg1!check_filenumber!10000 150000 /PTS/udc33/diameter_cdr_tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement