Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 60 lines (47 sloc) 1.177 kb
9f4cc66 Olivier Girondel munin scripts
oliv3 authored
1 #!/bin/bash
2
3 #
4 # YAWS server bytes sent
5 #
6 # Needs following minimal configuration in plugin-conf.d/munin-node:
7 # [yaws*]
8 # user root
9 #
10 # Magick markers
11 #%# family=auto
12 #%# capabilities=autoconf
13
14 ID=`basename $0 | sed 's/^yaws_sent_//g'`
15 TMPFILE=.yaws_sent_$ID
16 STATS=`yaws --stats --id $ID | tail --lines=+2 > $TMPFILE`
17
18 if [ "$1" = "autoconf" ]; then
19 if which yaws > /dev/null; then
20 echo yes
21 exit 0
22 else
23 echo no
24 exit 1
25 fi
26 fi
27
28 if [ "$1" = "config" ]; then
29 echo graph_title Bytes sent by server $ID
30 echo graph_vlabel Bytes
31 echo graph_category Yaws
32 echo graph_args --base 1024 -l 0
33
34 while read line; do
35 HOST=`echo $line | awk '{ print $1 }'`
36 FIELD=`echo $HOST | sed 's/[\.:]/_/g'`
37
38 echo $FIELD.label $HOST
39 echo $FIELD.draw LINE2
40 echo $FIELD.type DERIVE
41 echo $FIELD.min 0
42 done < $TMPFILE
43
44 rm -f $TMPFILE
45
46 exit 0
47 fi
48
49 while read line; do
50 HOST=`echo $line | awk '{ print $1 }'`
51 FIELD=`echo $HOST | sed 's/[\.:]/_/g'`
52 SENT=`echo $line | awk '{ print $5 }'`
53
54 echo $FIELD.value $SENT
55 done < $TMPFILE
56
57 rm -f $TMPFILE
58
59 exit 0
Something went wrong with that request. Please try again.