|
|
| Author |
Message |
mhmghmg Guest
|
Posted: Mon Apr 29, 2002 5:49 pm Post subject: |
|
|
meee tooo  |
|
| Back to top |
|
 |
gwynnebaer
Joined: 13 Apr 2002 Posts: 29 Location: Santa Barbara, CA
|
|
| Back to top |
|
 |
George Guest
|
Posted: Thu Feb 13, 2003 6:20 am Post subject: Re: named.stats |
|
|
try this:
--*snip**
#!/bin/sh
#
# script for pulling stats from bind 9
# george@alink.co.za 10.02.03
#
rm /var/named/named.stats
/usr/sbin/rndc stats
for i in `cat /var/named/named.stats | grep -v Statistics | awk '{ print $2 }'` ; do total=$(($total+$i)); done;
echo $total;
--*snip*--
| ablyler wrote: | | Code: | +++ Statistics Dump +++ (1020033800)
success 13
referral 0
nxrrset 0
nxdomain 10
recursion 22
failure 0
--- Statistics Dump --- (1020033800) |
I have bind 9.2.0, and my named.stats only contains the above. Any ideas on how I can expand this?
Thanks,
Andy |
|
|
| Back to top |
|
 |
unyks
Joined: 12 Feb 2003 Posts: 5 Location: Stuttgart/Germany
|
Posted: Thu Feb 13, 2003 1:33 pm Post subject: |
|
|
Hi,
here is another well working script fpr bind9 stats...
hint: check the paths to your named.stats file an the rndc binary
| Code: |
#!/usr/bin/perl -w
# Parse output from bind9 rndc stats command
# Dobrica Pavlinusic, <dpavlin@rot13.org>
# http://www.rot13.org/~dpavlin/sysadm.html
#
# Usage: parse_bind9stat.pl [/var/log/stats.dump [/usr/sbin/rndc]]
use strict;
my $log = shift @ARGV || "/chroot/named/var/run/named.stats";
my $rndc = shift @ARGV || "/usr/local/named/sbin/rndc";
my $delta="/var/tmp/";
system "$rndc stats";
my @counters = qw(success referral nxrrset nxdomain recursion failure);
my %total;
my %forward;
my %reverse;
my $tmp=$log;
$tmp=~s/\W/_/g;
$delta.=$tmp.".offset";
open(DUMP,$log) || die "$log: $!";
if (-e $delta) {
open(D,$delta) || die "can't open delta file '$delta' for '$log': $!";
my $offset=<D>;
chomp $offset;
close(D);
my $log_size = -s $log;
if ($offset <= $log_size) {
seek(DUMP,$offset,0);
}
}
while(<DUMP>) {
next if /^(---|\+\+\+)/;
chomp;
my ($what,$nr,$direction) = split(/\s+/,$_,3);
if (! $direction) {
$total{$what} += $nr;
} elsif ($direction =~ m/in-addr.arpa/) {
$reverse{$what} += $nr;
} else {
$forward{$what} += $nr;
}
}
open(D,"> $delta") || die "can't open delta file '$delta' for log '$log': $!";
print D tell(DUMP);
close(D);
close(DUMP);
foreach (@counters) {
print $total{$_},"\n",$forward{$_},"\n",$reverse{$_},"\n";
}
|
to run this, put following with your own oid in your snmpd.conf:
| Code: |
exec .1.3.6.1.4.1.2021.60 yourscriptname /usr/local/bin/yourscriptname.pl
|
with snmpwalk you get the following results:
| Code: | snmpwalk -On -c mycommuity myhost .1.3.6.1.4.1.2021.60
.1.3.6.1.4.1.2021.60.1.1 = 1
.1.3.6.1.4.1.2021.60.2.1 = "bindstats"
.1.3.6.1.4.1.2021.60.3.1 = "/usr/local/bin/bindstat.pl"
.1.3.6.1.4.1.2021.60.100.1 = 0
.1.3.6.1.4.1.2021.60.101.1 = "419458"
.1.3.6.1.4.1.2021.60.101.2 = "240473"
.1.3.6.1.4.1.2021.60.101.3 = "186"
.1.3.6.1.4.1.2021.60.101.4 = "322524"
.1.3.6.1.4.1.2021.60.101.5 = "81"
.1.3.6.1.4.1.2021.60.101.6 = "0"
.1.3.6.1.4.1.2021.60.101.7 = "131737"
.1.3.6.1.4.1.2021.60.101.8 = "96823"
.1.3.6.1.4.1.2021.60.101.9 = "0"
.1.3.6.1.4.1.2021.60.101.10 = "59173"
.1.3.6.1.4.1.2021.60.101.11 = "16450"
.1.3.6.1.4.1.2021.60.101.12 = "94"
.1.3.6.1.4.1.2021.60.101.13 = "69552"
.1.3.6.1.4.1.2021.60.101.14 = "14"
.1.3.6.1.4.1.2021.60.101.15 = "0"
.1.3.6.1.4.1.2021.60.101.16 = "17985"
.1.3.6.1.4.1.2021.60.101.17 = "0"
.1.3.6.1.4.1.2021.60.101.18 = "0"
.1.3.6.1.4.1.2021.60.102.1 = 0
|
the oids are...
datasource success-t .1.3.6.1.4.1.2021.60.101.1
datasource referral-t .1.3.6.1.4.1.2021.60.101.2
datasource nxrrset-t .1.3.6.1.4.1.2021.60.101.3
datasource nxdomain-t .1.3.6.1.4.1.2021.60.101.4
datasource recursion-t .1.3.6.1.4.1.2021.60.101.5
datasource failure-t .1.3.6.1.4.1.2021.60.101.6
datasource success-f .1.3.6.1.4.1.2021.60.101.7
datasource referral-f .1.3.6.1.4.1.2021.60.101.8
datasource nxrrset-f .1.3.6.1.4.1.2021.60.101.9
datasource nxdomain-f .1.3.6.1.4.1.2021.60.101.10
datasource recursion-f .1.3.6.1.4.1.2021.60.101.11
datasource failure-f .1.3.6.1.4.1.2021.60.101.12
datasource success-r .1.3.6.1.4.1.2021.60.101.13
datasource referral-r .1.3.6.1.4.1.2021.60.101.14
datasource nxrrset-r .1.3.6.1.4.1.2021.60.101.15
datasource nxdomain-r .1.3.6.1.4.1.2021.60.101.16
datasource recursion-r .1.3.6.1.4.1.2021.60.101.17
datasource failure-r .1.3.6.1.4.1.2021.60.101.18
greets
Chris |
|
| Back to top |
|
 |
