Trouble With check_time command

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.
rockxd
Posts: 26
Joined: Fri Feb 27, 2015 10:01 am

Trouble With check_time command

Post by rockxd »

I am currently having trouble getting the check_time command to work correctly.
Here is what is in my configuration files…

Commands:

#'check_time' command definition
define command{
command_name check_time
command_line $USER1$/check_time -H $HOSTADDRESS$
}

Configuration for Server(s):

define service{
use local-service
hostgroup_name gsgdevops-build_agents
service_description TIME
check_command check_time
}

After all this is said and done, I am left with the following message in the web interface (see attachment).

I have scoured the internet to find out why I am getting these results, but to no avail. Some sources say that I am being denied port access due to a daemon called inetd, in which the solution would be simply changing some of the settings. However, I did not find this daemon running on any of the servers.

Does anyone have any idea of what I might be doing wrong and/or how to get the check_time command working?
Attachments
UNKNOWN ERROR.png
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Post by jdalrymple »

check_time is used to check the TIME protocol, not NTP. Are you sure that is the protocol you wish to check, or are you trying to monitor NTP servers?

If you're trying to monitor NTP servers there is a check_ntp plugin designed just for that.
rockxd
Posts: 26
Joined: Fri Feb 27, 2015 10:01 am

Re: Trouble With check_time command

Post by rockxd »

I am not trying to monitor NTP servers.
To my understanding, the check_time command compares the nagios host and the servers it is monitoring and check if there if the machines differ in time.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Post by jdalrymple »

It will, but using the time service is a bit obsolete. You can use this check to achieve that goal, however it will only tell you the time difference between the Nagios server and the remote host. It won't tell you which one is right :)

I would personally prefer the check_ntp_time run on a remote host.

If you do however want to just know the difference between the 2 hosts this check will achieve that goal. Install the time service, enable it and it should work for you.

Code: Select all

[jdalrymple@localhost libexec]$ ./check_time -H remotehost
TIME OK - 15065 second time difference|time=0s;;;0 offset=15065s;;;0
rockxd
Posts: 26
Joined: Fri Feb 27, 2015 10:01 am

Re: Trouble With check_time command

Post by rockxd »

Yes, I know about the NTP checks. In the end I wanted to run the check_time commands with all of the servers I was monitoring and then use NTP check with the Nagios host itself.

Is this the service you are referencing installing the following: http://www.brennan.id.au/09-Network_Time_Protocol.html

Also I do not know much about installing a NTP server, but would like to know more information.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Post by jdalrymple »

Is this (the host to be checked) CentOS/RHEL?

If so

Code: Select all

yum install rdate
edit /etc/xinetd.d/time-stream

Code: Select all

# This is for quick on or off of the service
        disable         = yes
to

Code: Select all

# This is for quick on or off of the service
        disable         = no

Code: Select all

service xinetd restart
If not CentOS/RHEL, what distro?
rockxd
Posts: 26
Joined: Fri Feb 27, 2015 10:01 am

Re: Trouble With check_time command

Post by rockxd »

Yes my distro is RHEL.

But when I do 'service xinetd restart'

I get: xinetd.d/: unrecognized service
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Post by jdalrymple »

That's bizarre.

those 2 files I mentioned were there though?

Is xinetd installed?

Code: Select all

[jdalrymple@localhost ~]$ yum list installed | grep inetd
xinetd.x86_64                        2:2.3.14-39.el6_4                 @base
rockxd
Posts: 26
Joined: Fri Feb 27, 2015 10:01 am

Re: Trouble With check_time command

Post by rockxd »

No, I do not belive that xinetd is installed.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Post by jdalrymple »

It should be trivial to install:

Code: Select all

yum -y install xinetd
I'm surprised it's not. I would have guessed it to be part of a base CentOS/RHEL install.
Locked