From ce0ff420165ad8a7f5f7881e3d80553f708e9c8c Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Tue, 26 May 2009 16:19:40 +0200 Subject: [PATCH] [munin/uptime_switch] timeout plus faible, manifesteement munin n'aime pas les tirets dans les noms de variables darcs-hash:20090526141940-bd074-676eb42d7bbf85bb2226f8ce59875eb53f9138c5.gz --- munin/uptime_switch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/munin/uptime_switch b/munin/uptime_switch index 7cb6443d..affa112a 100755 --- a/munin/uptime_switch +++ b/munin/uptime_switch @@ -18,13 +18,13 @@ if [ "$1" = "config" ]; then echo 'graph_vlabel uptime in days' for i in multiprise \ `host -l adm.crans.org | sed -ne 's/\(bat[a-u]-[0-9]\).*$/\1/p'`; do - echo "$i.label uptime $i"; done + echo "${i/-/}.label uptime $i"; done exit 0 fi for i in multiprise \ `host -l adm.crans.org | sed -ne 's/\(bat[a-u]-[0-9]\).*$/\1/p'`; do - (snmpget -O v -v 1 -c public $i sysUpTimeInstance 2> /dev/null || true) | \ - perl -nle "{ /[0-9]+/; print sprintf(\"$i.value %.2f\", ($& / 8640000));}"& + snmpget -t 0.05 -O v -v 1 -c public $i sysUpTimeInstance 2> /dev/null | \ + perl -nle "{ /\d+/; print sprintf(\"${i/-/}.value %.2f\", ($&/8640000));}"& done