Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you encounter the 'Time synchronization failed during discovery' error using the perl Net::SNMP library there may be a fairly easy work around.  It may be as easy as editing the Net::SNMP module to not invoke this error.  The following advice should be executed as root.

...

Always make a backup of a module prior to editing it.  A command such as 'cp SNMP.pm SNMP.pm.unpatched works well.In order to prevent Net::SNMP from failing due to this error we edited it in the following fashion.

Code Block
$ diff -bu SNMP.pm.original SNMP.pm.patched 
--- SNMP.pm.original    2018-01-26 08:36:28.833348881 +0900
+++ SNMP.pm.patched     2018-01-26 14:25:42.798070662 +0900
@@ -2617,8 +2617,9 @@
    # counter in the varBindList..."  If another error is returned, we 
    # assume that the synchronization has failed.
 
-   if (($this->{_security}->discovered()) &&
-       ($this->{_error} =~ /usmStatsNotInTimeWindows/))
+   if ($this->{_security}->discovered())
+   #if (($this->{_security}->discovered()) &&
+   #    ($this->{_error} =~ /usmStatsNotInTimeWindows/))
    {
       $this->_error_clear();
       DEBUG_INFO('discovery and synchronization complete');
@@ -2628,10 +2629,10 @@
    # If we received the usmStatsNotInTimeWindows report or no error, but 
    # we are still not synchronized, provide a generic error message.
 
-   if ((!$this->{_error}) || ($this->{_error} =~ /usmStatsNotInTimeWindows/)) {
-      $this->_error_clear();
-      $this->_error('Time synchronization failed during discovery');
-   }
+   #if ((!$this->{_error}) || ($this->{_error} =~ /usmStatsNotInTimeWindows/)) {
+   #   $this->_error_clear();
+   #   $this->_error('Time synchronization failed during discovery');
+   #}
 
    DEBUG_INFO('synchronization failed');