BIND 9 Statistics for Cacti

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Do you have working queries for THAT host?
Please switch Settings->Logging Level to DEBUG and post ALL you've found in log/cacti.log for that Host. If you're running cactid and know the number of the host (the one in the URL when displaying the Device Edit Screen for that host), you may run cactid manually

Code: Select all

cactid --verbosity=5 <number> <number>
to get only that host
Reinhard
tomasperez
Posts: 37
Joined: Tue Apr 11, 2006 11:10 am

Post by tomasperez »

I do not see cacti polling for that specific graph. I do currently have graphs for that host through cacti, and had setup mrtg about a month ago to graph dns info, but decided to switch to rrd/cacti. It seems as if I do not have the polling setup correctly.
In new graphs, I see this message under bind:
Query [BIND 9 Statistics (SNMP)]
This data query returned 0 rows, perhaps there was a problem executing this data query. You can run this data query in debug mode to get more information.

This is the debug info when I go to graph management:
/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="dns-01 - BIND 9 |query_bindName| Statistics" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="queries per 5 minutes" \
--slope-mode \
DEF:a="/usr/local/www/apache22/data/cacti/rra/dns01_success_648.rrd":success:AVERAGE \
DEF:b="/usr/local/www/apache22/data/cacti/rra/dns01_success_648.rrd":failure:AVERAGE \
DEF:c="/usr/local/www/apache22/data/cacti/rra/dns01_success_648.rrd":nxdomain:AVERAGE \
CDEF:cdefa=a,300,* \
CDEF:cdefe=b,300,* \
CDEF:cdefi=c,300,* \
LINE1:cdefa#00CF00:"Successful Queries" \
GPRINT:cdefa:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:cdefe#FF0000:"Failed Queries" \
GPRINT:cdefe:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:cdefi#FF6044:"NXDOMAIN Queries" \
GPRINT:cdefi:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:


ERROR: opening '/usr/local/www/apache22/data/cacti/rra/dns01_success_648.rrd': No such file or directory
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please post a screenshot for that device (make snmp community string unreadable) and of the imported Data Template
Reinhard
tribune
Posts: 8
Joined: Tue May 02, 2006 1:45 am

Post by tribune »

few problems with this, hopefully someone might be able to shed some light as im tad lost ...

when i do the test from the cacti server to try get the snmp results,
snmpwalk -v 1 -c COMMUNITY xxx.xxx.xxx.xxx .1.3.6.1.4.1.2021.55
Timeout: No Response from xxx.xxx.xxx.xxx

I get that timeout error, which i cant explain either. However if i edit the /usr/local/bin/bind9-stats-snmpd.pl file and change the $STAT_FILE to something that doesnt exist, i get a diff response to the above of "MIB END"

When trying to import either of the xml templates, i get the following errors
Error: XML parse error.

Warning: fread(): Length parameter must be greater than 0. in /var/www/cacti/templates_import.php on line 59

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/templates_import.php:59) in /var/www/cacti/templates_import.php on line 71

Doenst matter if i tried the local or the snmp xml files both get the same errors.

22007 May 4 16:24 cacti_data_query_bind_9_statistics_snmp.xml
23080 May 4 16:16 cacti_data_query_bind_9_statistics.xml

anyone got any ideas ? im so close yet feel so far
cheethoe
Posts: 5
Joined: Thu May 18, 2006 11:02 pm

Post by cheethoe »

Like some people my Qata Query with this has had limited success. If I do stats per zone it works, but I have soo many zones it doesn't make sense for me to do it per zone, I'm only interested in global statistics.

Anyhow when I run the data query I get this output:

Code: Select all

+ Running data query [11].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/share/cacti/site/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'
+ No SNMP data returned
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/bind9-stats-snmp.xml'
I did some debugging to figure out exactly what cacti was doing when it runs the data query, and this is what it runs

Code: Select all