sachar
Joined: 21 Apr 2002 Posts: 14
|
|
| Back to top |
|
 |
bulek Cacti Pro User
Joined: 20 May 2002 Posts: 852 Location: Poland
|
Posted: Fri Feb 21, 2003 6:49 am Post subject: |
|
|
You should use COUNTER instead of GAUGE as a data source type.
- bulek |
|
| Back to top |
|
 |
asteffes Guest
|
Posted: Wed Mar 26, 2003 6:25 pm Post subject: |
|
|
| bulek wrote: | You should use COUNTER instead of GAUGE as a data source type.
- bulek |
I'm not sure how this is working for anyone. On my system, net-snmp is returning each of the OID's values as a string, not an integer. Cacti doesn't seem to know what to do with that string since it's in quotes:
asteffes@iceburg /usr/local/bin > ./snmpwalk -OS -c foobar somehostname .1.3.6.1.4.1.2021.60.101.4
UCD-SNMP-MIB::ucdavis.60.101.4 = "6"
Can anyone explain how they got this to work?
-Adam |
|
| Back to top |
|
 |
JMU1337
Joined: 24 Jul 2003 Posts: 1
|
Posted: Thu Jul 24, 2003 1:34 pm Post subject: BIND 9.2 Stat Dump Expansion |
|
|
In order to complete a DNS monitoring task, I need to get some DNS stats. Unfortunately, the machine I'm working on is running BIND 9.2 and the stat dump is very meager. Are there any options I can set to expand the amount of data that is logged?
Any help is greatly appreciated. |
|
| Back to top |
|
 |
