From ed4d81778a4214231d83701efa81b5a4ec35c7fe Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Fri, 19 Jun 2015 05:18:27 +0200 Subject: [PATCH] cpustat --- scripts/cpustat.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 scripts/cpustat.sh diff --git a/scripts/cpustat.sh b/scripts/cpustat.sh new file mode 100755 index 0000000..ca63422 --- /dev/null +++ b/scripts/cpustat.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +while true; do + idle=$(mpstat 2 1 | tail -n 1 | awk '{print int($12)}') + echo $[ 100 - $idle ] +done | stag -t "CPU usage" -s 0,100 -w 1