root / plugins / trafic_ro / trafic_ro_24h @ 72e4561a
Historique | Voir | Annoter | Télécharger (725 octets)
| 1 | 5f5b6570 | Cristian Ditoiu | #!/bin/sh |
|---|---|---|---|
| 2 | RID=${0##*trafic_ro_}
|
||
| 3 | |||
| 4 | if [ "$1" = "config" ]; then |
||
| 5 | echo graph_title $V 24h visitors for $RID |
||
| 6 | echo 'graph_args --base 1000' |
||
| 7 | echo 'graph_vlabel vizitatori_ultimele_24_ore' |
||
| 8 | echo 'graph_category Trafic_ro' |
||
| 9 | echo 'graph_info 24h visitors.' |
||
| 10 | echo "24h_visitors.label $RID" |
||
| 11 | echo "24h_visitors.info 24H visitors for $RID" |
||
| 12 | echo '24h_visitors.draw LINE2' |
||
| 13 | exit 0 |
||
| 14 | fi |
||
| 15 | |||
| 16 | VISITORS="$(echo '<doc><item>munin</item></doc>' | 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 ".")" |
||
| 17 | echo "24h_visitors.value" $VISITORS; |
