$ sudo ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
10.35.60.40 .INIT. 16 u 505 1024 0 0.000 0.000 0.000
10.35.60.41 .INIT. 16 u 471 1024 0 0.000 0.000 0.000
$ sudo /usr/local/lib/nagios/plugins/check_ntpmon.py --check sync
Traceback (most recent call last):
File "/usr/local/lib/nagios/plugins/check_ntpmon.py", line 360, in <module>
main()
File "/usr/local/lib/nagios/plugins/check_ntpmon.py", line 337, in main
ntp = NTPPeers(lines, checkntpmon)
File "/usr/local/lib/nagios/plugins/check_ntpmon.py", line 214, in __init__
self.ntpdata['reachability'] = float(self.ntpdata['totalreach']) * 100 / self.ntpdata['peers'] / 8
ZeroDivisionError: float division by zero
We've got a float to start with, so we could probably just add sys.float_ info.epsilon to that peers number.