From 7e1661a7b813a31e2ef47a065cb39aad724f1fa5 Mon Sep 17 00:00:00 2001 From: Sean Reifschneider Date: Thu, 10 Dec 2009 13:53:44 +0100 Subject: [PATCH] Initial version --- plugins/other/pdns_rec_cache_size | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 plugins/other/pdns_rec_cache_size diff --git a/plugins/other/pdns_rec_cache_size b/plugins/other/pdns_rec_cache_size new file mode 100755 index 00000000..bab0ec46 --- /dev/null +++ b/plugins/other/pdns_rec_cache_size @@ -0,0 +1,45 @@ +#!/bin/sh +# +# pdns_recursor munin plugin. +# Written by Sean Reifschneider 2009-12-03 +# Placed in the public domain +# +# Requires running as root: +# +# echo '[pdns_rec_*]' >/etc/munin/plugin-conf.d/pdns_rec +# echo 'user root' >>/etc/munin/plugin-conf.d/pdns_rec + +if [ "$1" = "autoconf" ]; then + if [ -e /usr/bin/rec_control ]; then + echo yes + exit 0 + else + echo no + exit 1 + fi +fi + +if [ "$1" = "config" ]; then + echo 'graph_title PDNS Cache Size' + echo 'graph_order entries negative' + echo 'graph_vlabel entries' + echo 'graph_info Size of the cache' + echo 'graph_category pdns' + + echo 'entries.label Entries' + echo 'entries.min 0' + echo 'entries.type GAUGE' + echo 'entries.info Cache entries' + + echo 'negative.label Negative entries' + echo 'negative.min 0' + echo 'negative.type GAUGE' + echo 'negative.info Cache negative entries' + + exit 0 +fi + +echo entries.value `rec_control get cache-entries` +echo negative.value `rec_control get negcache-entries` + +exit 0