net-mgmt/nagios-check_cpu_usage: switch to iostat

PR:		214297
Submitted by:	Vidar Karlsen <vidar@karlsen.tech>
This commit is contained in:
Steve Wills 2017-08-22 16:41:17 +00:00
parent b6fe25b6f7
commit 9e206eb55e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=448562
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= nagios-check_cpu_usage
PORTVERSION= 1.0
PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= # none
DISTFILES= # none

View File

@ -101,7 +101,7 @@ fi
warn=$1
crit=$3
cpu_all=$( vmstat -c 2 -n 0 | tail -n 1 | awk '{print $15 " " $16 " " $17}' )
cpu_all=$( iostat -c 2 -t proc | tail -n 1 | awk '{print $3 " " $5 " " $7}' )
cpu_user=$( echo $cpu_all | awk '{print $1}')
cpu_sys=$( echo $cpu_all | awk '{print $2}')
cpu_idle=$( echo $cpu_all | awk '{print $3}')