jablonka.czprosek.czf

crusader

Subversion Repositories:
[/] [trunk/] [statistiky/] [opt/] [statistiky/] [monitor_zebra/] [makeobr_zebra.sh] - Rev 2 Go to most recent revision

Compare with Previous - Blame - Download


#!/bin/bash

device=/var/statistiky/zebra

PATH=$PATH:/opt/rrdtool/bin

now=`date +%s`

function make_obr()
# $1 ... device
# $2 ... timediff
# $3 ... suffix
# $4 ... popis
{
    local device=$1
    local timediff=$2
    local suffix=$3
    local popis=$4

    if [ $# -lt 4 ]
    then
        echo "ERROR: function make_obr - Malo parametru"
        return 1
    fi

    rrdtool graph ${device}_${suffix}.png --imgformat PNG --start `expr $now - ${timediff}` --end $now \
        DEF:routes=${device}.rrd:count:AVERAGE \
        LINE2:routes#0000FF:"routes" \
        --vertical-label Pocet \
        --height 200 \
        --title "${popis}"

    mv ${device}_${suffix}.png /var/www/htdocs/stat/img
}

make_obr $device 86400 1den "pocet rout behem posledniho dne"
make_obr $device 604800 tyden "pocet rout behem posledniho tydne"

Powered by WebSVN 2.2.1