[Git][NTPsec/ntpsec][master] 4 commits: Added stubs for forgotten table.

Ian Bruene gitlab at mg.gitlab.com
Tue Feb 13 21:37:49 UTC 2018


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
7da17659 by Ian Bruene at 2018-02-13T15:37:15-06:00
Added stubs for forgotten table.

- - - - -
f350482b by Ian Bruene at 2018-02-13T15:37:15-06:00
Fix division by zero bug in time resolution OID.

- - - - -
a7c8d5a2 by Ian Bruene at 2018-02-13T15:37:15-06:00
ConfigChange notification marked as Won't Implement.

- - - - -
9eedced9 by Ian Bruene at 2018-02-13T15:37:15-06:00
Updated ntpsnmpd documentation with info on MIB deviations.

- - - - -


2 changed files:

- docs/includes/ntpsnmpd-body.txt
- ntpclients/ntpsnmpd.py


Changes:

=====================================
docs/includes/ntpsnmpd-body.txt
=====================================
--- a/docs/includes/ntpsnmpd-body.txt
+++ b/docs/includes/ntpsnmpd-body.txt
@@ -25,7 +25,20 @@
 
 == Known Limitations ==
 
-This is a prototype. Large parts of the AgentX standard are not yet
-implemented.
+This is a prototype. Parts of the AgentX standard are not yet implemented.
+
+== Known Deviations from the MIB ==
+
+The ntpEntStatusEntityUptime OID specifies a bizzare time formant. This
+does not match what the SNMP tools expect to see from a TimeTicks variable.
+Instead the daemon returns a normal TimeTicks value.
+
+The ntpEntNotifConfigChanged trap is left unimplemented. This is because
+there currently is no way to implement what it wants, and it demands alerts
+regarding changes that are not part of NTPs jurisdiction.
+
+The ntpEntTimeResolution OID currently uses data from the sys_fuzz variable
+as the base for it's calculations. It is by no means certain that this is
+the correct choice, and the returned data should be taken with scepticism.
 
 // end


=====================================
ntpclients/ntpsnmpd.py
=====================================
--- a/ntpclients/ntpsnmpd.py
+++ b/ntpclients/ntpsnmpd.py
@@ -271,7 +271,7 @@ class DataSource:  # This will be broken up in future to be less NTP-specific
         self.notifySyspeerChange = False  # 3
         self.notifyAddAssociation = False  # 4
         self.notifyRMAssociation = False  # 5
-        self.notifyConfigChange = False  # 6
+        self.notifyConfigChange = False  # 6 [This is not implemented]
         self.notifyLeapSecondAnnounced = False  # 7
         self.notifyHeartbeat = False  # 8
 
@@ -379,7 +379,10 @@ class DataSource:  # This will be broken up in future to be less NTP-specific
         # We want to emit fractions of seconds
         # Yes we are flooring instead of rounding: don't want to emit a
         # resolution value higher than ntpd actually produces.
-        fuzz = int(1 / fuzz)
+        if fuzz != 0:
+            fuzz = int(1 / fuzz)
+        else:
+            fuzz = 0
         return ax.Varbind(ax.VALUE_GAUGE32, oid, fuzz)
 
     def cbr_timePrecision(self, oid):
@@ -570,7 +573,7 @@ class DataSource:  # This will be broken up in future to be less NTP-specific
     def cbr_entNotifMessage(self, oid):  # DUMMY
         # utf8str
         # Should probably either return null, or remove this handler.
-        return ax.Varbind(ax.VALUE_OCTET_STR, oid, "jabber")
+        return ax.Varbind(ax.VALUE_OCTET_STR, oid, "no event")
 
     #########################
 
@@ -631,6 +634,19 @@ class DataSource:  # This will be broken up in future to be less NTP-specific
     # some useful data to the handler() via the readCallback() layer.
     # ========================================================================
 
+    # Packet Mode Table
+
+    def sub_statPktMode(self):
+        pass
+
+    def sub_statPktSent(self):
+        pass
+
+    def sub_statPktRecv(self):
+        pass
+
+    # Association Table
+
     def sub_assocID(self):
         def handler(oid, associd):
             return ax.Varbind(ax.VALUE_GAUGE32, oid, associd)
@@ -940,7 +956,9 @@ class DataSource:  # This will be broken up in future to be less NTP-specific
                 control.sendNotify(vl)
                 self.sentNotifications += 1
 
-    def doNotifyConfigChange(self, control):  # DUMMY
+    def doNotifyConfigChange(self, control):
+        # This left unimplemented because the MIB wants something we can't
+        # and/or shouldn't provide
         pass
 
     def doNotifyLeapSecondAnnounced(self, control):



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/c1f15848adf7393f7df0761b46a70ad6d4d5a052...9eedced9ffad1658f9f41ccb6a0d9771c158de0b

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/c1f15848adf7393f7df0761b46a70ad6d4d5a052...9eedced9ffad1658f9f41ccb6a0d9771c158de0b
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180213/cf509cb0/attachment.html>


More information about the vc mailing list