1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Gallery: single dirname shall show up as second level heading

This commit is contained in:
dipohl 2017-02-22 00:57:32 +01:00
parent 4a87dd9cba
commit abd4092268
22 changed files with 0 additions and 0 deletions

View file

@ -1,140 +0,0 @@
#!/usr/bin/perl
#
# Copyright Jean-Samuel Reynaud <js.reynaud@free.fr>
# Licenced under GPL v2
#
# We use this script to produce graph with munin for dns requests
# This script must have his name start with bind95_
# bind95_ : Global bind statistic
# bind95_test.com : Bind statistic for test.com zone (no view)
# bind95_test.com@internal : Bind statistic for test.com zone (view internal)
# This version work with bind 9.5
#
# Thanks for Benjamin Pineau for perl cleaning and corrections
#
# You should have to add the following lines to you plugin configuration
# (/etc/munin/plugin-conf.d/munin-node):
#[bind95_*]
#user root
#stat_file /var/cache/bind/named.stats
#rndc /usr/sbin/rndc
#
#
# Magic markers
#%# family=auto
#%# capabilities=autoconf
use strict;
use warnings;
use Digest::MD5 qw(md5_hex);
# change those to reflect your bind configuration (use plugin configuration)
# stat file
my $stat_file = $ENV{'stat_file'} || "/var/cache/bind/named.stats";
# rndc path
my $rndc = $ENV{'rndc'} || "/usr/sbin/rndc";
my $domain = $0;
if ($domain =~ m/^.*bind95_[\w\d\._\-]+@[\w\d\._\-]+?$/) {
$domain =~ s/^.*bind95_([\w\d\._\-]*)@([\w\d\._\-]+)?$/$1 (view: $2)/;
} elsif ($domain =~ m/^.*bind95_[\w\d\._\-]+$/) {
$domain =~ s/^.*bind95_([\w\d\._\-]+)$/$1/;
} else {
$domain = "View: _bind";
}
my @counters = (
'IPv4 requests received',
'requests with EDNS(0) received',
'TCP requests received',
'auth queries rejected',
'recursive queries rejected',
'transfer requests rejected',
'update requests rejected',
'responses sent',
'truncated responses sent',
'responses with EDNS(0) sent',
'queries resulted in successful answer',
'queries resulted in authoritative answer',
'queries resulted in non authoritative answer',
'queries resulted in referral answer',
'queries resulted in nxrrset',
'queries resulted in SERVFAIL',
'queries resulted in NXDOMAIN',
'queries caused recursion',
'duplicate queries received',
'queries dropped',
'other query failures',
'requested transfers completed',
'transfer requests succeeded',
'IPv4 notifies sent',
'IPv4 notifies received',
'notifies rejected',
'IPv4 SOA queries sent',
'IPv4 IXFR requested'
);
# Parse the statistic file
sub parseFile {
my $dom = shift @_;
open(IN,"<$stat_file") or die "Can't open $stat_file : $!";
my $current_zone = "";
while (<IN>) {
chomp;
my $l = $_;
if ($l =~ /\[/ ) {
$l =~ s/\[//g;
$l =~ s/\]//g;
$current_zone = $l;
} else {
$l =~ s/^ *//g;
if ($l =~ /^[0-9]/ && $current_zone eq $domain) {
my ($val,$desc) = split(' ',$l,2);
if (grep { $desc eq $_ } @counters) {
printf "%s.value %u\n",md5_hex($desc),$val;
}
}
}
}
close(IN);
}
# Config mode
if ( defined($ARGV[0]) && $ARGV[0] eq "config" ) {
printf "graph_title Dns requests %s\n",($domain eq "View: _bind" ? " all domains":$domain);
printf "graph_vlabel requests/s\n";
printf "graph_category dns\n";
printf "graph_info This graph display dns requests for %s\n",($domain eq "View: _bind" ? "all domains":$domain);
foreach(@counters) {
my $s = $_;
printf "%s.label %s\n",md5_hex($s),$s;
printf "%s.type DERIVE\n",md5_hex($s);
printf "%s.min 0\n",md5_hex($s);
}
exit 0;
}
if ( defined($ARGV[0]) && $ARGV[0] eq "autoconf" ) {
if (! -f $stat_file) {
printf "Unable to file bind stat file on %s",$stat_file;
exit 1;
}
if (! -f $rndc) {
printf "Unable to file rndc tool (configured : %s)",$rndc;
exit 1;
}
exit 0;
}
# Remove old stat file
unlink ($stat_file);
# Ask to bind to build new one
`$rndc stats`;
# Parse the stat file and return result
parseFile($domain);

View file

@ -1,95 +0,0 @@
#!/bin/bash
#
# Plugin to monitor Bind9 Name Server Resolver Stats
#
# Author:
# Dave Fennell <dave@microtux.co.uk>
#
# Created:
# 20th December 2012
#
# License:
# GPLv2
#
# Usage:
# Place in /etc/munin/plugins/ (or link it there using ln -s)
#
# change those to reflect your bind configuration (use plugin configuration)
# stat file
if [ "$stat_file" = "" ]; then
stat_file="/var/cache/bind/named.stats"
fi
# rndc path
if [ "$rndc" = "" ]; then
rndc="/usr/sbin/rndc"
fi
# Blank the stats file (else stats are appended not replaced)
rm ${stat_file}
# Ask to bind to build new one
${rndc} stats
# The section we are looking for in the stats.
section="Resolver Statistics"
# Get all the lines in the section:
# - cat the file
# - use sed to get lines after (and excluding) the section start tag
# - use sed to get lines up to (and excluding) the next section start tag
# - use grep to remove any lines starting with a [
cmd='cat "/var/cache/bind/named.stats" | sed "0,/^\+\+ '${section}' \+\+/d" | sed -e "/^\+\+/,\$d" | grep -v "^\["'
# Config mode.
if [ "$1" = "config" ]; then
echo 'graph_args --lower-limit 0'
echo 'graph_category dns'
echo 'graph_info '${section}' for the Bind9 Name Server'
echo 'graph_scale no'
echo 'graph_title Bind9 '${section}
echo 'graph_vlabel requests/${graph_period}'
# Output the stat configs.
eval ${cmd} | while read num name
do
# Shorten some names.
label=${name//queries with /}
label=${label//</below}
label=${label//>/above}
# All lowercase.
label=$(echo "$label" | tr 'A-Z' 'a-z')
# Now change names to all have no spaces.
key=${label//[ -]/_}
echo ${key}.label ${label}
echo ${key}.info ${name}
echo ${key}.type COUNTER
done
# If dirty config capability is enabled then fall through
# to output the data with the config information.
if [ "$MUNIN_CAP_DIRTYCONFIG" = "" ]; then
exit 0
fi
fi
# Output the stats.
eval ${cmd} | while read num name
do
# Shorten some names.
label=${name//queries with /}
label=${label//</below}
label=${label//>/above}
# All lowercase.
label=$(echo "$label" | tr 'A-Z' 'a-z')
# Now change names to all have no spaces.
key=${label//[ -]/_}
echo ${key}.value ${num}
done

View file

@ -1,93 +0,0 @@
#!/bin/bash
#
# Plugin to monitor Bind9 Name Server Stats
#
# Author:
# Dave Fennell <dave@microtux.co.uk>
#
# Created:
# 20th December 2012
#
# License:
# GPLv2
#
# Usage:
# Place in /etc/munin/plugins/ (or link it there using ln -s)
#
# change those to reflect your bind configuration (use plugin configuration)
# stat file
if [ "$stat_file" = "" ]; then
stat_file="/var/cache/bind/named.stats"
fi
# rndc path
if [ "$rndc" = "" ]; then
rndc="/usr/sbin/rndc"
fi
# Blank the stats file (else stats are appended not replaced)
rm ${stat_file}
# Ask to bind to build new one
${rndc} stats
# The section we are looking for in the stats.
section="Name Server Statistics"
# Get all the lines in the section:
# - cat the file
# - use sed to get lines after (and excluding) the section start tag
# - use sed to get lines up to (and excluding) the next section start tag
# - use grep to remove any lines starting with a [
cmd='cat "/var/cache/bind/named.stats" | sed "0,/^\+\+ '${section}' \+\+/d" | sed -e "/^\+\+/,\$d" | grep -v "^\["'
# Config mode.
if [ "$1" = "config" ]; then
echo 'graph_args --lower-limit 0'
echo 'graph_category dns'
echo 'graph_info '${section}' for the Bind9 Name Server'
echo 'graph_scale no'
echo 'graph_title Bind9 '${section}
echo 'graph_vlabel requests/${graph_period}'
# Output the stat configs.
eval ${cmd} | while read num name
do
# Shorten some names.
label=${name//queries resulted in /}
label=${label// answer/}
# All lowercase.
label=$(echo "$label" | tr 'A-Z' 'a-z')
# Now change names to all have no spaces.
key=${label// /_}
echo ${key}.label ${label}
echo ${key}.info ${name}
echo ${key}.type COUNTER
done
# If dirty config capability is enabled then fall through
# to output the data with the config information.
if [ "$MUNIN_CAP_DIRTYCONFIG" = "" ]; then
exit 0
fi
fi
# Output the stats.
eval ${cmd} | while read num name
do
# Shorten some names.
label=${name//queries resulted in /}
label=${label// answer/}
# All lowercase.
label=$(echo "$label" | tr 'A-Z' 'a-z')
# Now change names to all have no spaces.
key=${label// /_}
echo ${key}.value ${num}
done

View file

@ -1,87 +0,0 @@
#!/bin/bash
#
# Plugin to monitor Bind9 Name Server Socket Stats
#
# Author:
# Dave Fennell <dave@microtux.co.uk>
#
# Created:
# 20th December 2012
#
# License:
# GPLv2
#
# Usage:
# Place in /etc/munin/plugins/ (or link it there using ln -s)
#
# change those to reflect your bind configuration (use plugin configuration)
# stat file
if [ "$stat_file" = "" ]; then
stat_file="/var/cache/bind/named.stats"
fi
# rndc path
if [ "$rndc" = "" ]; then
rndc="/usr/sbin/rndc"
fi
# Blank the stats file (else stats are appended not replaced)
rm ${stat_file}
# Ask to bind to build new one
${rndc} stats
# The section we are looking for in the stats.
section="Socket I/O Statistics"
# Get all the lines in the section:
# - cat the file
# - use sed to get lines after (and excluding) the section start tag
# - use sed to get lines up to (and excluding) the next section start tag
# - use grep to remove any lines starting with a [
cmd='cat "/var/cache/bind/named.stats" | sed "0,/^\+\+ '${section//\//\\/}' \+\+/d" | sed -e "/^\+\+/,\$d" | grep -v "^\["'
# Config mode.
if [ "$1" = "config" ]; then
echo 'graph_args --lower-limit 0'
echo 'graph_category dns'
echo 'graph_info '${section}' for the Bind9 Name Server'
echo 'graph_scale no'
echo 'graph_title Bind9 '${section}
echo 'graph_vlabel requests/${graph_period}'
# Output the stat configs.
eval ${cmd} | while read num name
do
label=${name}
# All lowercase.
key=$(echo "$name" | tr 'A-Z' 'a-z')
# Now change names to all have no spaces.
key=${key//[\/ - ]/_}
echo ${key}.label ${label}
echo ${key}.info ${name}
echo ${key}.type COUNTER
done
# If dirty config capability is enabled then fall through
# to output the data with the config information.
if [ "$MUNIN_CAP_DIRTYCONFIG" = "" ]; then
exit 0
fi
fi
# Output the stats.
eval ${cmd} | while read num name
do
# All lowercase.
key=$(echo "$name" | tr 'A-Z' 'a-z')
# Now change names to all have no spaces.
key=${key//[\/ - ]/_}
echo ${key}.value ${num}
done

View file

@ -1,115 +0,0 @@
#!/usr/bin/perl
#
# Copyright Jean-Samuel Reynaud <js.reynaud@free.fr>
# Licenced under GPL v2
#
# We use this script to produce graph with munin for dns requests
# This script must have his name start with bind_
# bind_ : Global bind statistic
# bind_test.com : Bind statistic for test.com zone
#
# "env.bind_stat_file" is the path to the bind statistic file
# (/var/cache/bind/named.stats by default).
#
# "env.bind_rndc" is the path to the rndc tool
# (/usr/sbin/rndc by default).
#
# Thanks for Benjamin Pineau for perl cleaning and correction in non root
# running
# Thanks to Immanuel Klinkenberg for adding config parameter by using munin config
#
# Magic markers
#%# family=auto
#%# capabilities=autoconf
use strict;
use warnings;
# change those to reflect your bind configuration
# stat file
my $stat_file = # DB directory
defined $ENV{'bind_stat_file'} ? $ENV{'bind_stat_file'} : '/var/cache/bind/named.stats';
# rndc path
my $rndc = # rndc path
defined $ENV{'bind_rndc'} ? $ENV{'bind_rndc'} : '/usr/sbin/rndc';
my $lst = { "success" => 1,
"referral" => 1,
"nxrrset" => 1,
"nxdomain" => 1,
"recursion" => 1,
"failure" => 1};
my $domain = $0;
$domain =~ s/^.*bind_([\w\d\._\-]*)$/$1/;
# Parse the statistic file
sub parseFile {
my $dom = shift @_;
open(IN,"<$stat_file") or die "Can't open $stat_file : $!";
while (<IN>) {
chomp;
my ($type,$count,$zone) = split(/ /,$_);
$zone = defined($zone) ? $zone : "";
if ($zone eq $dom) {
if (defined $lst->{$type}) {
# only keep the latest occurrence for each value
$lst->{$type} = $count;
}
}
}
close(IN);
printf "%s.value %u\n", $_, $lst->{$_} foreach (keys %$lst);
}
# Config mode
if ( defined($ARGV[0]) && $ARGV[0] eq "config" ) {
printf "graph_title Dns requests %s\n",($domain eq "" ? " all domains":$domain);
printf "graph_vlabel requests/s\n";
printf "graph_category dns\n";
printf "graph_info This graph display dns requests for %s\n",($domain eq "" ? " all domains":$domain);
printf "success.label Success\n";
printf "success.type COUNTER\n";
printf "referral.label Referral\n";
printf "referral.type COUNTER\n";
printf "nxrrset.label Nx RR set\n";
printf "nxrrset.type COUNTER\n";
printf "nxdomain.label NX domain\n";
printf "nxdomain.type COUNTER\n";
printf "recursion.label Recursion\n";
printf "recursion.type COUNTER\n";
printf "failure.label Failure\n";
printf "failure.type COUNTER\n";
exit 0;
}
if ( defined($ARGV[0]) && $ARGV[0] eq "autoconf" ) {
if (! -f $stat_file) {
printf "Unable to file bind stat file on %s",$stat_file;
exit 1;
}
if (! -f $rndc) {
printf "Unable to file rndc tool (configured : %s)",$rndc;
exit 1;
}
exit 0;
}
# Remove old stat file
unlink ($stat_file);
# Ask to bind to build new one
`$rndc stats`;
# Parse the stat file and return result
parseFile($domain);

View file

@ -1,41 +0,0 @@
#!/bin/bash
#
# Script to monitor PowerDNS performance
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns dump"
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Power DNS errors'
echo 'graph_args -l 0 --base 1000'
echo 'graph_vlabel numbers of'
echo 'graph_category dns'
echo 'graph_info This graph shows Power DNS performance on the machine.'
echo 'corrupt_packets.label corrupt packets'
echo 'corrupt_packets.type DERIVE'
echo 'corrupt_packets.min 0'
echo 'corrupt_packets.info Number of corrupt packets received'
echo 'servfail_packets.label servfail packets'
echo 'servfail_packets.type DERIVE'
echo 'servfail_packets.min 0'
echo 'servfail_packets.info Number of times a server-failed packet was sent out'
echo 'timedout_packets.label timedout packets'
echo 'timedout_packets.type DERIVE'
echo 'timedout_packets.min 0'
echo 'timedout_packets.info Number of packets which weren not answered within timeout set'
exit 0
fi
$command | sed 's/=\([0-9]\+\),/.value \1\n/g' | grep corrupt'\|'servfail'\|'timedout | sed 's/-/_/g'

View file

@ -1,34 +0,0 @@
#!/bin/bash
#
# Script to monitor PowerDNS performance
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns show"
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Power DNS latency'
echo 'graph_args -l 0'
echo 'graph_vlabel usec'
echo 'graph_category dns'
echo 'graph_info This graph shows Power DNS latency on the machine.'
echo 'latency.label latency'
echo 'latency.info Average number of microseconds needed to answer a question'
echo 'latency.type GAUGE'
exit 0
fi
echo "latency.value $($command latency | awk -F= '{print $2}')"

View file

@ -1,35 +0,0 @@
#!/bin/bash
#
# Script to monitor PowerDNS performance
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns show"
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Power DNS database queue'
echo 'graph_args -l 0'
echo 'graph_vlabel number of waiting queries'
echo 'graph_category dns'
echo 'graph_info This graph shows Power DNS database performance on the machine.'
echo 'qsize.label qsize'
echo 'qsize.info Number of questions waiting for database attention'
echo 'qsize.type GAUGE'
exit 0
fi
echo "qsize.value $($command qsize_q | awk -F= '{print $2}')"

View file

@ -1,53 +0,0 @@
#!/bin/bash
#
# Script to monitor PowerDNS performance
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns dump"
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Power DNS queries'
echo 'graph_args -l 0 --base 1000'
echo 'graph_vlabel numbers of'
echo 'graph_category dns'
echo 'graph_info This graph shows Power DNS performance on the machine.'
echo 'recursing_answers.label recursing answers'
echo 'recursing_answers.type DERIVE'
echo 'recursing_answers.min 0'
echo 'recursing_answers.info Number of recursive answers sent out'
echo 'recursing_questions.label recursing queries'
echo 'recursing_questions.type DERIVE'
echo 'recursing_questions.min 0'
echo 'recursing_questions.info Number of queries sent to recursor'
echo 'tcp_answers.label tcp answers'
echo 'tcp_answers.type DERIVE'
echo 'tcp_answers.min 0'
echo 'tcp_answers.info Number of answers sent out over TCP'
echo 'tcp_queries.label tcp queries'
echo 'tcp_queries.type DERIVE'
echo 'tcp_queries.min 0'
echo 'tcp_queries.info Number of TCP queries received'
echo 'udp_answers.label udp answers'
echo 'udp_answers.type DERIVE'
echo 'udp_answers.min 0'
echo 'udp_answers.info Number of answers sent out over UDP'
echo 'udp_queries.label udp queries'
echo 'udp_queries.type DERIVE'
echo 'udp_queries.min 0'
echo 'udp_queries.info Number of UDP queries received'
exit 0
fi
$command | sed 's/=\([0-9]\+\),/.value \1\n/g' | grep udp-'\|'recursing'\|'tcp | sed 's/-/_/g'

View file

@ -1,75 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Recursor Answer Times'
echo 'graph_order a b c d e f'
echo 'graph_vlabel queries'
echo 'graph_info Time required per answer.'
echo 'graph_category dns'
echo 'a.label in 1ms'
echo 'a.min 0'
echo 'a.max 100000'
echo 'a.type COUNTER'
echo 'a.info Answers within 1ms.'
echo 'b.label in 10ms'
echo 'b.min 0'
echo 'b.max 100000'
echo 'b.type COUNTER'
echo 'b.info Answers from 1ms to 10ms.'
echo 'c.label in 100ms'
echo 'c.min 0'
echo 'c.max 100000'
echo 'c.type COUNTER'
echo 'c.info Answers within 10ms to 100ms.'
echo 'd.label in 1s'
echo 'd.min 0'
echo 'd.max 100000'
echo 'd.type COUNTER'
echo 'd.info Answers within 100ms to 1s.'
echo 'e.label over 1s'
echo 'e.min 0'
echo 'e.max 100000'
echo 'e.type COUNTER'
echo 'e.info Answers requiring more than 1s.'
echo 'f.label timeouts'
echo 'f.min 0'
echo 'f.max 100000'
echo 'f.type COUNTER'
echo 'f.info Answers that never came.'
exit 0
fi
echo a.value `rec_control get answers0-1`
echo b.value `rec_control get answers1-10`
echo c.value `rec_control get answers10-100`
echo d.value `rec_control get answers100-1000`
echo e.value `rec_control get answers-slow`
echo f.value `rec_control get outgoing-timeouts`
exit 0

View file

@ -1,60 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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
RESENDS=`rec_control get cache-resends`
ISRESENDS=""
[ "$RESENDS" != "UNKNOWN" ] && ISRESENDS="resends"
if [ "$1" = "config" ]; then
echo 'graph_title PDNS Cache'
echo "graph_order hits misses $ISRESENDS"
echo 'graph_vlabel entries'
echo 'graph_info Hit/miss rate'
echo 'graph_category dns'
echo 'hits.label hits'
echo 'hits.min 0'
echo 'hits.max 100000'
echo 'hits.type COUNTER'
echo 'hits.info Cache hits'
echo 'misses.label misses'
echo 'misses.min 0'
echo 'misses.max 100000'
echo 'misses.type COUNTER'
echo 'misses.info Cache misses'
if [ "$RESENDS" != "UNKNOWN" ]; then
echo 'resends.label resends'
echo 'resends.min 0'
echo 'resends.max 100000'
echo 'resends.type COUNTER'
echo 'resends.info Cache resends'
fi
exit 0
fi
echo hits.value `rec_control get cache-hits`
echo misses.value `rec_control get cache-misses`
[ "$RESENDS" != "UNKNOWN" ] && echo resends.value `rec_control get cache-resends`
exit 0

View file

@ -1,45 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 dns'
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

View file

@ -1,39 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Recursor Concurrent Queries'
echo 'graph_order concurrent'
echo 'graph_vlabel queries'
echo 'graph_info Concurrent queries'
echo 'graph_category dns'
echo 'concurrent.label queries'
echo 'concurrent.min 0'
echo 'concurrent.type GAUGE'
echo 'concurrent.info Concurrent queries'
exit 0
fi
echo concurrent.value `rec_control get concurrent-queries`
exit 0

View file

@ -1,68 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Recursor Exceptions'
echo 'graph_order spoofs resource client server overflow'
echo 'graph_vlabel queries'
echo 'graph_info Exceptional queries'
echo 'graph_category dns'
echo 'spoofs.label spoofs'
echo 'spoofs.min 0'
echo 'spoofs.max 100000'
echo 'spoofs.type COUNTER'
echo 'spoofs.info Spoofs prevented'
echo 'resource.label resources'
echo 'resource.min 0'
echo 'resource.max 100000'
echo 'resource.type COUNTER'
echo 'resource.info Denied because of resource limits'
echo 'client.label client'
echo 'client.min 0'
echo 'client.max 100000'
echo 'client.type COUNTER'
echo 'client.info Client parse errors'
echo 'server.label server'
echo 'server.min 0'
echo 'server.max 100000'
echo 'server.type COUNTER'
echo 'server.info Server parse errors'
echo 'overflow.label tcp concurrency'
echo 'overflow.min 0'
echo 'overflow.max 100000'
echo 'overflow.type COUNTER'
echo 'overflow.info TCP client concurrency limit'
exit 0
fi
echo spoofs.value `rec_control get spoof-prevents`
echo resource.value `rec_control get resource-limits`
echo client.value `rec_control get client-parse-errors`
echo server.value `rec_control get server-parse-errors`
echo overflow.value `rec_control get tcp-client-overflow`
exit 0

View file

@ -1,47 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Outbound Queries'
echo 'graph_order all tcp'
echo 'graph_vlabel queries'
echo 'graph_info Outbound queries'
echo 'graph_category dns'
echo 'all.label all'
echo 'all.min 0'
echo 'all.max 100000'
echo 'all.type COUNTER'
echo 'all.info All queries'
echo 'tcp.label tcp'
echo 'tcp.min 0'
echo 'tcp.max 100000'
echo 'tcp.type COUNTER'
echo 'tcp.info TCP queries'
exit 0
fi
echo all.value `rec_control get all-outqueries`
echo tcp.value `rec_control get tcp-outqueries`
exit 0

View file

@ -1,250 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Fusl <root@sigqu.it> 2014-01-23
# 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 Recursor Query Types'
echo 'graph_order a ns cname soa mr ptr hinfo mx txt rp afsdb sig key aaaa loc srv naptr kx cert a6 ds sshfp ipseckey rrsig nsec dnskey dhcid nsec3 nsec3param tlsa spf eui48 eui64 tsig mailb maila any dlv'
echo 'graph_vlabel querytypes'
echo 'graph_info Querytype breakdown'
echo 'graph_category dns'
echo 'a.label A queries'
echo 'a.min 0'
echo 'a.type DERIVE'
echo 'a.info Queries with A type'
echo 'ns.label NS queries'
echo 'ns.min 0'
echo 'ns.type DERIVE'
echo 'ns.info Queries with NS type'
echo 'cname.label CNAME queries'
echo 'cname.min 0'
echo 'cname.type DERIVE'
echo 'cname.info Queries with CNAME type'
echo 'soa.label SOA queries'
echo 'soa.min 0'
echo 'soa.type DERIVE'
echo 'soa.info Queries with SOA type'
echo 'mr.label MR queries'
echo 'mr.min 0'
echo 'mr.type DERIVE'
echo 'mr.info Queries with MR type'
echo 'ptr.label PTR queries'
echo 'ptr.min 0'
echo 'ptr.type DERIVE'
echo 'ptr.info Queries with PTR type'
echo 'hinfo.label HINFO queries'
echo 'hinfo.min 0'
echo 'hinfo.type DERIVE'
echo 'hinfo.info Queries with HINFO type'
echo 'mx.label MX queries'
echo 'mx.min 0'
echo 'mx.type DERIVE'
echo 'mx.info Queries with MX type'
echo 'txt.label TXT queries'
echo 'txt.min 0'
echo 'txt.type DERIVE'
echo 'txt.info Queries with TXT type'
echo 'rp.label RP queries'
echo 'rp.min 0'
echo 'rp.type DERIVE'
echo 'rp.info Queries with RP type'
echo 'afsdb.label AFSDB queries'
echo 'afsdb.min 0'
echo 'afsdb.type DERIVE'
echo 'afsdb.info Queries with AFSDB type'
echo 'sig.label SIG queries'
echo 'sig.min 0'
echo 'sig.type DERIVE'
echo 'sig.info Queries with SIG type'
echo 'key.label KEY queries'
echo 'key.min 0'
echo 'key.type DERIVE'
echo 'key.info Queries with KEY type'
echo 'aaaa.label AAAA queries'
echo 'aaaa.min 0'
echo 'aaaa.type DERIVE'
echo 'aaaa.info Queries with AAAA type'
echo 'loc.label LOC queries'
echo 'loc.min 0'
echo 'loc.type DERIVE'
echo 'loc.info Queries with LOC type'
echo 'srv.label SRV queries'
echo 'srv.min 0'
echo 'srv.type DERIVE'
echo 'srv.info Queries with SRV type'
echo 'naptr.label NAPTR queries'
echo 'naptr.min 0'
echo 'naptr.type DERIVE'
echo 'naptr.info Queries with NAPTR type'
echo 'kx.label KX queries'
echo 'kx.min 0'
echo 'kx.type DERIVE'
echo 'kx.info Queries with KX type'
echo 'cert.label CERT queries'
echo 'cert.min 0'
echo 'cert.type DERIVE'
echo 'cert.info Queries with CERT type'
echo 'a6.label A6 queries'
echo 'a6.min 0'
echo 'a6.type DERIVE'
echo 'a6.info Queries with A6 type'
echo 'ds.label DS queries'
echo 'ds.min 0'
echo 'ds.type DERIVE'
echo 'ds.info Queries with DS type'
echo 'sshfp.label SSHFP queries'
echo 'sshfp.min 0'
echo 'sshfp.type DERIVE'
echo 'sshfp.info Queries with SSHFP type'
echo 'ipseckey.label IPSECKEY queries'
echo 'ipseckey.min 0'
echo 'ipseckey.type DERIVE'
echo 'ipseckey.info Queries with IPSECKEY type'
echo 'rrsig.label RRSIG queries'
echo 'rrsig.min 0'
echo 'rrsig.type DERIVE'
echo 'rrsig.info Queries with RRSIG type'
echo 'nsec.label NSEC queries'
echo 'nsec.min 0'
echo 'nsec.type DERIVE'
echo 'nsec.info Queries with NSEC type'
echo 'dnskey.label DNSKEY queries'
echo 'dnskey.min 0'
echo 'dnskey.type DERIVE'
echo 'dnskey.info Queries with DNSKEY type'
echo 'dhcid.label DHCID queries'
echo 'dhcid.min 0'
echo 'dhcid.type DERIVE'
echo 'dhcid.info Queries with DHCID type'
echo 'nsec3.label NSEC3 queries'
echo 'nsec3.min 0'
echo 'nsec3.type DERIVE'
echo 'nsec3.info Queries with NSEC3 type'
echo 'nsec3param.label NSEC3PARAM queries'
echo 'nsec3param.min 0'
echo 'nsec3param.type DERIVE'
echo 'nsec3param.info Queries with NSEC3PARAM type'
echo 'tlsa.label TLSA queries'
echo 'tlsa.min 0'
echo 'tlsa.type DERIVE'
echo 'tlsa.info Queries with TLSA type'
echo 'spf.label SPF queries'
echo 'spf.min 0'
echo 'spf.type DERIVE'
echo 'spf.info Queries with SPF type'
echo 'eui48.label EUI48 queries'
echo 'eui48.min 0'
echo 'eui48.type DERIVE'
echo 'eui48.info Queries with EUI48 type'
echo 'eui64.label EUI64 queries'
echo 'eui64.min 0'
echo 'eui64.type DERIVE'
echo 'eui64.info Queries with EUI64 type'
echo 'tsig.label TSIG queries'
echo 'tsig.min 0'
echo 'tsig.type DERIVE'
echo 'tsig.info Queries with TSIG type'
echo 'mailb.label MAILB queries'
echo 'mailb.min 0'
echo 'mailb.type DERIVE'
echo 'mailb.info Queries with MAILB type'
echo 'maila.label MAILA queries'
echo 'maila.min 0'
echo 'maila.type DERIVE'
echo 'maila.info Queries with MAILA type'
echo 'any.label ANY queries'
echo 'any.min 0'
echo 'any.type DERIVE'
echo 'any.info Queries with ANY type'
echo 'addr.label ADDR queries'
echo 'addr.min 0'
echo 'addr.type DERIVE'
echo 'addr.info Queries with ADDR type'
echo 'dlv.label DLV queries'
echo 'dlv.min 0'
echo 'dlv.type DERIVE'
echo 'dlv.info Queries with DLV type'
echo 'unk.label Unknown type queries'
echo 'unk.min 0'
echo 'unk.type DERIVE'
echo 'unk.info Queries with unknown type'
exit 0
fi
awkscript='
BEGIN {
unk=0
}
{
if (substr($1, 0, 4) == "TYPE") {
unk += ($2+0);
} else {
print tolower($1)".value "$2;
}
};
END {
print "unk.value "unk;
}
'
rec_control get-qtypelist | awk "$awkscript"
exit 0

View file

@ -1,39 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Recursor Answer Latency'
echo 'graph_order latency'
echo 'graph_vlabel ms'
echo 'graph_info Question latency'
echo 'graph_category dns'
echo 'latency.label ms'
echo 'latency.min 0'
echo 'latency.type GAUGE'
echo 'latency.info Answer latency'
exit 0
fi
echo latency.value `rec_control get qa-latency`
exit 0

View file

@ -1,47 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Recursor Questions'
echo 'graph_order all tcp'
echo 'graph_vlabel queries'
echo 'graph_info Number of questions asked'
echo 'graph_category dns'
echo 'all.label all'
echo 'all.min 0'
echo 'all.max 100000'
echo 'all.type COUNTER'
echo 'all.info All queries'
echo 'tcp.label tcp'
echo 'tcp.min 0'
echo 'tcp.max 100000'
echo 'tcp.type COUNTER'
echo 'tcp.info TCP queries'
exit 0
fi
echo all.value `rec_control get questions`
echo tcp.value `rec_control get tcp-questions`
exit 0

View file

@ -1,39 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Recursor Throttling'
echo 'graph_order throttled'
echo 'graph_vlabel queries'
echo 'graph_info Throttled queries'
echo 'graph_category dns'
echo 'throttled.label throttled'
echo 'throttled.min 0'
echo 'throttled.type COUNTER'
echo 'throttled.info Throttled queries'
exit 0
fi
echo throttled.value `rec_control get throttled-out`
exit 0

View file

@ -1,54 +0,0 @@
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <jafo@tummy.com> 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 Recursor Unauthorized'
echo 'graph_order tcp udp unexpected'
echo 'graph_vlabel queries'
echo 'graph_info Unauthorized requests'
echo 'graph_category dns'
echo 'tcp.label tcp'
echo 'tcp.min 0'
echo 'tcp.max 100000'
echo 'tcp.type COUNTER'
echo 'tcp.info Unauthorized TCP queries'
echo 'udp.label udp'
echo 'udp.min 0'
echo 'udp.max 100000'
echo 'udp.type COUNTER'
echo 'udp.info Unauthorized UDP queries'
echo 'unexpected.label unexpected'
echo 'unexpected.min 0'
echo 'unexpected.max 100000'
echo 'unexpected.type COUNTER'
echo 'unexpected.info Unexpected queries (may indicate spoofing)'
exit 0
fi
echo tcp.value `rec_control get unauthorized-tcp`
echo udp.value `rec_control get unauthorized-udp`
echo unexpected.value `rec_control get unexpected-packets`
exit 0

View file

@ -1,48 +0,0 @@
#!/bin/bash
#
# Script to monitor PowerDNS performance
#
# Parameters understood:
#
# config (required)
# autoconf (optional - used by munin-config)
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns show"
state_file=/var/lib/munin/plugin-state/pdns_rel.state
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Power DNS Packet Cache Performance'
echo 'graph_args -l 0 --upper-limit 100 --base 1000'
echo 'graph_vlabel %'
echo 'graph_category dns'
echo 'graph_info This graph shows the Power DNS packet cache performance on the machine.'
echo 'packetcache_hitrate.label packet cache hitrate'
echo 'packetcache_hitrate.type GAUGE'
echo 'packetcache_hitrate.min 0'
echo 'packetcache_hitrate.max 100'
echo 'packetcache_hitrate.info Hits on the packets cache'
exit 0
fi
hits=$($command packetcache-hit | awk -F= '{print $2}')
queries=$($command udp-queries | awk -F= '{print $2}')
old_hits=$(cat $state_file | head -n1)
old_queries=$(cat $state_file | tail -n1)
if [ -f $state_file ] && [ $(ls -l --time-style=+%s $state_file | awk '{print $6}') -gt $(date --date="7 minutes ago" +%s) ] ; then
d_hits=$(($hits - $old_hits))
d_queries=$(($queries - $old_queries))
if [ $d_queries -gt 0 ] ; then
echo packetcache_hitrate.value $(( $d_hits * 100 / $d_queries ))
fi
fi
echo $hits > $state_file
echo $queries >> $state_file