Permalink
Browse files

Alarm support continued

- added timeout, initial delay and snmp trap enable/disable
  to config and man page
- added support for OFM threshold monitoring
- added alarm messages to alarms
- added domain mismatch trap to MIB
- added last mismatched domain to logs and MIB
  • Loading branch information...
wowczarek committed Dec 18, 2015
1 parent 685a49a commit ea7a050a774428932fe0a3384fde1ad63ba49a33
Showing with 439 additions and 80 deletions.
  1. +24 −10 TODO
  2. +65 −3 doc/PTPBASE-MIB.txt
  3. +2 −0 src/bmc.c
  4. +7 −2 src/datatypes.h
  5. +147 −25 src/dep/alarms.c
  6. +18 −12 src/dep/alarms.h
  7. +5 −1 src/dep/configdefaults.c
  8. +24 −1 src/dep/daemonconfig.c
  9. +1 −0 src/dep/daemonconfig.h
  10. +2 −2 src/dep/net.c
  11. +8 −0 src/dep/servo.c
  12. +45 −19 src/dep/snmp.c
  13. +13 −1 src/dep/startup.c
  14. +3 −2 src/dep/sys.c
  15. +8 −1 src/protocol.c
  16. +1 −1 src/ptp_datatypes.h
  17. +66 −0 src/ptpd2.conf.5.in
