Nagios - check_ntp_time - Offset Unknown
Solution 1
The key line here is this one:
discarding peer 0: stratum=0
An NTP server identifying itself as stratum 0 is a violation of the spec (it's reserved for atomic clocks or something like that). I had this problem years ago with some BSD and Mac OS X hosts. I ended up hacking the stratum check out of the source and maintaining a separate build of the plugin for "problematic" hosts.
The offending lines are 254-257 (currently, anyway), if you want to rip that out. It's a hack, but it works for me ;-)
I found this thread in the mailing list archives about it. I think there was another one where I suggested adding a command-line option to ignore the stratum check, but I don't think it got any traction.
There's also a bug report about it, but it hasn't yielded anything useful as far as I can tell.
Solution 2
I removed the problem be disabling the KOD (kiss-of-death) feature on the NTP server.
check_ntp sends (at least) 4 requests in quick succession to calculate a statistically sound average offset. The third and all following requests are considered a denial of service attack by the server and are answered with a KOD message (invalid stratum, namely 0). In fact, this behaviour should be considered a bug of check_ntp as KOD must be processed properly by the client.
Related videos on Youtube
![nimbit](https://lh5.googleusercontent.com/-SGZdDVPgGCA/AAAAAAAAAAI/AAAAAAAAAAA/AMZuucm2XXq4MfpggBfFSuobpkL6NPrkiA/photo.jpg?sz=256)
nimbit
Updated on September 18, 2022Comments
-
nimbit almost 2 years
I have a form just like this:
class addMeal(forms.Form): name = forms.CharField(max_length=40,widget=forms.TextInput(attrs={'class':'form-control','placeholder':'نام وعده'})) foods = forms.ModelMultipleChoiceField(queryset=Food.objects.filter(user=1),widget=forms.SelectMultiple(attrs={'class':'form-control'})) class Meta: model = Meals
i need write a queryset to get user id with request(see the
queryset=Food.objects.filter(user=1)
) what should i do to fix it?-
aecolley almost 10 yearsCheck the servers to make sure they are successfully using the local master NTP server as a preferred peer. Log into one and run
ntpq -p ::1
, and check that the master NTP server is marked with an asterisk. -
Aaron Copley almost 10 yearsDuplicate of Nagios NTP, discarding peer? Same version of the plugin, too.
-
Mike Purcell almost 10 years@AaronCopley No, he claims to be running 1.4.15, I'm running 1.4.16. Also, every request returned a response, if you notice in my request, only the first two returned a response, not sure why it has all the extra 're-sendings'.
-
Aaron Copley almost 10 years"This issue still exists after upgrading to 1.4.16"
-
Mike Purcell almost 10 yearsPosted by a different user, with no confirmation by OP. I am trying to find the change-log for that particular plugin.
-
Aaron Copley almost 10 yearsPoint was, it's a lead with indication that you aren't alone in this issue. I didn't downvote you or vote to close or anything. Just giving a lead.
-
Mike Purcell almost 10 yearsNo worries. I did see that post yesterday during my research, but led me to a dead-end.
-
Keith almost 10 yearsWhat OS is the host being checked?
-
030 over 9 yearsDid you solve this issue?
-
Mike Purcell over 9 years@utrecht: No I have not. TBH it's been a long while since the post, I will try to check back into it asap.
-
030 over 9 years@MikePurcell could you indicate whether the system is a VM?
-
Mike Purcell over 9 years@utrecht: Yes it is, running CentOS 6.5
-
030 over 9 years@MikePurcell Perhaps the ESX time is used. This answer helped me to solve the issue.
-
Mike Purcell over 9 yearsAwesome! I will check it out and get back to you.
-
-
dmourati over 9 yearsThis answer is a blast from my past. Same workaround deployed many years ago. Sigh.