check_cpu_perf.sh throwing unary operator errors
Posted: Fri Jun 08, 2018 12:10 pm
This plugin is failing on RHEL 6.9
Code: Select all
$ bash -version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
./check_cpu_perf.sh: line 200: [: -lt: unary operator expected
./check_cpu_perf.sh: line 204: [: -lt: unary operator expected
Code: Select all
199 #Display CPU Performance with alert
200 if [ ${SARCPUIDLE} -lt $2 ]
201 then
202 echo "CRITICAL: $CPU"
203 exit 2
204 elif [ $SARCPUIDLE -lt $1 ]
205 then
206 echo "WARNING: $CPU"
207 exit 1
208 else
209 echo "OK: $CPU"
210 exit 0
211 fi