Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
23795 govind 1
#/bin/sh
2
 
3
file="/var/log/services/nagios-Monitoring.properties"
4
if [ -f "$file" ]
5
then
6
  while IFS='=' read -r key value
7
  do
8
    key=$(echo $key | tr '.' '_')
9
    eval ${key}=\${value}
10
  done < "$file"
11
  currentBalance=${thinkWalnutBalance}
12
currentBalance=$( printf "%.0f" $currentBalance )
13
 
14
else
15
  echo "$file not found."
16
fi
17
if [ $currentBalance -le 5000 ]; then
18
                echo "CRITICAL - $currentBalance"
19
                exit 2
20
        elif [ $currentBalance -lt 10000 -a $currentBalance -gt 5000 ]; then
21
                echo "Warning - $currentBalance"
22
                exit 1
23
	 elif [ 10000 -le $currentBalance ]; then
24
                echo "ok - $currentBalance"
25
                exit 0
26
 
27
        else
28
                echo "UNKNOWN - $currentBalance"
29
                exit 3
30
fi
31
 
32