jablonka.czprosek.czf

crusader

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

 

Line No. Rev Author Line
11simandl#!/bin/bash
2 
3if [ $# -lt 4 ]
4then
5 echo "Usage: `basename $0` <time interval> <file suffix> <graph comment> [graph width]"
6 exit 1;
7fi
8 
9name=teplota
10timediff=$1
11suffix=$2
12popis=$3
13 
14if [ $# -ge 4 ]
15then
16 width=$4
17else
18 width=400
19fi
20 
21#PATH=$PATH:/opt/rrdtool/bin
22 
23datadir="/var/statistiky/system"
24target_img_dir="/var/www/heaven/stat/img"
25 
26cd $datadir
27 
28now=`date +%s`
29 
30xgridstr=""
31if [ $timediff -gt 108000 ]; then xgridstr="--x-grid HOUR:6:DAY:1:DAY:1:86400:%d.%m."; fi
32if [ $timediff -gt 777600 ]; then xgridstr="--x-grid DAY:1:WEEK:1:WEEK:1:86400:%d.%m."; fi
33 
34 
35 
36function temp_prime_nekonsolidovane_hodnoty()
37{
38 rrdtool graph ${target_img_dir}/${name}_${suffix}.png --imgformat PNG --start $(($now-${timediff})) --end $now \
39 DEF:hdd_avg=${name}.rrd:hdd_temp:AVERAGE \
40 HRULE:40#000000 \
41 LINE2:hdd_avg#202020:"HDD" \
42 --vertical-label "Teplota [st.C]" \
43 --height 200 \
44 --width ${width} \
45 ${xgridstr} \
46 --title "${name} ${popis}" \
47 --lower-limit 0
48}
49 
50if [ true ]
51then
52 temp_prime_nekonsolidovane_hodnoty
53else
54 temp_prime_nekonsolidovane_hodnoty
55fi

Powered by WebSVN 2.2.1