check_ntp equivalent for chrony?

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
gossamer
Posts: 20
Joined: Wed Jul 13, 2011 9:56 pm

check_ntp equivalent for chrony?

Post by gossamer »

Hi,

I have a fedora22 system which uses chronyd by default. I upgraded
from an older release that used ntpd, and check_ntp to make sure it's
running.

I searched quite a bit, and have been unable to locate an updated
check as it relates to chrony. Does anyone have any ideas? I've tried
check_ntp_peer and check_ntp_time as well...

Thanks,
Alex
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_ntp equivalent for chrony?

Post by jdalrymple »

What is your goal exactly? Check the health of your ntp server? For that you would use check_ntp_peer. The deal is that if your NTP server is compliant to the NTP protocol standards it should work irrespective of the implementation. If it's not compliant I'd suggest canning it in lieu of ntpd. I'd be surprised however if Ferdora replaced ntpd with proprietary software.

If you just want to check the date of your computer, use check_ntp_time, and it will be querying external servers so your ntp implementation is of no consequence in that situation.
gossamer
Posts: 20
Joined: Wed Jul 13, 2011 9:56 pm

Re: check_ntp equivalent for chrony?

Post by gossamer »

jdalrymple wrote:What is your goal exactly? Check the health of your ntp server? For that you would use check_ntp_peer. The deal is that if your NTP server is compliant to the NTP protocol standards it should work irrespective of the implementation. If it's not compliant I'd suggest canning it in lieu of ntpd. I'd be surprised however if Ferdora replaced ntpd with proprietary software.

If you just want to check the date of your computer, use check_ntp_time, and it will be querying external servers so your ntp implementation is of no consequence in that situation.
We were previously using check_ntp locally through check_nrpe to ensure ntpd was running on our servers. With fedora22, they're no longer using ntpd by default, and instead using chronyd. It's also open source, of course, but apparently doesn't listen on a port in the way that ntpd does.

In fact, to check the time using chrony, you would run the following:

Code: Select all

# chronyc tracking
Reference ID    : 0.0.0.0 ()
Stratum         : 0
Ref time (UTC)  : Thu Jan  1 00:00:00 1970
System time     : 0.000000019 seconds fast of NTP time
Last offset     : +0.000000000 seconds
RMS offset      : 0.000000000 seconds
Frequency       : 12.390 ppm fast
Residual freq   : +0.000 ppm
Skew            : 0.000 ppm
Root delay      : 0.000000 seconds
Root dispersion : 0.000000 seconds
Update interval : 0.0 seconds
Leap status     : Not synchronised
More info on chrony is here:

https://docs.fedoraproject.org/en-US/Fe ... nized.html

I could always still using ntpd, but chrony is now the default.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_ntp equivalent for chrony?

Post by jdalrymple »

Since it's not an ntpd replacement (it would seem) is it safe to say that your only goal is to make sure the service is running?

Code: Select all

check_procs -a chronyd -c 1:
** EDIT **

http://chrony.tuxfamily.org/ states:
It can also operate as an NTPv4 (RFC 5905) server and peer to provide a time service to other computers in the network.
If that's the case, I'm pretty certain all of the old check_ntp tools should work fine for you. They are not ntpd specific, as a matter of fact many different flavors of *NIX have their own ntpd implementations.
gossamer
Posts: 20
Joined: Wed Jul 13, 2011 9:56 pm

Re: check_ntp equivalent for chrony?

Post by gossamer »

jdalrymple wrote:Since it's not an ntpd replacement (it would seem) is it safe to say that your only goal is to make sure the service is running?

Code: Select all

check_procs -a chronyd -c 1:
Well, and that's it's actually keeping accurate time on the host.

Something similar to the ntp "NTP OK: Offset -7.659196854e-06 secs" output would be ideal.
http://chrony.tuxfamily.org/ states:

It can also operate as an NTPv4 (RFC 5905) server and peer to provide a time service to other computers in the network.
If that's the case, I'm pretty certain all of the old check_ntp tools should work fine for you. They are not ntpd specific, as a matter of fact many different flavors of *NIX have their own ntpd implementations.[/quote]

It looks like by default just the client is run. If I have to configure a server, perhaps I'll just continue to use ntp. In any case, it looks like nagios should operate as normal once it's configured properly.

Thanks for your help.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_ntp equivalent for chrony?

Post by jdalrymple »

I really need to spin you back around to this:
jdalrymple wrote:What is your goal exactly?
So you said:
gossamer wrote:Something similar to the ntp "NTP OK: Offset -7.659196854e-06 secs" output would be ideal.
Which indicates to me you want to know the offset of something. Do you want to know the offset of your NTP server or of your client machine? So then I read this:
gossamer wrote:If I have to configure a server, perhaps I'll just continue to use ntp.
Which answers my last question. So the best guess that I can make is that you want to compare the offset of your computers time with a NTP server. This means you'll use check_ntp_time as I indicated in my original post:
jdalrymple wrote:If you just want to check the date of your computer, use check_ntp_time, and it will be querying external servers so your ntp implementation is of no consequence in that situation.
And just like I said in my original post, your time sync service is of no consequence. You don't even need to be running an NTP sync daemon of any sorts in order to achieve results with that tool:

Code: Select all

[jdalrymple@localhost libexec]$ ./check_ntp_time -H pool.ntp.org -w 0.1 -c 0.2
NTP OK: Offset 0.001798510551 secs|offset=0.001799s;0.100000;0.200000;
[jdalrymple@localhost libexec]$ sudo /etc/init.d/ntpd stop
Shutting down ntpd:                                        [  OK  ]
[jdalrymple@localhost libexec]$ ./check_ntp_time -H pool.ntp.org -w 0.1 -c 0.2
NTP OK: Offset 0.002576828003 secs|offset=0.002577s;0.100000;0.200000;
Does this all make sense, or am I still way off base?
Locked