View
34 TODO
@@ -5,31 +5,45 @@
- man page updates for template files x
- clock ID printed in reverse in L2 mode
with (grandmasterID present?) - not an issue, looks like a White Rabbit problem x
- complete built-in templates
- add dummy or populated default template file x [dummy]
- compact grantable message types and use smaller array to save memory x
- 16.1.1: may be granted in listening state or passive state <- but g.8265 is no BMCA x
- sig/msg message acceptance 4 options: all1,port, clockid,port, clock,all1, all1,all1 x
- rework config option parsing x
- rework parseConfig to support an opcode, get rid of remaining macros x
- rework trigger and dependency macros: 2nd pass?
- SET messages to refresh the config properly x/-
- NVRAM write?
- pointer to best master x
- disqualification flag x
- remove masteraddr in favour of bestMaster->sourceAddr x
- use split token loop
- use pointer to best master x
- management TLV buffer guard and don't unpack GET x
- SNMP - implement statistics tables x
- SNMP - implement remaining traps x
- add alarm events -> trigger SNMP traps x
- add offset alarm threshold to config x
- add alarm initial delay to config
- add snmp traps enable/disable to config
- clean up object order in the MIB x
- call alarm handlers before shutdown (on port disabled?) x
- add alarm initial delay to config + man x
- add alarm timeout to config + man x
- add snmp traps enable/disable to config + man x
- implement ofm threshold alarm triggering x
- SNMP MIB: add domain mismatch trap + last domain x
- add alarm messages to log notifications x
- add alarm messages to alarm table (for fault record)
- rework trigger and dependency macros: 2nd pass?
- complete built-in templates
- add dummy or populated default template file x [dummy]
- NVRAM write?
- use split token loop macros
- SET messages to refresh the config properly x/-
add set + commit + rollback as snmp handles
- remaining management message SET handling
- add fault record and numberfaults to snmp and mgmt
- clean up object order in the MIB x
- call alarm handlers before shutdown (on port disabled?)
- update man page with alarm descriptions
- improve alarm dump
- add alarm descriptions to help output
- eventually add support for an event queue
- SNMP MIB: add alarm list so that
informs can also send date and time
- MGMT clear and get fault record
- configurable alarm severities?
View
@@ -900,6 +900,35 @@ ClockType ::= TEXTUAL-CONVENTION
transparentClock(3),
boundaryNode(4) }
PtpdAlarmType ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"Alarm identifier (type) as used by PTPd"
REFERENCE
"PTPd 2.3.2"
SYNTAX INTEGER {
portState(0),
ofmThreshold(1),
ofmSeconds(2),
clockStep(3),
noSync(4),
noDelay(5),
masterChange(6),
networkFault(7),
fastAdj(8),
timePropertiesChange(9),
domainMismatch(10) }
PtpdAlarmState ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"Alarm state as used by PTPd"
REFERENCE
"PTPd 2.3.2"
SYNTAX INTEGER {
unset(0),
set(1),
cleared(2) }
ptpbaseMIBNotifs OBJECT IDENTIFIER
-- 1.3.6.1.4.1.46649.1.1.0
@@ -1097,6 +1126,25 @@ ptpBaseTimePropertiesChange NOTIFICATION-TYPE
-- 1.3.6.1.4.1.46649.1.1.0.17
::= { ptpbaseMIBNotifs 17 }
ptpBaseDomainMismatch NOTIFICATION-TYPE
OBJECTS {
ptpbaseClockDefaultDSDomainNumber,
ptpBaseClockPortDSLastMismatchedDomain }
STATUS current
DESCRIPTION
"Alarm: no packets from configured PTP domain are being received."
-- 1.3.6.1.4.1.46649.1.1.0.18
::= { ptpbaseMIBNotifs 18 }
ptpBaseDomainMismatchCleared NOTIFICATION-TYPE
OBJECTS {
ptpbaseClockDefaultDSDomainNumber}
STATUS current
DESCRIPTION
"Alarm cleared: Clock is receiving packets from configured PTP domain."
-- 1.3.6.1.4.1.46649.1.1.0.19
::= { ptpbaseMIBNotifs 19 }
ptpbaseMIBObjects OBJECT IDENTIFIER
-- 1.3.6.1.4.1.46649.1.1.1
@@ -2501,7 +2549,9 @@ PtpbaseClockPortDSEntry ::= SEQUENCE {
ptpbaseClockPortDSPeerMeanPathDelay ClockTimeInterval,
ptpbaseClockPortDSGrantDuration Unsigned32,
ptpbaseClockPortDSPTPVersion Integer32,
ptpBaseClockPortDSPeerMeanPathDelayString DisplayString }
ptpBaseClockPortDSPeerMeanPathDelayString DisplayString,
ptpBaseClockPortDSLastMismatchedDomain Integer32
}
ptpbaseClockPortDSDomainIndex OBJECT-TYPE
@@ -2673,6 +2723,15 @@ ptpBaseClockPortDSPeerMeanPathDelayString OBJECT-TYPE
-- 1.3.6.1.4.1.46649.1.1.1.2.8.1.16
::= { ptpbaseClockPortDSEntry 16 }
ptpBaseClockPortDSLastMismatchedDomain OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"PTP domain number of last mismatched domain (-1 = no mismatch)."
-- 1.3.6.1.4.1.46649.1.1.1.2.8.1.17
::= { ptpbaseClockPortDSEntry 17 }
ptpbaseClockPortRunningTable OBJECT-TYPE
SYNTAX SEQUENCE OF PtpbaseClockPortRunningEntry
@@ -5374,7 +5433,8 @@ ptpbaseMIBClockPortDSGroup OBJECT-GROUP
ptpbaseClockPortDSPeerMeanPathDelay,
ptpbaseClockPortDSGrantDuration,
ptpbaseClockPortDSPTPVersion,
ptpBaseClockPortDSPeerMeanPathDelayString }
ptpBaseClockPortDSPeerMeanPathDelayString,
ptpBaseClockPortDSLastMismatchedDomain }
STATUS current
DESCRIPTION
"Group which aggregates objects describing PTP Port Dataset
@@ -5638,7 +5698,9 @@ ptpbaseMIBNotificationGroup NOTIFICATION-GROUP
ptpBaseClockFreqAdjNormal,
ptpBaseSlaveOffsetFromMasterSeconds,
ptpBaseSlaveOffsetFromMasterSubSeconds,
ptpBaseTimePropertiesChange }
ptpBaseTimePropertiesChange,
ptpBaseDomainMismatch,
ptpBaseDomainMismatchCleared}
STATUS current
DESCRIPTION
"A grouping of notification objects defined in the PTPBASE-MIB MIB."
View
@@ -80,6 +80,8 @@ void initData(RunTimeOpts *rtOpts, PtpClock *ptpClock)
}
}
ptpClock->portDS.lastMismatchedDomain = -1;
if(rtOpts->pidAsClockId) {
uint16_t pid = htons(getpid());
memcpy(ptpClock->defaultDS.clockIdentity + 3, &pid, 2);
View
@@ -338,8 +338,12 @@ typedef struct {
LeapSecondInfo leapInfo;
Boolean snmp_enabled; /* SNMP subsystem enabled / disabled even if
compiled in */
Boolean snmpEnabled; /* SNMP subsystem enabled / disabled even if compiled in */
Boolean snmpTrapsEnabled; /* enable sending of SNMP traps (requires alarms enabled) */
Boolean alarmsEnabled; /* enable support for alarms */
int alarmMinAge; /* minimal alarm age in seconds (from set to clear notification) */
int alarmInitialDelay; /* initial delay before we start processing alarms; example: */
/* we don't need a port state alarm just before the port starts to sync */
Boolean pcap; /* Receive and send packets using libpcap, bypassing the
network stack. */
@@ -588,6 +592,7 @@ typedef struct {
IntervalTimer timers[PTP_MAX_TIMER];
AlarmEntry alarms[ALRM_MAX];
int alarmDelay;
NetPath netPath;
Oops, something went wrong.

0 comments on commit ea7a050

Please sign in to comment.