Page 1 of 1

check_dns error message

Posted: Thu Jun 27, 2019 9:38 pm
by s.wiki
Hi All,

As attached picture show syntax_error as i already follow instruction to make sure everything work fine but still having error
Nagios Check
Nagios Check
After checking on terminal which still show syntax error
CLI command check
CLI command check
Looking forward if anything that i can provide.

Re: check_dns error message

Posted: Fri Jun 28, 2019 1:11 pm
by tgriep
Something must of corrupted the plugin when it was compiled or installed on the server.

Try reinstalling the plugins on the server or follow this link for compiling the plugins from source to see if it fixes that plugin.
https://support.nagios.com/kb/article/n ... e-569.html

Re: check_dns error message

Posted: Sun Jun 30, 2019 10:17 am
by s.wiki
Seem still same as after per checking existing plugin tar files is excluded check_dns. Where should i need to get check_dns?
Capture1.PNG
Capture.PNG

Re: check_dns error message

Posted: Sun Jun 30, 2019 10:27 am
by s.wiki
While I notice that check_dns was not been compile by default, I follow https://support.nagios.com/forum/viewto ... =7&t=11660 to make check_dns again from source but there is some error come out. And also cannot find [char NSLOOKUP_COMMAND = "/usr/bin/nslookup";] in check_dns.c.

root@raspberrypi:~/nagios-plugins-release-2.2.1/plugins# make check_dns
2.2.1.git
gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include -DNP_VERSION='"2.2.1.git"' -g -O2 -MT check_dns.o -MD -MP -MF .deps/check_dns.Tpo -c -o check_dns.o check_dns.c
check_dns.c: In function ‘check_new_address’:
check_dns.c:88:65: error: ‘NSLOOKUP_COMMAND’ undeclared (first use in this function)
die (STATE_CRITICAL, "%s%s%s\n", _("DNS CRITICAL - '"), NSLOOKUP_COMMAND, _("' returned empty host name string"));
^~~~~~~~~~~~~~~~
check_dns.c:88:65: note: each undeclared identifier is reported only once for each function it appears in
check_dns.c: In function ‘main’:
check_dns.c:129:44: error: ‘NSLOOKUP_COMMAND’ undeclared (first use in this function)
xasprintf (&command_line, "%s %s %s %s", NSLOOKUP_COMMAND, query_type, query_address, dns_server);
^~~~~~~~~~~~~~~~
Makefile:2194: recipe for target 'check_dns.o' failed
make: *** [check_dns.o] Error 1

Looking forward your great reply.

Re: check_dns error message

Posted: Mon Jul 01, 2019 11:53 am
by tgriep
Did you install the bind-utils package on the server before re-compiling the plugin?

If not, make sure you installed it by running this as root

Code: Select all

yum install -y bind-utils

Re: check_dns error message

Posted: Tue Jul 02, 2019 9:55 pm
by s.wiki
I am using raspberry Pi as my Nagios Core and I do to apt-get install dnsutils but it is already latest packages.

I do able to do nslookup 8.8.8.8 and able to getting output as well.

Re: check_dns error message

Posted: Wed Jul 03, 2019 9:30 am
by tgriep
When compiling the source, you have to run the configure script. When the configure script runs, it searches the system for all of the commands, paths, etc it needs to compile the software.

Run through all of the commands in the Installing Nagios Plugins From Source articke and see if it finds the nslookup command and compiles the check_dns plugin.