Nagios - check_ntp_time - Offset Unknown

57

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.

Share:
57

Related videos on Youtube

nimbit
Author by

nimbit

Updated on September 18, 2022

Comments

  • nimbit
    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
      aecolley almost 10 years
      Check 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
      Aaron Copley almost 10 years
      Duplicate of Nagios NTP, discarding peer? Same version of the plugin, too.
    • Mike Purcell
      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
      Aaron Copley almost 10 years
      "This issue still exists after upgrading to 1.4.16"
    • Mike Purcell
      Mike Purcell almost 10 years
      Posted by a different user, with no confirmation by OP. I am trying to find the change-log for that particular plugin.
    • Aaron Copley
      Aaron Copley almost 10 years
      Point 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
      Mike Purcell almost 10 years
      No worries. I did see that post yesterday during my research, but led me to a dead-end.
    • Keith
      Keith almost 10 years
      What OS is the host being checked?
    • 030
      030 over 9 years
      Did you solve this issue?
    • Mike Purcell
      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
      030 over 9 years
      @MikePurcell could you indicate whether the system is a VM?
    • Mike Purcell
      Mike Purcell over 9 years
      @utrecht: Yes it is, running CentOS 6.5
    • 030
      030 over 9 years
      @MikePurcell Perhaps the ESX time is used. This answer helped me to solve the issue.
    • Mike Purcell
      Mike Purcell over 9 years
      Awesome! I will check it out and get back to you.
  • dmourati
    dmourati over 9 years
    This answer is a blast from my past. Same workaround deployed many years ago. Sigh.