root / plugins / network / tinydns_err @ dd4afac8
Historique | Voir | Annoter | Télécharger (1,44 ko)
| 1 | c3e4adb1 | Lapo Luchini | #!/bin/sh |
|---|---|---|---|
| 2 | # |
||
| 3 | # Shows DNS query statistics as gathered by tinystats by Luca Morettoni. |
||
| 4 | # |
||
| 5 | # Parameters: |
||
| 6 | # |
||
| 7 | # config (required) |
||
| 8 | # autoconf (optional - used by munin-config) |
||
| 9 | # |
||
| 10 | #%# family=auto |
||
| 11 | #%# capabilities=autoconf |
||
| 12 | |||
| 13 | |||
| 14 | if [ "$1" = "autoconf" ]; then |
||
| 15 | if [ -f "/var/service/tinydns/log/main/tinystats.out" ]; then |
||
| 16 | echo yes; |
||
| 17 | else |
||
| 18 | echo no; |
||
| 19 | fi |
||
| 20 | exit 0; |
||
| 21 | fi |
||
| 22 | |||
| 23 | if [ "$1" = "config" ]; then |
||
| 24 | |||
| 25 | cat - <<EOF |
||
| 26 | graph_title tinydns query errors |
||
| 27 | graph_args --base 1000 -l 0 |
||
| 28 | graph_vlabel queries/sec |
||
| 29 | graph_category network |
||
| 30 | graph_info This graph shows the number of queries that tinydns processed. |
||
| 31 | graph_total Total |
||
| 32 | other.label Other RR |
||
| 33 | other.info The number of other RR queries. |
||
| 34 | other.type DERIVE |
||
| 35 | other.min 0 |
||
| 36 | other.draw AREA |
||
| 37 | notauth.label Not authotitative |
||
| 38 | notauth.info The number of not authotitative queries. |
||
| 39 | notauth.type DERIVE |
||
| 40 | notauth.min 0 |
||
| 41 | notauth.draw STACK |
||
| 42 | notimpl.label Not implemented |
||
| 43 | notimpl.info The number of not implemented queries. |
||
| 44 | notimpl.type DERIVE |
||
| 45 | notimpl.min 0 |
||
| 46 | notimpl.draw STACK |
||
| 47 | badclass.label Bad class type |
||
| 48 | badclass.info The number of bad class type queries. |
||
| 49 | badclass.type DERIVE |
||
| 50 | badclass.min 0 |
||
| 51 | badclass.draw STACK |
||
| 52 | noquery.label Empty query |
||
| 53 | noquery.info The number of empty queries. |
||
| 54 | noquery.type DERIVE |
||
| 55 | noquery.min 0 |
||
| 56 | noquery.draw STACK |
||
| 57 | EOF |
||
| 58 | exit 0 |
||
| 59 | fi |
||
| 60 | |||
| 61 | cat /var/service/tinydns/log/main/tinystats.out | head -n 1 | awk -F: '{ printf "other.value %d\nnotauth.value %d\nnotimpl.value %d\nbadclass.value %d\nnoquery.value %d\n", $16, $17, $18, $19, $20 }' |
