| Server IP : 81.2.241.106 / Your IP : 216.73.216.165 Web Server : Apache/2.4.67 (Debian) System : Linux tranq-f.bakta.org 5.10.0-45-amd64 #1 SMP Debian 5.10.259-1 (2026-07-02) x86_64 User : lisky ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/xfer/from_smeagol/etc/zabbix/ |
Upload File : |
#!/usr/bin/perl -w
#
# $jwk: bind96-stats-parse.pl,v 1.4 2011/08/22 16:11:13 jwk Exp $
#
# Parse the statistics file produced by BIND 9.6 and higher. Output
# the statistics in format that's easily parseable by a
# script/program/whatever.
#
# Joel Knight
# knight.joel gmail.com
# 2010.12.26
#
# http://www.packetmischief.ca/monitoring-bind9/
use strict;
# how often are you pulling statistics?
my $INTERVAL = 300;
my $prefix;
my $view;
my $item;
my $cnt;
my $now = time;
my $go = 0;
while (<>) {
chomp;
# +++ Statistics Dump +++ (1293358206)
if (m/^\+\+\+ Statistics Dump \+\+\+ \((\d+)\)/) {
my $d = $now - $1;
# stats that are older than $INTERVAL seconds are ones that we've
# already processed
if ($d >= $INTERVAL) {
next;
} else {
print scalar localtime $1, "\n";
$go++;
}
}
next unless $go;
# ++ Incoming Requests ++
# ++ Socket I/O Statistics ++
if (m/^\+\+ ([^+]+) \+\+$/) {
($prefix = lc $1) =~ s/\s/_/g;
$view = $item = $cnt = "";
}
# [View: custom_view_name]
# we ignore the view name "default" so that the word "default" is not
# inserted into the output.
if (m/^\[View: (\w+)(| .*)\]/) {
next if $1 eq "default";
$view = $1;
}
# 407104 QUERY
# 3379 EDNS(0) query failures
# 134 queries with RTT < 10ms
if (m/^\s+(\d+) ([^\n]+)/) {
($cnt = lc $1) =~ s/\s/_/g;
($item = lc $2) =~ s/\s/_/g;
if ($view) {
print "$prefix\+$view:$item=$cnt\n";
} else {
print "$prefix:$item=$cnt\n";
}
}
}