Trouble With check_time command

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Trouble With check_time command

Postby rockxd » Fri Feb 27, 2015 10:12 am

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

Re: Trouble With check_time command

Postby jdalrymple » Fri Feb 27, 2015 10:25 am

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.
jdalrymple
Skynet Drone
 
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Postby rockxd » Fri Feb 27, 2015 11:55 am

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

Re: Trouble With check_time command

Postby jdalrymple » Fri Feb 27, 2015 12:12 pm

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
jdalrymple
Skynet Drone
 
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Postby rockxd » Fri Feb 27, 2015 12:48 pm

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

Re: Trouble With check_time command

Postby jdalrymple » Fri Feb 27, 2015 1:11 pm

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?
jdalrymple
Skynet Drone
 
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Postby rockxd » Fri Feb 27, 2015 3:26 pm

Yes my distro is RHEL.

But when I do 'service xinetd restart'

I get: xinetd.d/: unrecognized service
rockxd
 
Posts: 26
Joined: Fri Feb 27, 2015 10:01 am

Re: Trouble With check_time command

Postby jdalrymple » Mon Mar 02, 2015 9:47 am

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
jdalrymple
Skynet Drone
 
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Trouble With check_time command

Postby rockxd » Tue Mar 03, 2015 12:56 pm

No, I do not belive that xinetd is installed.
rockxd
 
Posts: 26
Joined: Fri Feb 27, 2015 10:01 am

Re: Trouble With check_time command

Postby jdalrymple » Tue Mar 03, 2015 1:07 pm

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.
jdalrymple
Skynet Drone
 
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 25 guests