1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

dartybox: fix the date & labels

This commit is contained in:
Steve Schnepp 2013-12-06 20:57:56 +01:00
parent 9eeaa52662
commit 25722e7857

View file

@ -31,17 +31,17 @@ then
echo multigraph dbox_adsl_snr echo multigraph dbox_adsl_snr
echo graph_title DartyBox Adsl SignalNoise Ratio echo graph_title DartyBox Adsl SignalNoise Ratio
echo graph_category DartyBox echo graph_category DartyBox
echo up.label SNRNear echo up.label UpStream
echo down.label SNRFar echo down.label DownStream
echo multigraph dbox_adsl_pkt echo multigraph dbox_adsl_pkt
echo graph_title DartyBox Adsl Packets echo graph_title DartyBox Adsl Packets
echo graph_category DartyBox echo graph_category DartyBox
echo up.label RSWORDSNear echo up.label UpStream
echo down.label RSWORDSFar echo down.label DownStream
echo up_c.label RSCORRERRORNear echo up_c.label UpStream "(Correctable)"
echo down_c.label RSCORRERRORFar echo down_c.label DownStream "(Correctable)"
echo up_u.label RSUNCORRERRORNear echo up_u.label UpStream "(Uncorrectable)"
echo down_u.label RSUNCORRERRORFar echo down_u.label DownStream "(Uncorrectable)"
echo up.type DERIVE echo up.type DERIVE
echo down.type DERIVE echo down.type DERIVE
echo up_c.type DERIVE echo up_c.type DERIVE
@ -57,7 +57,8 @@ then
echo multigraph dbox_adsl_uptime echo multigraph dbox_adsl_uptime
echo graph_title DartyBox Adsl Uptime echo graph_title DartyBox Adsl Uptime
echo graph_category DartyBox echo graph_category DartyBox
echo uptime.label AdslUpTime echo graph_vlabel days
echo uptime.label Uptime
exit 0 exit 0
fi fi
@ -67,9 +68,16 @@ trap 'rm -f $TMPFILE' EXIT
wget -qO "$TMPFILE" http://$IP/adslstats.html wget -qO "$TMPFILE" http://$IP/adslstats.html
[ "$MUNIN_DEBUG" = 1 ] && cat "$TMPFILE"
get() { get() {
PATTERN=$1 PATTERN=$1
gawk "match(\$0, /var $PATTERN\s+=\s+\"([0-9.]+)\"/, a) { print a[1] }" $TMPFILE gawk "match(\$0, /var $PATTERN\s+=\s+\"([^\"]+)\"/, a) { print a[1] }" $TMPFILE
}
getDays() {
# Convert "20 jours 2 heures 2 mn" in a number of days
echo "$@" | gawk "match(\$0, /([0-9.]+) jours ([0-9.]+) heures ([0-9.]+) mn/, a) { print a[1] + a[2]/24 + a[3]/1440 }"
} }
echo multigraph dbox_adsl_bw echo multigraph dbox_adsl_bw
@ -89,7 +97,7 @@ echo down_c.value $(get RSCORRERRORFar)
echo up_u.value $(get RSUNCORRERRORNear) echo up_u.value $(get RSUNCORRERRORNear)
echo down_u.value $(get RSUNCORRERRORFar) echo down_u.value $(get RSUNCORRERRORFar)
echo multigraph dbox_adsl_uptime echo multigraph dbox_adsl_uptime
echo uptime.value $(get AdslUpTime) echo uptime.value $(getDays $(get AdslUpTime))
exit 0 exit 0