Files
scripts/Linux PTP RRD/config.txt
2024-10-14 00:08:40 +02:00

111 lines
3.8 KiB
Plaintext

rm database.rrd
rrdtool create read.rrd --step 30s \
DS:ds1:GAUGE:60:0:100 \
RRA:MIN:0:2960:2880 \
RRA:MIN:0:1480:2880 \
RRA:MIN:0:124:2880 \
RRA:MIN:0:8:2880 \
RRA:MIN:0:4:2880 \
RRA:MIN:0:1:2880 \
RRA:AVERAGE:0:2960:2880 \
RRA:AVERAGE:0:1480:2880 \
RRA:AVERAGE:0:124:2880 \
RRA:AVERAGE:0:8:2880 \
RRA:AVERAGE:0:4:2880 \
RRA:AVERAGE:0:1:2880 \
RRA:MAX:0:2960:2880 \
RRA:MAX:0:1480:2880 \
RRA:MAX:0:124:2880 \
RRA:MAX:0:8:2880 \
RRA:MAX:0:4:2880 \
RRA:MAX:0:1:2880
rrdtool fetch database.rrd MIN | tail
cd /mnt/syslog/scripts/rrd/
CWD=`pwd`
while [ "1" == "1" ]
do
R1=`tcpping -x 1 -c 10.101.0.230 23 | cut -d" " -f 3`
R2=`tcpping -x 1 -c 10.101.0.230 23 | cut -d" " -f 3`
rrdtool update $CWD/cs1.rrd N:$R1
echo $R1
rrdtool update $CWD/cs2.rrd N:$R2
echo $R2
echo ""
sleep 29
done
# Grafik Updaten
#!/bin/bash
cd /mnt/syslog/scripts/rrd/
CWD=`pwd`
ENDE=`date +%s`
START=`expr $ENDE - 3600`
rrdtool graph /var/www/cs1.png -Y --lower-limit 0 --upper-limit 30 --start $START --end $ENDE --width 800 --height 200 -c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:'DroidSansMono,DejaVuSansMono' --font AXIS:7:'DroidSansMono,DejaVuSansMono' --font-render-mode normal \
DEF:ping=$CWD/cs1.rrd:ds1:AVERAGE \
LINE1:ping#0000FF:"time (ms)" \
GPRINT:ping:LAST:"Cur\: %5.2lf" \
GPRINT:ping:AVERAGE:"Avg\: %5.2lf" \
GPRINT:ping:MAX:"Max\: %5.2lf" \
GPRINT:ping:MIN:"Min\: %5.2lf\t\t\t" \
COMMENT:"CS1 <IP1> ping"
rrdtool graph /var/www/cs2.png -Y --lower-limit 0 --upper-limit 30 --start $START --end $ENDE --width 800 --height 200 -c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:'DroidSansMono,DejaVuSansMono' --font AXIS:7:'DroidSansMono,DejaVuSansMono' --font-render-mode normal \
DEF:ping=$CWD/cs2.rrd:ds1:AVERAGE \
LINE1:ping#0000FF:"time (ms)" \
GPRINT:ping:LAST:"Cur\: %5.2lf" \
GPRINT:ping:AVERAGE:"Avg\: %5.2lf" \
GPRINT:ping:MAX:"Max\: %5.2lf" \
GPRINT:ping:MIN:"Min\: %5.2lf\t\t\t" \
COMMENT:"CS2 <IP2> ping"
################################################################################################################
################################################################################################################
################################################################################################################
cd /mnt/syslog/scripts/rrd/
CWD=`pwd`
while [ "1" == "1" ]
do
W1=`dd if=/dev/zero of=/mnt/syslog/iotest/testfile bs=100M count=1 oflag=dsync 2>&1 | grep kopiert | cut -d" " -f 8 | tr "," "."`
echo $W1
R1=`dd if=/mnt/syslog/iotest/testfile of=/dev/null bs=4k 2>&1 | grep kopiert | cut -d" " -f 8 | tr "," "."`
echo $R1
echo ""
rrdtool update $CWD/read.rrd N:$R1
rrdtool update $CWD/write.rrd N:$W1
sleep 29
done
ENDE=`date +%s`
START=`expr $ENDE - 3600`
cd /mnt/syslog/scripts/rrd/
CWD=`pwd`
rrdtool graph /var/www/rw.png -Y --lower-limit 0 --upper-limit 100 --start $START --end $ENDE --width 800 --height 200 -c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:'DroidSansMono,DejaVuSansMono' --font AXIS:7:'DroidSansMono,DejaVuSansMono' --font-render-mode normal \
DEF:read=$CWD/read.rrd:ds1:AVERAGE \
DEF:write=$CWD/write.rrd:ds1:AVERAGE \
LINE1:read#0000FF:"MB/s" \
GPRINT:read:LAST:"Cur\: %5.2lf" \
GPRINT:read:AVERAGE:"Avg\: %5.2lf" \
GPRINT:read:MAX:"Max\: %5.2lf" \
GPRINT:read:MIN:"Min\: %5.2lf" \
COMMENT:"Read\n" \
LINE2:write#FF0000:"MB/s" \
GPRINT:write:LAST:"Cur\: %5.2lf" \
GPRINT:write:AVERAGE:"Avg\: %5.2lf" \
GPRINT:write:MAX:"Max\: %5.2lf" \
GPRINT:write:MIN:"Min\: %5.2lf" \
COMMENT:"Write\n"