jablonka.czprosek.czf

crusader

Subversion Repositories:
[/] [trunk/] [statistiky/] [opt/] [statistiky/] [monitor_zebra/] [makeobr_zebra.sh] - Blame information for rev 3

 

Line No. Rev Author Line
11simandl#!/bin/bash
2 
3device=/var/statistiky/zebra
4 
5PATH=$PATH:/opt/rrdtool/bin
6 
7now=`date +%s`
8 
9function make_obr()
10# $1 ... device
11# $2 ... timediff
12# $3 ... suffix
13# $4 ... popis
14{
15 local device=$1
16 local timediff=$2
17 local suffix=$3
18 local popis=$4
19 
20 if [ $# -lt 4 ]
21 then
22 echo "ERROR: function make_obr - Malo parametru"
23 return 1
24 fi
25 
26 rrdtool graph ${device}_${suffix}.png --imgformat PNG --start `expr $now - ${timediff}` --end $now \
27 DEF:routes=${device}.rrd:count:AVERAGE \
28 LINE2:routes#0000FF:"routes" \
29 --vertical-label Pocet \
30 --height 200 \
31 --title "${popis}"
32 
33 mv ${device}_${suffix}.png /var/www/htdocs/stat/img
34}
35 
36make_obr $device 86400 1den "pocet rout behem posledniho dne"
37make_obr $device 604800 tyden "pocet rout behem posledniho tydne"

Powered by WebSVN 2.2.1