aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2017-08-23 00:41:17 +0800
committerswills <swills@FreeBSD.org>2017-08-23 00:41:17 +0800
commit90a66d934e52621b85908797dd9c9f45bbbc8b54 (patch)
treef62bf63e00d20098f3ec7627336e200fb1b479bb /net-mgmt
parentd8e829a6aef12df04967dbce5c0492afd6db2051 (diff)
downloadfreebsd-ports-gnome-90a66d934e52621b85908797dd9c9f45bbbc8b54.tar.gz
freebsd-ports-gnome-90a66d934e52621b85908797dd9c9f45bbbc8b54.tar.zst
freebsd-ports-gnome-90a66d934e52621b85908797dd9c9f45bbbc8b54.zip
net-mgmt/nagios-check_cpu_usage: switch to iostat
PR: 214297 Submitted by: Vidar Karlsen <vidar@karlsen.tech>
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/nagios-check_cpu_usage/Makefile1
-rw-r--r--net-mgmt/nagios-check_cpu_usage/files/check_cpu_usage2
2 files changed, 2 insertions, 1 deletions
diff --git a/net-mgmt/nagios-check_cpu_usage/Makefile b/net-mgmt/nagios-check_cpu_usage/Makefile
index b953f28e87d0..e45ae308ffc4 100644
--- a/net-mgmt/nagios-check_cpu_usage/Makefile
+++ b/net-mgmt/nagios-check_cpu_usage/Makefile
@@ -3,6 +3,7 @@
PORTNAME= nagios-check_cpu_usage
PORTVERSION= 1.0
+PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= # none
DISTFILES= # none
diff --git a/net-mgmt/nagios-check_cpu_usage/files/check_cpu_usage b/net-mgmt/nagios-check_cpu_usage/files/check_cpu_usage
index d9a9e4c8641d..1300cc6285f3 100644
--- a/net-mgmt/nagios-check_cpu_usage/files/check_cpu_usage
+++ b/net-mgmt/nagios-check_cpu_usage/files/check_cpu_usage
@@ -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}')