LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   BIND 9 Statistics and SNMP (https://www.linuxquestions.org/questions/linux-newbie-8/bind-9-statistics-and-snmp-4175423785/)

Cheerz 08-24-2012 09:25 AM

BIND 9 Statistics and SNMP
 
Hello Everyone

Please can someone assist me with regards to providing the statistics from BIND using SNMP?

I have followed a great article from the website http://www.packetmischief.ca/monitoring-bind9 and got everything working fine, but there is still one problem that I have.

The output from the SNMP query is in a STRING format. Is there any way in which I can get the values as INTEGER values?

snmpwalk -Os -v 1 -c saomon localhost .1.3.6.1.4.1.2021.8.1
extIndex.1 = INTEGER: 1
extNames.1 = STRING: bind9-requests-query
extCommand.1 = STRING: /usr/local/sbin/bind96-stats-get.sh
extResult.1 = INTEGER: 0
extOutput.1 = STRING: 252269
extErrFix.1 = INTEGER: noError(0)

snmpwalk -Os -v 1 -c saomon localhost .1.3.6.1.4.1.2021.8.1
extIndex.1 = INTEGER: 1
extNames.1 = STRING: bind9-requests-query
extCommand.1 = STRING: /usr/local/sbin/bind96-stats-get.sh
extResult.1 = INTEGER: 252269
extOutput.1 = STRING: 0
extErrFix.1 = INTEGER: noError(0)

The script bind96-stats-get.sh is as follows:

#!/bin/sh
db="/tmp/named.stats"

if [ -z "$1" ]; then
exit
fi

grep $1= $db | cut -d= -f2

I had a look at some of the previous LQ's, but did not find a solution.

Thank you


All times are GMT -5. The time now is 12:05 AM.