Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Just installed this cacti thing found it while surfing around at freshmeat.net
installation went fine but i'm tying to use a dns addon from here that's querry statistics over nsmp and cacti always tells me
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.
if i click the link "debug mode" i get this
+ Running data query [13].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/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 '/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
+ Found data query XML file at '/cacti/resource/snmp_queries/bind9-stats-snmp.xml'
sensitive serverpaths have been removed above ..
how do i get that working correctly ...
possible cause found
i see my bind 9 has a "statistics-file" statement but the file is never never writen to the given path so i'm thinking about a permissions problem here but i'm not totally sure and scared i mess thing up schouldn't the "named" user have write permissions to write the stats dump file :?
Linuxfreak_be wrote:i see my bind 9 has a "statistics-file" statement but the file is never never writen to the given path so i'm thinking about a permissions problem here but i'm not totally sure and scared i mess thing up schouldn't the "named" user have write permissions to write the stats dump file :?
Linuxfreak_be,
you've found it! Try to "touch <named_stats file>" under your named userid. Pay attention to directory permissions. If at least the file is created, try that command you have to put into your named servers cron. Have a look at <named_stats file>. If that works, try cacti again (assuming the snmp stuff is done).
[my opinion]As we are using several net-snmp triggered queries like this for named or some others for mail scanning and delivery, we introduced some numeric space under ucdavis .1.3.6.1.4.1.2021, in our case .1.3.6.1.4.1.2021.999. All our own stuff goes there, e.g. .1.3.6.1.4.1.2021.999.1 contains all named stuff, .1.3.6.1.4.1.2021.999.2 some mail stuff, .1.3.6.1.4.1.2021.999.3 the next one and so on.[/my opinion]
Reinhard
that snmp query return no errors any longer and the graph is created but it looks like it stays blank which is impossible as my server is the master dns server
What about using that cron line. Must be something like "rndc stats" or "ndc stats" or so? Did you check that very thingy? Then, please have a look at your /var/named/data/named_stats.txt. It should not be empty any more. And you do not have to wait...
What about using that cron line. Must be something like "rndc stats" or "ndc stats" or so? Did you check that very thingy? Then, please have a look at your /var/named/data/named_stats.txt. It should not be empty any more. And you do not have to wait...
#!/bin/bash
#
# Script to generate bind9 stats file to be run from cron
#
# Created By: Cory Powers <cory@uversaconsulting.net>
#
#############
# CONFIGURATION - Begin
#
# named.stats file location, this should match the
# file name and path for the statistics-file directive
# in your named.conf file
STAT_FILE=/var/named/data/named.stats
# Location of rndc executable
RNDC=/usr/sbin/rndc
# CONFIGURATION - End
#############
rm $STAT_FILE #why delete stat file ?
$RNDC stats
RNDC_RET=$?
if [ $RNDC_RET -ne 0 ]; then
echo "Error running $RNDC:$RNDC_RET"
exit $RNDC_RET
else
exit 0
fi
why on earth is that script deleting my stats file ?
...
# Script to generate bind9 stats file to be run from cron
This one has to be put into cron of the remote named machine as is stated by the comments. It deletes the stats file on each cron run and re-generates it by using rndc. So this file only contains the output of the last rndc run.
And here's the trick: The cron job must run on the remote machine and has to complete before cacti queries the output using snmp. The chance, that cacti drops right in between deleting and re-generating is little, but depends on the runtime of the rndc. If clocks are not synchronized, there may be a chance, that cacti reads the output from the "old" rndc.