Guest Guest
|
Posted: Mon Dec 01, 2003 10:33 am Post subject: graphs |
|
|
Can anyone explain how I get this into cacti with some easy description?
I've gotten so far that I have created a xml-file that seems to work ok.
regards
Robin |
|
| Back to top |
|
 |
cpowers
Joined: 05 Jan 2004 Posts: 2
|
Posted: Mon Jan 05, 2004 12:23 pm Post subject: Re: named.stats |
|
|
| ablyler wrote: | | Code: | +++ Statistics Dump +++ (1020033800)
success 13
referral 0
nxrrset 0
nxdomain 10
recursion 22
failure 0
--- Statistics Dump --- (1020033800) |
I have bind 9.2.0, and my named.stats only contains the above. Any ideas on how I can expand this?
Thanks,
Andy |
I have created a package for monitoring BIND 9 stats see this post http://www.raxnet.net/board/viewtopic.php?t=3018 for more info.
Cory |
|
| Back to top |
|
 |
RattleSn@ke Guest
|
Posted: Fri Aug 06, 2004 10:37 am Post subject: Re: named.stats |
|
|
| ablyler wrote: | | Code: | +++ Statistics Dump +++ (1020033800)
success 13
referral 0
nxrrset 0
nxdomain 10
recursion 22
failure 0
--- Statistics Dump --- (1020033800) |
I have bind 9.2.0, and my named.stats only contains the above. Any ideas on how I can expand this?
Thanks,
Andy |
Same here ...
Realy weird ...
Greetz.
RattleSn@ke. |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Aug 06, 2004 10:41 am Post subject: |
|
|
Add the following to your bind config
zone-statistics yes; |
|
| Back to top |
|
 |
RattleSn@ke Guest
|
Posted: Fri Aug 06, 2004 8:03 pm Post subject: Works ... but not completly ... :s |
|
|
| Anonymous wrote: | Add the following to your bind config
zone-statistics yes; |
This worked ... but when I'm using the package meant earlier, both options (local and snmp) do not work ...
When using the snmp option, i receive 'object unknown' errors.
While the first (local) option returns nothing ...
Any help is welcome.
Greetz,
RattleSn@ke. |
|
| Back to top |
|
 |
RattleSn@ke Guest
|
Posted: Sat Aug 07, 2004 4:41 am Post subject: |
|
|
Damn ... I still can't figure out why it won't work ...
I placed this in snmpd.conf
| Code: | | pass .1.3.6.1.4.1.2021.55 /usr/bin/perl /custom/bin/bind9-stats-snmpd.pl |
And when I then restart snmpd and run this command:
| Code: | | snmpwalk -v 2c -c COMM HOST .1.3.6.1.4.1.2021.55 |
I get this as result ...:
| Code: | | UCD-SNMP-MIB::ucdavis.55 = No Such Instance currently exists at this OID |
Somebody any idea whats going wrong?
Thanks.
Greetz. |
|
| Back to top |
|
 |
RattleSn@ke Guest
|
Posted: Sat Aug 07, 2004 5:11 am Post subject: |
|
|
Here's the output of the debug command in Cacti...
| Code: | + Running data query [11].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/www/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.2021.55.1'
+ Located input field 'bindIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.55.1'
+ Found item [bindIndex='No Such Instance currently exists at this OID'] index: 1 [from value]
+ Located input field 'bindName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.2021.55.2'
+ Found item [bindName='No Such Instance currently exists at this OID'] index: 2 [from value] |
|
|
| Back to top |
|
 |
|