From 53acc8b273ef7cbbb5eab9d99fa07b6d6019eaeb Mon Sep 17 00:00:00 2001 From: Julien Vehent Date: Wed, 2 Nov 2011 16:23:41 -0400 Subject: [PATCH] added the scripts for rrd graph generation --- htb_graph_borrowed_1hour.sh | 30 ++++++++++++++++++++++++++++++ htb_graph_sent_bits_1hour.sh | 30 ++++++++++++++++++++++++++++++ htb_graph_sent_packets_1hour.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 htb_graph_borrowed_1hour.sh create mode 100644 htb_graph_sent_bits_1hour.sh create mode 100644 htb_graph_sent_packets_1hour.sh diff --git a/htb_graph_borrowed_1hour.sh b/htb_graph_borrowed_1hour.sh new file mode 100644 index 0000000..f19f7cc --- /dev/null +++ b/htb_graph_borrowed_1hour.sh @@ -0,0 +1,30 @@ +rrd=/var/lib/htb_collect/borrowed.rrd + +rrdtool graph borrowed-1hour.png -s -1h \ +-w 600 -h 200 \ +-t "Borrowed tokens for the last hour on $(hostname)" \ +"DEF:interactive=$rrd:100:AVERAGE" \ +'LINE2:interactive#ffe400:interactive:' \ +'GPRINT:interactive:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:interactive:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:interactive:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:tcp_acks=$rrd:200:AVERAGE" \ +'LINE2:tcp_acks#b535ff:tcp_acks:' \ +'GPRINT:tcp_acks:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:tcp_acks:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:tcp_acks:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:ssh=$rrd:300:AVERAGE" \ +'LINE2:ssh#1b7b16:ssh:' \ +'GPRINT:ssh:MAX:\t\tmax = %6.2lf%Sbps' \ +'GPRINT:ssh:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:ssh:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:http_s=$rrd:400:AVERAGE" \ +'LINE2:http_s#ff0000:http_s:' \ +'GPRINT:http_s:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:http_s:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:http_s:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:default=$rrd:999:AVERAGE" \ +'LINE2:default#bcdd94:default:' \ +'GPRINT:default:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:default:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:default:AVERAGE:\tavg = %6.2lf%Sbps\n' diff --git a/htb_graph_sent_bits_1hour.sh b/htb_graph_sent_bits_1hour.sh new file mode 100644 index 0000000..f54a86c --- /dev/null +++ b/htb_graph_sent_bits_1hour.sh @@ -0,0 +1,30 @@ +rrd=/var/lib/htb_collect/bits_sent.rrd + +rrdtool graph bits_sent-1hour.png -s -1h \ +-w 600 -h 200 \ +-t "Sent Bits for the last hour on $(hostname)" \ +"DEF:interactive=$rrd:100:AVERAGE" \ +'AREA:interactive#ffe400:interactive:STACK' \ +'GPRINT:interactive:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:interactive:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:interactive:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:tcp_acks=$rrd:200:AVERAGE" \ +'AREA:tcp_acks#b535ff:tcp_acks:STACK' \ +'GPRINT:tcp_acks:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:tcp_acks:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:tcp_acks:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:ssh=$rrd:300:AVERAGE" \ +'AREA:ssh#1b7b16:ssh:STACK' \ +'GPRINT:ssh:MAX:\t\tmax = %6.2lf%Sbps' \ +'GPRINT:ssh:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:ssh:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:http_s=$rrd:400:AVERAGE" \ +'AREA:http_s#ff0000:http_s:STACK' \ +'GPRINT:http_s:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:http_s:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:http_s:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:default=$rrd:999:AVERAGE" \ +'AREA:default#bcdd94:default:STACK' \ +'GPRINT:default:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:default:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:default:AVERAGE:\tavg = %6.2lf%Sbps\n' diff --git a/htb_graph_sent_packets_1hour.sh b/htb_graph_sent_packets_1hour.sh new file mode 100644 index 0000000..75a48ee --- /dev/null +++ b/htb_graph_sent_packets_1hour.sh @@ -0,0 +1,30 @@ +rrd=/var/lib/htb_collect/packet_sent.rrd + +rrdtool graph packets_sent-1hour.png -s -1h \ +-w 600 -h 200 \ +-t "Sent packets for the last hour on $(hostname)" \ +"DEF:interactive=$rrd:100:AVERAGE" \ +'AREA:interactive#ffe400:interactive:STACK' \ +'GPRINT:interactive:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:interactive:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:interactive:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:tcp_acks=$rrd:200:AVERAGE" \ +'AREA:tcp_acks#b535ff:tcp_acks:STACK' \ +'GPRINT:tcp_acks:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:tcp_acks:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:tcp_acks:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:ssh=$rrd:300:AVERAGE" \ +'AREA:ssh#1b7b16:ssh:STACK' \ +'GPRINT:ssh:MAX:\t\tmax = %6.2lf%Sbps' \ +'GPRINT:ssh:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:ssh:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:http_s=$rrd:400:AVERAGE" \ +'AREA:http_s#ff0000:http_s:STACK' \ +'GPRINT:http_s:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:http_s:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:http_s:AVERAGE:\tavg = %6.2lf%Sbps\n' \ +"DEF:default=$rrd:999:AVERAGE" \ +'AREA:default#bcdd94:default:STACK' \ +'GPRINT:default:MAX:\tmax = %6.2lf%Sbps' \ +'GPRINT:default:LAST:\tlast = %6.2lf%Sbps' \ +'GPRINT:default:AVERAGE:\tavg = %6.2lf%Sbps\n'