dotse/dnscheck — Issue #47: examples/dnscheck_nagios_plugin.pl + enable_embedded_perl=1
Author: fobser
Created: 2011-10-18 00:11:42+00:00
State: open

There is probably WONTFIX/INVALID and the bug should be filed against nagios or perl (or debian or the linux kernel or kvm :D ) I'm only posting this because it's relatively bizarre.

Anyway, here it goes, we are checking ~30k domains with nagios (nagios3 3.2.1-2, debian squeeze). ~600 of those are in state unknown. Some are delegated, some are not, some have AAAA records, some not. The domains seem to be totally random but fairly stable. (They sometimes switch state from unknown to critical or warning).
Nagios allways shows this:
**ePN /usr/local/sbin/dnscheck_nagios_plugin.pl: "Argument "de" isn't numeric in addition (+) at /usr/share/perl5/Net/IP.pm line 1089,".
Where "de" is probably the tld of the zone but I didn't check this systematically (we also get e.g. "com" and "arpa")

Running this check in the shell doesn't show this error. This looks like something like a memory corruption in nagios / embeded perl.

It turns out that this is not related to high load or memory pressure on the host, I can reproduce this with with a single check configured in nagios: dnscheck_nagios_plugin.pl --debug 0-club.de (the domain is currently not delegated / registered).

We tried to debug this for sometime - it's a real pain in the ass. Every time you change something either the perl process crashes (e.g. Devel::StackTrace isn't working) or the error disappears (putting debug code somewhere in the call path) or your debug code isn't called (note that line 1089 is a comment, there is no "+" operation there)

I think the bug get's triggered between these 2 lines:

0.020: 0-club.de INFO [DELEGATION:BEGIN] 0-club.de
0.805: 0-club.de INFO [DELEGATION:NS_AT_PARENT] a.nic.de,f.nic.de,l.de.net,s.de.net,z.nic.de

Disabling embedded perl in nagios.cfg (enable_embedded_perl=0) - which was as far as I'm concerned only enabled by mistake - fixes the problem for us.

It's unsportsmanlike but I'm content to ignore this :)