From 7a44f62d2c6ac6bd048b0f87975d3280f9923355 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 10 Jan 2013 16:01:14 +0100 Subject: [PATCH] Print all labels in config mode and stack results --- contrib/nettokom-munin | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/contrib/nettokom-munin b/contrib/nettokom-munin index 283cd6af..2b446816 100755 --- a/contrib/nettokom-munin +++ b/contrib/nettokom-munin @@ -66,6 +66,10 @@ my $cacheconfigfile = "$cachedir/nettokom-munin-config"; my $refreshtime = $ENV{'cache_expire'} || 10800; my $weboob = "/usr/bin/env boobill details $id -f table"; +my @knowlabels = ("AbgehendeSMSimAusland", "AnkommendeGespr_cheimAusland", + "Community", "D1", "D2", "Deutschland", "Festnetz", + "FreeCall", "Mailbox", "O2", "SMS", "SMSinsAusland"); + my $cache_fh; sub config { @@ -93,13 +97,30 @@ graph_category weboob graph_args -l 0 EOF + my $first = 1; + for my $label (@knowlabels) { + my $shortlabel = $label; + if (!(grep {$_ == $shortlabel} @exclude)) { + doubleprint "$shortlabel.label $label\n"; + if ($first > 0) { + doubleprint "$shortlabel.draw AREA\n"; + $first = 0; + } + else { + doubleprint "$shortlabel.draw STACK\n"; + } + } + } for my $line (@lines) { if ($line =~ /nettokom \| (.*) \| (\d)(.*) \| (\d).(\d)/) { my $label = $1; my $shortlabel = $label; $shortlabel =~ s/\s+//g; if (!(grep {$_ == $shortlabel} @exclude)) { - doubleprint "$shortlabel.label $label\n"; + if (!(grep {$_ == $shortlabel} @knowlabels)) { + doubleprint "$shortlabel.label $label\n"; + doubleprint "$shortlabel.draw STACK\n"; + } } } }