Bug 561 - unbound statistics reporting incorrect SERVFAIL numbers
unbound statistics reporting incorrect SERVFAIL numbers
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.4.17
i386 Linux
: P5 minor
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-07 16:56 CET by Chris Coates
Modified: 2014-03-10 11:43 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Coates 2014-03-07 16:56:43 CET
Hi all,

We've noted that the unbound statistics that are outputted by unbound seem to be missing the SERVFAIL statistic, as shown:

answers_to_queries: num_a_NOER:1611672 num_a_NXDOMAIN:155577 num_a_SERVFAULT:0 num_a_nodata:82363 num_a_secure:124083 num_a_bogus:198 num_r_bogus:0

Instead it seems in it's place there is a num_a_SERVFAULT which always reports 0.

In contrast, unbound-control reports correct SERVFAIL statistics information:

num.answer.rcode.SERVFAIL=11273

Has this been fixed in later revisions already? I had a quick look on the bug listing but my search-fu is weak.

Chris
Comment 1 Wouter Wijngaards 2014-03-10 10:23:00 CET
Hi Chris,

What is printing this?  Unbound does not print anything like num_a_SERVFAULT to the logs (SERVFAIL it would use).  It seems that something has modified this output for you.

I checked the unbound_munin_ script but it seems fine (it sed's the unbound-control output so that should work fine for servfail if nxdomain is working).

Best regards, Wouter
Comment 2 Chris Coates 2014-03-10 11:26:19 CET
Hi Wouter, 

I've found the offending items on our install.

On the SVN in /tags/release-1.4.17/contrib there is a tar, unbound_cacti.tar.gz which has a script in it, unbound_cacti.

I've included diffs below for a fixed setup:

$diff unbound_cacti unbound_cacti.orig 
126c126
< num_answer_rcode_SERVFAIL=0
---
> num_answer_rcode_SERVFAULT=0
305,306c305,306
< 	num.answer.rcode.SERVFAIL)
< 	num_answer_rcode_SERVFAIL=$howmuch
---
> 	num.answer.rcode.SERVFAULT)
> 	num_answer_rcode_SERVFAULT=$howmuch
550c550
< " num_a_SERVFAIL:"$num_answer_rcode_SERVFAIL\
---
> " num_a_SERVFAULT:"$num_answer_rcode_SERVFAULT\

And then in the templates for Cacti:

Answers by type ccoates$ diff cacti_data_template_unbound_dns_-_answers_by_type.xml cacti_data_template_unbound_dns_-_answers_by_type.xml.orig 
60c60
< 				<data_source_name>num_a_SERVFAIL</data_source_name>
---
> 				<data_source_name>num_a_SERVFAULT</data_source_name>
139c139
< 				<name>num_a_SERVFAIL</name>
---
> 				<name>num_a_SERVFAULT</name>
145c145
< 				<data_name>num_a_SERVFAIL</data_name>
---
> 				<data_name>num_a_SERVFAULT</data_name>
270c270
< </cacti>
---
> </cacti>
\ No newline at end of file

Answers by type ccoates$ diff cacti_graph_template_unbound_dns_-_answers_by_type.xml cacti_graph_template_unbound_dns_-_answers_by_type.xml.orig  
520c520
< 				<name>Data Source [num_a_SERVFAIL]</name>
---
> 				<name>Data Source [num_a_SERVFAULT]</name>
615c615
< 				<data_source_name>num_a_SERVFAIL</data_source_name>
---
> 				<data_source_name>num_a_SERVFAULT</data_source_name>
694c694
< 				<name>num_a_SERVFAIL</name>
---
> 				<name>num_a_SERVFAULT</name>
700c700
< 				<data_name>num_a_SERVFAIL</data_name>
---
> 				<data_name>num_a_SERVFAULT</data_name>
829c829
< </cacti>
---
> </cacti>
\ No newline at end of file

Host template (all in one) ccoates$ diff cacti_host_template_unbound_dns.xml cacti_host_template_unbound_dns.xml.orig 
525c525
< 				<name>Data Source [num_a_SERVFAIL]</name>
---
> 				<name>Data Source [num_a_SERVFAULT]</name>
4589c4589
< 				<data_source_name>num_a_SERVFAIL</data_source_name>
---
> 				<data_source_name>num_a_SERVFAULT</data_source_name>
5580c5580
< 				<name>num_a_SERVFAIL</name>
---
> 				<name>num_a_SERVFAULT</name>
5586c5586
< 				<data_name>num_a_SERVFAIL</data_name>
---
> 				<data_name>num_a_SERVFAULT</data_name>
6378c6378
< </cacti>
---
> </cacti>
\ No newline at end of file

This now reports valid SERVFAIL data back to cacti for monitoring purposes.

The next question is - is SERVFAULT valid at all and needs to be retro-fitted, or was this a typo?

Note that i've downloaded the SVN for 1.4.22rc1 - the bug/typo is still in there so this applies to all revisions.

Thanks,

Chris
Comment 3 Wouter Wijngaards 2014-03-10 11:43:18 CET
Hi Chris,

Thank you for your patches, I have applied them to the contrib cacti tarball.

Best regards,
   Wouter