[Git][NTPsec/ntpsec][master] Notification stubs in place
Ian Bruene
gitlab at mg.gitlab.com
Thu Dec 28 19:32:09 UTC 2017
Ian Bruene pushed to branch master at NTPsec / ntpsec
Commits:
a2510bbf by Ian Bruene at 2017-12-28T13:31:37-06:00
Notification stubs in place
- - - - -
1 changed file:
- ntpclients/ntpsnmpd.py
Changes:
=====================================
ntpclients/ntpsnmpd.py
=====================================
--- a/ntpclients/ntpsnmpd.py
+++ b/ntpclients/ntpsnmpd.py
@@ -262,13 +262,13 @@ class DataSource: # This will be broken up in future to be less NTP-specific
self.sentNotifications = 0
# Notify bits, these should be saved to disk
# Also most of them currently have no effect
- self.notifyModeChange = False # 1 DUMMY
- self.notifyStratumChange = False # 2 DUMMY
- self.notifySyspeerChange = False # 3 DUMMY
- self.notifyAddAssociation = False # 4 DUMMY
- self.notifyRMAssociation = False # 5 DUMMY
- self.notifyConfigChange = False # 6 DUMMY
- self.notifyLeapSecondAnnounced = False # 7 DUMMY
+ self.notifyModeChange = False # 1
+ self.notifyStratumChange = False # 2
+ self.notifySyspeerChange = False # 3
+ self.notifyAddAssociation = False # 4
+ self.notifyRMAssociation = False # 5
+ self.notifyConfigChange = False # 6
+ self.notifyLeapSecondAnnounced = False # 7
self.notifyHeartbeat = False # 8
def getOID_core(self, nextP, searchoid, returnGenerator=False):
@@ -780,10 +780,52 @@ class DataSource: # This will be broken up in future to be less NTP-specific
# =====================================
def checkNotifications(self, control):
+ if self.notifyModeChange is True:
+ self.doNotifyModeChange(control)
+
+ if self.notifyStratumChange is True:
+ self.doNotifyStratumChange(control)
+
+ if self.notifySyspeerChange is True:
+ self.doNotifySyspeerChange(control)
+
+ if self.notifyAddAssociation is True:
+ self.doNotifyAddAssociation(control)
+
+ if self.notifyRMAssociation is True:
+ self.doNotifyRMAssociation(control)
+
+ if self.notifyConfigChange is True:
+ self.doNotifyConfigChange(control)
+
+ if self.notifyLeapSecondAnnounced is True:
+ self.doNotifyLeapSecondAnnounced(control)
+
if self.notifyHeartbeat is True:
- self.notifyHeartbeat(control)
+ self.doNotifyHeartbeat(control)
+
+ def doNotifyModeChange(self, control):
+ pass # DUMMY
+
+ def doNotifyStratumChange(self, control):
+ pass # DUMMY
+
+ def doNotifySyspeerChange(self, control):
+ pass # DUMMY
+
+ def doNotifyAddAssociation(self, control):
+ pass # DUMMY
+
+ def doNotifyRMAssociation(self, control):
+ pass # DUMMY
+
+ def doNotifyConfigChange(self, control):
+ pass # DUMMY
+
+ def doNotifyLeapSecondAnnounced(self, control):
+ pass # DUMMY
- def notifyHeartbeat(self, control):
+ def doNotifyHeartbeat(self, control): # TODO: check if ntpd running?
if self.heartbeatInterval == 0: # interval == 0 means send once
self.notifyHeartbeat = False
vl = [ax.Varbind(ax.VALUE_OID, snmpTrapOID,
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a2510bbf7994cfd61f4561f6d1a891e663ba712f
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a2510bbf7994cfd61f4561f6d1a891e663ba712f
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/20171228/fbc74df3/attachment.html>
More information about the vc
mailing list