# /usr/bin/snmpbulkwalk -O QfntUe -c 'communitystringhere' -v 2c -t 1 -r 3 -Cr50 remote.server.com:161 .1.3.6.1.4.1.2021.55.1
Timeout: No Response from remote.server.com
This is why I (and some others) end up with: Success [0 Items, 0 Rows]

Interestingly enough, if I change the command's threshold for max repititions it works.

Code: Select all

# /usr/bin/snmpbulkwalk -O QfntUe -c 'communitystringhere' -v 2c -t 1 -r 3 -Cr47 remote.server.com:161 .1.3.6.1.4.1.2021.55.1
.1.3.6.1.4.1.2021.55.1.1 = 1
.1.3.6.1.4.1.2021.55.2.1 = "GLOBAL"
.1.3.6.1.4.1.2021.55.3.1 = 185138
.1.3.6.1.4.1.2021.55.4.1 = 5316
.1.3.6.1.4.1.2021.55.5.1 = 87972
.1.3.6.1.4.1.2021.55.6.1 = 35181
.1.3.6.1.4.1.2021.55.7.1 = 36
.1.3.6.1.4.1.2021.55.8.1 = 131525
47 was the lowest I could set it for it to return the proper results. I'm still trying to figure it out because the -Cr50 is hardcoded into cacti and I'd rather not mess with cacti's hardcoded values.
I believe the error is in the file bind9-stats/snmp/bind9-stats-snmpd.pl though I really dont know yet.
cheethoe
Posts: 5
Joined: Thu May 18, 2006 11:02 pm

Post by cheethoe »

ok I dont think it's an issue with the bind9-stats/snmp/bind9-stats-snmpd.pl but more an issue with either snmpd or the snmpbulkwalk command.
bsdgal
Posts: 1
Joined: Tue Jun 06, 2006 9:45 am

some help getting this to work

Post by bsdgal »

Debug output in cacti says:
+ Running data query [16].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/src/cacti-0.8.6h/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'
+ No SNMP data returned

But I can manually snmpwalk for 55.1.1, 55.2.1, etc.

snmpwalk -v2c -c ----- .1.3.6.1.4.1.2021.55.3.1
UCD-SNMP-MIB::ucdavis.55.3.1 = INTEGER: 867

We have over 3,000 domains, so I dont want a zone by zone output, just the collective stats. My xml file has oids .1.3.6.1.4.1.2021.55.8.1 , 7.7 etc.

snmp is fine for the host, I have other snmp graphs working fine.

I'm a bit lost as to what to do next. Any suggestions would be highly appreciated.

Thanks.
cheethoe
Posts: 5
Joined: Thu May 18, 2006 11:02 pm

Post by cheethoe »

Hi bsdgal,
I recommend just doing what I did. I Modified my cacti source to fix the issue.

edit cacti/site/lib/snmp.php line 154
or search for "-Cr50" in the code
and change the -Cr50 to -Cr47.

This specified the number of index interations it will go through. (might cause issues if you have indexed SNMP queries with greater than 47 interations but not 100% sure. And example of such would be a 48port cisco switch)

That fixed the problem for me. If 47 doesnt work try lowering the value until it does.
DruKe
Posts: 18
Joined: Wed Jun 07, 2006 4:24 pm
Location: Wisconsin

Post by DruKe »

I'm going bananas here!

I've been trying to get this working nearly all day! I'm seeing two problems at this time.

1> I am noticing that the named.stats file is being deleted after a polling. The file is not being replaced at all. I can manually touch a file and set the ownership but it will get deleted again.

2> No SNMP Information is being sent.
Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/srv/www/vhosts/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'
+ No SNMP data returned
+ Found data query XML file at '/srv/www/vhosts/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/srv/www/vhosts/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/srv/www/vhosts/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
Someone help me please, I'm dying over here!
Also, I have tried modifying the snmp.php with the "-Cr50" to 47 trick, but to no avail.
cheethoe
Posts: 5
Joined: Thu May 18, 2006 11:02 pm

