check_dns plugin not created

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
RobCarleski
Posts: 5
Joined: Sun Aug 25, 2013 11:44 am

check_dns plugin not created

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_dns plugin not created

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
RobCarleski
Posts: 5
Joined: Sun Aug 25, 2013 11:44 am

Re: check_dns plugin not created

Post 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
RobCarleski
Posts: 5
Joined: Sun Aug 25, 2013 11:44 am

Re: check_dns plugin not created

Post 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!
RobCarleski
Posts: 5
Joined: Sun Aug 25, 2013 11:44 am

Re: check_dns plugin not created

Post 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
RobCarleski
Posts: 5
Joined: Sun Aug 25, 2013 11:44 am

Re: check_dns plugin not created

Post 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!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_dns plugin not created

Post by abrist »

Closed it is :P
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked