From 5f5b657065122b43599f0908f403301dbc05f5c4 Mon Sep 17 00:00:00 2001 From: Cristian Ditoiu Date: Fri, 9 Apr 2010 00:35:07 +0200 Subject: [PATCH] Initial version --- plugins/other/trafic_ro_24h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 plugins/other/trafic_ro_24h diff --git a/plugins/other/trafic_ro_24h b/plugins/other/trafic_ro_24h new file mode 100755 index 00000000..0e4ab979 --- /dev/null +++ b/plugins/other/trafic_ro_24h @@ -0,0 +1,17 @@ +#!/bin/sh +RID=${0##*trafic_ro_} + +if [ "$1" = "config" ]; then + echo graph_title $V 24h visitors for $RID + echo 'graph_args --base 1000' + echo 'graph_vlabel vizitatori_ultimele_24_ore' + echo 'graph_category Trafic_ro' + echo 'graph_info 24h visitors.' + echo "24h_visitors.label $RID" + echo "24h_visitors.info 24H visitors for $RID" + echo '24h_visitors.draw LINE2' + exit 0 +fi + +VISITORS="$(echo 'munin' | curl curl --silent -X POST -H 'Content-type: text/xml' -d @- http://api.trafic.ro/rest/0.01/sumar-site/$RID | xmlstarlet sel -t -m "/sumar-site/vizitatori_ultimele_24_ore" -v ".")" +echo "24h_visitors.value" $VISITORS;