Post by cheethoe »

DruKe wrote: 1> I am noticing that the named.stats file is being deleted after a polling. The file is not being replaced at all. I can manually touch a file and set the ownership but it will get deleted again.
the script does delete the stat file, but it regenerates it using rndc stats. Perhaps you either specified the wrong location of the rndc binary or something else is wrong. running `rndc stats` manually in the shell should generate the file, please confirm.
DruKe wrote: 2> No SNMP Information is being sent.
Do you have info in your named.stats file? If not, then no info will be sent. Also the "47" number may require a different value depending on your system.
DruKe
Posts: 18
Joined: Wed Jun 07, 2006 4:24 pm
Location: Wisconsin

Post by DruKe »

the script does delete the stat file, but it regenerates it using rndc stats. Perhaps you either specified the wrong location of the rndc binary or something else is wrong. running `rndc stats` manually in the shell should generate the file, please confirm.
The 'rndc stats' command will return an error if I do not touch the file first. I get a 'permission denied' error.
Do you have info in your named.stats file? If not, then no info will be sent. Also the "47" number may require a different value depending on your system.
I've tried it when manually touching the file, running 'rndc stats' and then trying it. Still get the same error.
DruKe
Posts: 18
Joined: Wed Jun 07, 2006 4:24 pm
Location: Wisconsin

Post by DruKe »

And for what it's worth, when I try to walk I get this:
snmpwalk -v 2c -c comname x.x.x.x .1.3.6.1.4.1.2021.55
UCD-SNMP-MIB::ucdavis.55 = No Such Object available on this agent at this OID
aleto
Posts: 39
Joined: Wed May 25, 2005 3:57 am

Post by aleto »

Hi,

First of all thank you very much on *trying* to create this script, I hope i can get it too work.

In my setup, everything works. The XML imports good, i copy the files etc. No errors at all.

BUT:
Both scripts (as the 2) dont write away an .rrd file.. RRD Just says that it cant open an rrd file.

Code: Select all

RRDTool Says:

ERROR: opening '/www/cacti/rra/aleto_server16_sbp_success_919.rrd': No such file or directory

I got all the files copy, right permissons, latest cacti.. everything..

But it still doesnt work..
HELP!
Attachments
1.JPG
1.JPG (5.63 KiB) Viewed 17473 times
2.JPG
2.JPG (57.17 KiB) Viewed 17473 times
scubabri
Posts: 32
Joined: Thu Jul 13, 2006 3:11 pm

Post by scubabri »

anyone got any idea what's causing this?

[root@ns4 snmp]# snmpget -Cf -v1 -c public localhost .1.3.6.1.4.1.8767.2.1
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: BAYOUR-COM-MIB::bind9Stats
scubabri
Posts: 32
Joined: Thu Jul 13, 2006 3:11 pm

Post by scubabri »

Ok, I tried v2, but I get a different error message now


[root@ns4 root]# snmpget -Cf -v2c -c public localhost .1.3.6.1.4.1.8767.2.1
BAYOUR-COM-MIB::bind9Stats = No Such Instance currently exists at this OID

+ Running data query [12].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/cacti-0.8.6h/resource/snmp_queries/bind9-stats_domains.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.8767.2.1.4.1'
+ Located input field 'b9stDomainName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.8767.2.1.4.1.2'
+ Found item [b9stDomainName='No Such Instance currently exists at this OID'] index: 2 [from value]
+ Found data query XML file at '/var/www/cacti-0.8.6h/resource/snmp_queries/bind9-stats_domains.xml'
+ Found data query XML file at '/var/www/cacti-0.8.6h/resource/snmp_queries/bind9-stats_domains.xml'
+ Found data query XML file at '/var/www/cacti-0.8.6h/resource/snmp_queries/bind9-stats_domains.xml'

can anyone help?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest