Page 1 of 1

check_dns plugin not created

Posted: Sun Aug 25, 2013 11:54 am
by RobCarleski
So, I could very well be missing something obvious here, but I don't seem to have the 'check_dns' plugin available to me in /usr/local/nagios/libexec (where $USER1$ points to). On a whim, I went to the original nagios plugins folder I snagged, and I do see check_dns.c sitting there. Just for kicks, I tried to do `make check_dns`, thinking that this might create the plugin for me. Not sure if that even made sense to do, but just in case, here's the output from that:
gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include -DNP_VERSION='"1.4.16"' -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 ‘main’:
check_dns.c:106: error: ‘NSLOOKUP_COMMAND’ undeclared (first use in this function)
check_dns.c:106: error: (Each undeclared identifier is reported only once
check_dns.c:106: error: for each function it appears in.)
make: *** [check_dns.o] Error 1
As a total newbie to Nagios, I would very much appreciate any insight on this. I've got a feeling that I'm just missing some dependency that the plugin needs (I did verify that the `nslookup` command is available), but I'm not sure what it is.

Re: check_dns plugin not created

Posted: Sun Aug 25, 2013 4:15 pm
by scottwilkerson
Looks like your system doesn't have nslookup... Can you run

Code: Select all

which nslookup
What OS is it?

I believe on CentOS and RHEL you need

Code: Select all

yum install bind-utils

Re: check_dns plugin not created

Posted: Fri Sep 06, 2013 7:15 am
by RobCarleski
Hi, Scott! Thanks for the response. I was thinking the same thing, but I appear to have it installed already.

Running `which nslookup` gives me: /usr/bin/nslookup

The OS is CentOS 6.4, and running `yum install bind-utils` just tells me the package is already installed and the latsest version.

Any other thoughts?
scottwilkerson wrote:Looks like your system doesn't have nslookup... Can you run

Code: Select all

which nslookup
What OS is it?

I believe on CentOS and RHEL you need

Code: Select all

yum install bind-utils

Re: check_dns plugin not created

Posted: Fri Sep 06, 2013 7:48 am
by RobCarleski
Update: 9/6/13

So, I just went into the check_dns.c file and manually created the NSLOOKUP_COMMAND variable, setting the value to "/usr/bin/nslookup". Upon trying to make the module again, it appears to have succeeded. I'll play around with it to be sure it's working, but I think this one is a closed case. Thanks again, Scott!

Re: check_dns plugin not created

Posted: Fri Sep 06, 2013 9:44 am
by RobCarleski
Hm... close, but no cigar. Now, whenever I run `check_dns` with arguments, I get 'segmentation fault'. If I run it without args, it says 'Unable to process arguments'. I'll keep looking into this, but any thoughts on it would be greatly appreciated

Re: check_dns plugin not created

Posted: Fri Sep 06, 2013 10:16 am
by RobCarleski
Got it!

Honestly, I don't know C, and I just declared the variable wrong in the check_dns.c file. I had it as...

Code: Select all

char NSLOOKUP_COMMAND = "/usr/bin/nslookup";
when it needed to be...

Code: Select all

char *NSLOOKUP_COMMAND = "/usr/bin/nslookup";
Thanks again, Scott! Hopefully this thread will help some poor soul in the future! Case closed!

Re: check_dns plugin not created

Posted: Fri Sep 06, 2013 11:43 am
by abrist
Closed it is :P