Skip to content

NMS-11035: Monitor reference docs - #8997

Open
joseanesONMS wants to merge 12 commits into
developfrom
jira/NMS-11035-monitor-docs
Open

joseanesONMS wants to merge 12 commits into
developfrom
jira/NMS-11035-monitor-docs

Conversation

@joseanesONMS

@joseanesONMS joseanesONMS commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Documents the poller monitor reference pages, split out of #8984; content checked against the code on develop, one commit per ticket.

Ticket Topic Page(s) added/changed Source of truth
NMS-11037 LaTableMonitor reference/…/monitors/LaTableMonitor.adoc (new) …/monitors/LaTableMonitor.java, SnmpMonitorStrategy.java
NMS-11041 LogMatchTableMonitor reference/…/monitors/LogMatchTableMonitor.adoc (new) …/monitors/LogMatchTableMonitor.java
NMS-9788 SshMonitor banner regular expressions reference/…/monitors/SshMonitor.adoc …/monitors/SshMonitor.java
NMS-15338 Examples for DeviceConfig, JolokiaBean and Web monitors DeviceConfigMonitor.adoc, JolokiaBeanMonitor.adoc, WebMonitor.adoc features/device-config/monitor/…/DeviceConfigMonitor.java, JolokiaBeanMonitor.java, WebMonitor.java

The wrong WebMonitor parameter rows are also corrected.

Corrections to existing docs (separate NMS-11035: Fix … commits, each can be dropped on its own)

Topic Change Source of truth
DeviceConfigMonitor schedule default is daily at midnight, never is the shipped value DeviceConfigMonitor.java, DeviceConfigConstants.java
Monitor retry Retries after the first attempt, on 13 TimeoutTracker-based monitors TimeoutTracker.shouldRetry()
Monitor listings Literal $\{…} backslashes in source blocks; DNSResolution {nodeLabel} case ParameterSubstitutingMonitor.java

Not addressed

  • NMS-11035: JschSshMonitor is not registered as a service monitor (not in META-INF/services or the blueprint), so the poller cannot load it; its page was dropped in review.
  • NMS-11035, NMS-11037, NMS-11041 (detector part): no JschSsh, LaTable or LogMatchTable detector exists on develop.

The docs build adds no warnings (develop's two existing ones remain).

External References

The JschSshMonitor is still registered on develop but had no reference page.
It is a deprecated wrapper around SshMonitor (JschSshMonitor.java delegates every poll), so the page lists the SshMonitor parameters and points to it.
The LaTableMonitor is registered on develop but had no reference page.
The page follows LaTableMonitor.java: it walks laErrorFlag in the UCD-SNMP-MIB laTable and only reads the port, retry/retries, and timeout overrides.
The LogMatchTableMonitor is registered on develop but had no reference page.
The page follows LogMatchTableMonitor.java: it walks logMatchErrorFlag in the UCD-SNMP-MIB logMatchTable and only reads the port, retry/retries, and timeout overrides.
The banner parameter said "regular expression" without naming the flavour or how it is applied.
SshMonitor.java compiles banner/match with java.util.regex.Pattern and calls find() on the server banner line, so the page now says so and gives tested examples.
…olokiaBeanMonitor, and WebMonitor

The three pages had no complete service and monitor definition to copy from.
Examples follow the monitor classes and the shipped poller-configuration.xml; the WebMonitor header and response-text rows are corrected to match WebMonitor.java.
DeviceConfigMonitor.poll falls back to DeviceConfigConstants.DEFAULT_CRON_SCHEDULE (0 0 0 * * ?) when the schedule parameter is absent; never is only the value the shipped poller-configuration.xml sets.
These monitors loop while TimeoutTracker.shouldRetry() returns m_attempt <= m_retry, so retry counts the extra attempts after the first one, not the total number of attempts.
Listing blocks do not apply attribute substitution, so the backslash in $\{ipaddr} rendered literally in the JolokiaBeanMonitor, CiscoPingMibMonitor, MailTransportMonitor, SystemExecuteMonitor, and DNSResolutionMonitor examples.
The DNSResolutionMonitor example now uses {nodeLabel}, the case-sensitive token ParameterSubstitutingMonitor recognizes.

@marshallmassengill marshallmassengill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass:

The JschSshMonitor.adoc page documents a class that OpenNMS cannot load. The class is not registered as a service monitor on the develop branch. The poller cannot find it. We should just remove this I think? That or fix it but I'd vote for removal I think.

The LogMatchTableMonitor.adoc page says that the monitor finds log matches. This is not correct. The Net-SNMP agent sets logMatchErrorFlag to 1 only when a logmatch line is not valid. A log match does not set the flag. Change the introduction and the example text to say that the monitor checks the configuration of the logmatch lines.

The LaTableMonitor.adoc page says that the agent sets the flag when the load "crossed" the threshold. The agent sets the flag when the load is equal to or more than the threshold. Change "crossed" to "reached or crossed".

The SshMonitor.adoc banner section does not include one result. When the server opens the connection and then closes it before it sends a banner, the monitor reports the service as down. The reason is "server closed connection before banner was received". Add one sentence for this result.

JschSshMonitor is listed in neither META-INF/services/org.opennms.netmgt.poller.ServiceMonitor nor the monitors blueprint, so the poller cannot load it; a page for it would document a monitor nobody can configure. The nav entry and the SshMonitor cross-reference go with it.
…check

The UCD-SNMP-MIB defines logMatchErrorFlag as "is this line configured correctly?": Net-SNMP sets it to 1 only for a logmatch line that is not valid, never because the log file matched. The introduction and the example now say the monitor checks the logmatch configuration.
…shold

Net-SNMP sets laErrorFlag when a load average is equal to or above the configured threshold, not only above it. The MIB description stays quoted verbatim, with the precise rule stated after it.
With banner matching enabled, SshMonitor.poll returns unavailable with "server closed connection before banner was received." when the server closes the connection before sending a banner.
@joseanesONMS

Copy link
Copy Markdown
Contributor Author

@marshallmassengill Thanks, all four addressed:

  • 8068537 removes the JschSshMonitor page, its nav entry and the SshMonitor cross-reference; it is not in META-INF/services or the blueprint, so the poller can't load it.
  • f000d73: LogMatchTableMonitor now says it checks the logmatch configuration and that a match does not set the flag.
  • fe517e2: LaTableMonitor says the flag is set when the load reaches or crosses the threshold (the MIB description stays quoted verbatim above it).
  • 6403960: SshMonitor documents the "server closed connection before banner was received." result.

The LogMatchTableMonitor tests the link:http://www.net-snmp.org/docs/mibs/ucdavis.html#logMatchTable[logMatchTable] of a Net-SNMP agent.
The agent populates this table from the `logmatch` directives in its `snmpd.conf` file, each of which watches a log file for a regular expression.

The monitor checks that these `logmatch` lines are configured correctly; it does not report log matches.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's pretty useless, then.

@dino2gnt dino2gnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly harmless.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants