PtpMonitor

The Precision Time Protocol allows the precise synchronization of clocks in measurement and control systems implemented with packet-based networks. THE PRP monitor allows you to test the port state of SNMP-enabled interfaces using the PTP MIB defined in RFC 8173. During the poll, it queries the device for the available clock-ports and their states and compares with a given expected state. If the state equals the desired state the service is considered up and down otherwise. The following states are available:

  • initializing

  • faulty

  • disabled

  • listening

  • preMaster

  • master

  • passive

  • uncalibrated

  • slave

Monitor facts

Class Name

org.opennms.netmgt.poller.monitors.PtpMonitor

Configuration and Use

Table 1. Optional monitor-specific parameters for the PtpMonitor
Parameter Description Default

clock-port

Name of the interface that must be in the specified state.

n/a

port-state

The desired state that the port must be in.

n/a

This monitor implements the Common Configuration Parameters.

Examples

Note that you must include the monitor section for each service in your definition.

Example uses CentOS/RHEL path name. For Debian/Ubuntu, use /var/lib/opennms/rrd/response.

 <service name="PTP" interval="300000" user-defined="false" status="on">
   <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
   <parameter key="rrd-base-name" value="ptp"/>
   <parameter key="ds-name" value="ptp"/>
   <parameter key="clock-port" value="Ethernet2" />
   <parameter key="port-state" value="slave" />
 </service>

 <monitor service="PTP" class-name="org.opennms.netmgt.poller.monitors.PtpMonitor" />

Advanced example to also support a service name pattern:

 <service name="PTP" interval="300000" user-defined="false" status="on">
   <pattern><![CDATA[^PTP-(?<clockPort>.*)-(?<portState>.*)$]]></pattern>
   <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/>
   <parameter key="clock-port" value="${pattern:clockPort|requisition:ptp:clockPort|default}" />
   <parameter key="port-state" value="${pattern:portState|requisition:ptp:portState|default}" />
 </service>

 <monitor service="PTP" class-name="org.opennms.netmgt.poller.monitors.PtpMonitor" />