mirror of
https://github.com/oneoffdallas/pfsense-nagios-checks.git
synced 2024-11-21 09:53:42 +01:00
Update check_pf_cpu
Different output from top when upgraded from 2.45 to 2.5 (21.02). This modification works for both new and old.
This commit is contained in:
parent
c2d3e8d21f
commit
7e814fef25
@ -3,7 +3,7 @@
|
|||||||
if [ "$1" = "-w" ] && [ "$2" -gt "0" ] && [ "$3" = "-c" ] && [ "$4" -gt "0" ] ; then
|
if [ "$1" = "-w" ] && [ "$2" -gt "0" ] && [ "$3" = "-c" ] && [ "$4" -gt "0" ] ; then
|
||||||
warn=$2
|
warn=$2
|
||||||
crit=$4
|
crit=$4
|
||||||
IDLE=$(top -b -d2 | grep 'CPU:' | cut -d',' -f5 | cut -d'%' -f1 | cut -d'.' -f1 | sed -e 's/^[ \t]*//')||exit 3
|
IDLE=$(top -b -d2 | grep 'CPU:' | cut -d',' -f5 | cut -d'%' -f1 | cut -d'.' -f1 | sed -e 's/^[ \t]*//' | tail -1)||exit 3
|
||||||
#UTIL=`echo "100-$IDLE"| bc`
|
#UTIL=`echo "100-$IDLE"| bc`
|
||||||
UTIL=`expr 100 - $IDLE`
|
UTIL=`expr 100 - $IDLE`
|
||||||
#UTIL_RND=`echo "100-$IDLE"| bc | awk '{printf("%d\n",$1 + 0.5)}'`
|
#UTIL_RND=`echo "100-$IDLE"| bc | awk '{printf("%d\n",$1 + 0.5)}'`
|
||||||
|
Loading…
Reference in New Issue
Block a user