root / plugins / pdns / pdns_rec_cache @ e5ce7492
Historique | Voir | Annoter | Télécharger (1,32 ko)
| 1 | a6eb89e7 | Sean Reifschneider | #!/bin/sh |
|---|---|---|---|
| 2 | # |
||
| 3 | # pdns_recursor munin plugin. |
||
| 4 | # Written by Sean Reifschneider <jafo@tummy.com> 2009-12-03 |
||
| 5 | # Placed in the public domain |
||
| 6 | # |
||
| 7 | # Requires running as root: |
||
| 8 | # |
||
| 9 | # echo '[pdns_rec_*]' >/etc/munin/plugin-conf.d/pdns_rec |
||
| 10 | # echo 'user root' >>/etc/munin/plugin-conf.d/pdns_rec |
||
| 11 | |||
| 12 | if [ "$1" = "autoconf" ]; then |
||
| 13 | if [ -e /usr/bin/rec_control ]; then |
||
| 14 | echo yes |
||
| 15 | exit 0 |
||
| 16 | else |
||
| 17 | echo no |
||
| 18 | exit 1 |
||
| 19 | fi |
||
| 20 | fi |
||
| 21 | |||
| 22 | RESENDS=`rec_control get cache-resends` |
||
| 23 | ISRESENDS="" |
||
| 24 | [ "$RESENDS" != "UNKNOWN" ] && ISRESENDS="resends" |
||
| 25 | |||
| 26 | if [ "$1" = "config" ]; then |
||
| 27 | echo 'graph_title PDNS Cache' |
||
| 28 | echo "graph_order hits misses $ISRESENDS" |
||
| 29 | echo 'graph_vlabel entries' |
||
| 30 | echo 'graph_info Hit/miss rate' |
||
| 31 | echo 'graph_category pdns' |
||
| 32 | |||
| 33 | echo 'hits.label hits' |
||
| 34 | echo 'hits.min 0' |
||
| 35 | echo 'hits.max 100000' |
||
| 36 | echo 'hits.type COUNTER' |
||
| 37 | echo 'hits.info Cache hits' |
||
| 38 | |||
| 39 | echo 'misses.label misses' |
||
| 40 | echo 'misses.min 0' |
||
| 41 | echo 'misses.max 100000' |
||
| 42 | echo 'misses.type COUNTER' |
||
| 43 | echo 'misses.info Cache misses' |
||
| 44 | |||
| 45 | if [ "$RESENDS" != "UNKNOWN" ]; then |
||
| 46 | echo 'resends.label resends' |
||
| 47 | echo 'resends.min 0' |
||
| 48 | echo 'resends.max 100000' |
||
| 49 | echo 'resends.type COUNTER' |
||
| 50 | echo 'resends.info Cache resends' |
||
| 51 | fi |
||
| 52 | |||
| 53 | exit 0 |
||
| 54 | fi |
||
| 55 | |||
| 56 | echo hits.value `rec_control get cache-hits` |
||
| 57 | echo misses.value `rec_control get cache-misses` |
||
| 58 | [ "$RESENDS" != "UNKNOWN" ] && echo resends.value `rec_control get cache-resends` |
||
| 59 | |||
| 60 | exit 0 |
