PluginCat: pastmon

File pastmon, 0.8 kB (added by frankg@fgleason.com, 6 years ago)

pastmon.sourceforge.net output grapher. Simple log grepper. use pastmon -r300 >/var/log/pastmon to collect data.

Line 
1 #!/bin/sh
2 #
3 # Plugin to measure transactoin response time.
4 #
5 # measures average estimated delivery time from first request to final response
6 #
7 # Magic markers - optional - used by installation scripts and
8 # munin-config:
9 #
10 #%# family=manual
11 #%# capabilities=autoconf
12
13 if [ "$1" = "autoconf" ]; then
14         echo yes
15         exit 0
16 fi
17
18 if [ "$1" = "config" ]; then
19
20         echo 'graph_title Delivery time'
21         echo 'graph_args --base 1000 -l 0 '
22         echo 'graph_vlabel Average Transaction Delivery Time'
23         echo 'adt.label Average Seconds'
24         echo 'adt.draw LINE1'
25         echo 'mdt.label Max Delivery Time
26         echo 'mdt.draw LINE2   
27         exit 0
28 fi
29
30 strings /var/log/pastmon | grep ip2co | awk 'BEGIN{mdt=0}{if ($46 > mdt){mdt=$46}c+=$12;t+=$46}END{if (t != 0){print "adt.value", t/c;print "mdt.value", mdt}}'
31 cat /dev/null >/var/log/pastmon