Why does "check_dns" not work with LibreNMS?

I found the “monitoring-plugings” (Nagios) script “check_dns” does not work when used in Libre for some reasons.

If I run it on shell using the “librenms”-user, the check runs fine:

./check_dns -H www.google.com
DNS OK: 0.023 seconds response time. www.google.com returns 172.217.19.68,2a00:1450:4005:80b::2004|time=0.023269s;;;0.000000

When invoked by the service poller, the status in the web-ui is always:

CRITICAL - Plugin timed out while executing system call

or:

CRITICAL - No response from name server

I thought it could be some malformed parameters, but when I use a wrapper-script, I can see that the parameters are passed correctly:

check_dns -H www.google.com

So, right now I have no idea what could be the cause of this.
Did anyone ever figure out why this particular plugin refuses to work with Libre? All others I tested seem to work quite fine.
TIA!

I think someone tried to be helpful and switched the fields around for this specific plugin.

Basically, whatever you put in Remote Host will be used as the -s argument and Parameters will go in -H. If you need additional parameters you append them to the end.

So…

Remote Host: 8.8.8.8
Parameters: dnschecker.org -w1 -c5

…is…

check_dns -H dnschecker.org -s 8.8.8.8 -w1 -c5

You can confirm by running lnms poller:services [device ID] -vv on your poller.

1 Like

Hi @slashdoom,

thanks for your reply.

What do you mean? That this swap is done somewhere in Libre’s code? If so, it definitely was a disservice to put that in as it is completely nontransparent to the user.

Anyway, I’ll try what you advised and report back if that works for me, too.

Okay, I think I found the reason:

I submitted a pull-request for this: Fix non-working Nagios-plugin "check_dns" by CKeckNorthIO · Pull Request #18064 · librenms/librenms · GitHub

1 Like

Deleting the include-file fixes the problem here for me:
image