I have noticed that the check_bind script, or more accurately, what gets designated as a successful or NXDOMAIN request, seems to flatten out and zero out over time if there are no changes, or the difference in the changes are always the same. For instance, I am using the plugin in a dev environment. I run a script that makes queries to the DNS server at certain intervals. Our Nagios server calls the script every 5 minutes, it runs, it dumps stats as expected. If I grep the named stats file for the values that the script looks for, I can see the info that gets reported back, such as :
Code: Select all
less named.stats.tmp | grep 'resulted in successful'
1 queries resulted in successful answer
785 queries resulted in successful answer
1 queries resulted in successful answer
772 queries resulted in successful answer
and:
Code: Select all
less named.stats.tmp | grep 'resulted in NXDOMAIN'
1 queries resulted in NXDOMAIN
331 queries resulted in NXDOMAIN
1 queries resulted in NXDOMAIN
319 queries resulted in NXDOMAIN
Looking at the script the difference in the 2 values is what's looked for. So we have a difference of 13 for successful answer and 12 for NXDOMAIN. The differences have remained 13 and 12 for at least the last hour in each dump, so I suspect this is why I have noticed that everything is zeroed out now. And here is the script logic:
Code: Select all
if [ "$succ_1st" == '' ]
then
success=0
else
success=`expr $succ_1st - $succ_2nd`
So my question is what does [ "$succ_1st" == '' ] mean because it seems to be why the script is returning the 0 values now. I was under the impression that even if the differences in the output is always the same, it should report the values. Is this not the case?