Trouble With check_time command
Trouble With check_time command
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?
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?
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Trouble With check_time command
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.
If you're trying to monitor NTP servers there is a check_ntp plugin designed just for that.
Re: Trouble With check_time command
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.
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.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Trouble With check_time command
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.
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
Re: Trouble With check_time command
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.
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.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Trouble With check_time command
Is this (the host to be checked) CentOS/RHEL?
If so
edit /etc/xinetd.d/time-stream
to
If not CentOS/RHEL, what distro?
If so
Code: Select all
yum install rdate
Code: Select all
# This is for quick on or off of the service
disable = yes
Code: Select all
# This is for quick on or off of the service
disable = no
Code: Select all
service xinetd restart
Re: Trouble With check_time command
Yes my distro is RHEL.
But when I do 'service xinetd restart'
I get: xinetd.d/: unrecognized service
But when I do 'service xinetd restart'
I get: xinetd.d/: unrecognized service
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Trouble With check_time command
That's bizarre.
those 2 files I mentioned were there though?
Is xinetd installed?
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
Re: Trouble With check_time command
No, I do not belive that xinetd is installed.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Trouble With check_time command
It should be trivial to install:
I'm surprised it's not. I would have guessed it to be part of a base CentOS/RHEL install.
Code: Select all
yum -y install xinetd