dns_check service implentation issues

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
lordberre
Posts: 1
Joined: Thu Feb 19, 2015 11:47 am

dns_check service implentation issues

Post by lordberre »

Hi Nagios community,

I have some issues with setting up dns_check on my Nagios system. What I want is my system to monitor the response time of different DNS-servers.

Like this:
Monitor responstime google.com using DNS1
Monitor responstime google.com using DNS2
Monitor responstime google.com using DNS3
Everything from the same host.

I've read several guides on how to achieve this, but I'm stuck.

The current status is that I've added a service in the localhost cfg:

Code: Select all

lordberre@ubuntu:/etc/nagios3/conf.d$ cat localhost_nagios2.cfg
# DNS-Check
define service{
        use                             generic-service         ; Name of service template to use
        host_name                       localhost
        service_description             DNS 2
        check_command                   check_dns!google.com
And verified that the plugin itself is working:

Code: Select all

lordberre@ubuntu:/usr/lib/nagios/plugins$ ./check_dns -H google.com -s 8.8.8.8
DNS OK: 0.049 seconds response time. google.com returns 216.58.209.110|time=0.048552s;;;0.000000
But I'm getting

Code: Select all

"4/4 	CRITICAL - Plugin timed out while executing system call"
error in the Nagios Web-GUI.

Initially, I just wanted to set up the DNS-checking for the currently used DNS server, then proceed with adding the other one, but I haven't really gotten anywhere (I'm a complete noob at this).

System: Ubuntu 14.04 running on a VMWare (v11) machine.

Any help appreciated!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: dns_check service implentation issues

Post by jdalrymple »

Is your localhost (Nagios server) the DNS server you're trying to query. The line

Code: Select all

        host_name                       localhost
makes it seem that way. I think what you want is to create 3 hosts, DNS1, DNS2, DNS3. Something like:

Code: Select all

define host {
        host_name                       DNS1
        use                             generic-host
        alias                           DNS1
        address                         IPADDRESS_OF_DNS1
        register                        1
        }
Then your services would look more like this:

Code: Select all

define service{
        use                             generic-service
        host_name                       DNS1
        service_description             DNS 1
        check_command                   check_dns!-s google.com
        }
Make sense?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: dns_check service implentation issues

Post by Box293 »

Can you please post the command definition for check_dns
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked