![]() ![]() |
crusader |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/bin/bashif [ $# -lt 4 ]thenecho "Usage: `basename $0` <time interval> <file suffix> <graph comment> [graph width]"exit 1;finame=teplotatimediff=$1suffix=$2popis=$3if [ $# -ge 4 ]thenwidth=$4elsewidth=400fi#PATH=$PATH:/opt/rrdtool/bindatadir="/var/statistiky/system"target_img_dir="/var/www/heaven/stat/img"cd $datadirnow=`date +%s`xgridstr=""if [ $timediff -gt 108000 ]; then xgridstr="--x-grid HOUR:6:DAY:1:DAY:1:86400:%d.%m."; fiif [ $timediff -gt 777600 ]; then xgridstr="--x-grid DAY:1:WEEK:1:WEEK:1:86400:%d.%m."; fifunction temp_prime_nekonsolidovane_hodnoty(){rrdtool graph ${target_img_dir}/${name}_${suffix}.png --imgformat PNG --start $(($now-${timediff})) --end $now \DEF:hdd_avg=${name}.rrd:hdd_temp:AVERAGE \HRULE:40#000000 \LINE2:hdd_avg#202020:"HDD" \--vertical-label "Teplota [st.C]" \--height 200 \--width ${width} \${xgridstr} \--title "${name} ${popis}" \--lower-limit 0}if [ true ]thentemp_prime_nekonsolidovane_hodnotyelsetemp_prime_nekonsolidovane_hodnotyfi