check_dns error message

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
s.wiki
Posts: 82
Joined: Sat Mar 04, 2017 11:02 am

check_dns error message

Post 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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_dns error message

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
s.wiki
Posts: 82
Joined: Sat Mar 04, 2017 11:02 am

Re: check_dns error message

Post 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
s.wiki
Posts: 82
Joined: Sat Mar 04, 2017 11:02 am

Re: check_dns error message

Post 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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_dns error message

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
s.wiki
Posts: 82
Joined: Sat Mar 04, 2017 11:02 am

Re: check_dns error message

Post 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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_dns error message

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked