From 24f4e4e2abcdd789d5c34b16c4fe29db8e8ec503 Mon Sep 17 00:00:00 2001 From: Babak Farrokhi Date: Sat, 15 Aug 2015 09:23:48 +0430 Subject: [PATCH] - cleanup --- intr_ | 2 +- netirq_ | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/intr_ b/intr_ index cc55be8..0df37e9 100755 --- a/intr_ +++ b/intr_ @@ -26,7 +26,7 @@ # # # 12-Aug-2015 @farrokhi -# This script extracts CPU and IRQ interrupt rates from "vmstat -i" +# This script extracts CPU interrupt rates from "vmstat -i" # on FreeBSD and feeds to munin # # XXX: This script requires lang/gawk to be installed (we use extended regexp in awk). diff --git a/netirq_ b/netirq_ index 62ab18a..6141291 100755 --- a/netirq_ +++ b/netirq_ @@ -49,7 +49,19 @@ elif [ "$1" == "config" ]; then echo "graph_vlabel interrupts / second" echo "graph_category system" - cat ${STATFILE} | ${AWK} '{ FS = "[ ]{3,}" } /'${STAT_TYPE}'/{split($1,name,":"); print name[1]".label "$1"\n"name[1]".type DERIVE\n"name[1]".min 0"}' + cat ${STATFILE} | ${AWK} ' +BEGIN { + FS = "[ ]{2,}" +} + +/'${STAT_TYPE}'/ { + split($1,name,":"); + print name[1]".label "$1; + print name[1]".type DERIVE"; + print name[1]".min 0"; + print name[1]".draw LINE2"; +} +' fi