How to display availability of new services configured in poller-configuration.xml

Problem:
I have defined a new package with updated/new/removed services in poller-configuration.xml as compared to the “example1” package; for instance:

       <package name="local-private-lan">
    ...
          <service name="DNS" interval="300000" user-defined="true" status="on">
             <parameter key="retry" value="1"/>
             <parameter key="port" value="53"/>
             <parameter key="timeout" value="5000"/>
             <parameter key="rrd-repository" value="/var/lib/opennms/rrd/response"/>
             <parameter key="rrd-base-name" value="dns"/>
             <parameter key="ds-name" value="dns"/>
          </service>
          <service name="DOH" interval="300000" user-defined="true" status="on">
             <parameter key="retry" value="1"/>
             <parameter key="port" value="853"/>
             <parameter key="timeout" value="5000"/>
             <parameter key="rrd-repository" value="/var/lib/opennms/rrd/response"/>
             <parameter key="rrd-base-name" value="dns"/>
             <parameter key="ds-name" value="dns"/>
          </service>
          <service name="IMAPS" interval="300000" user-defined="true" status="on">
             <parameter key="retry" value="1"/>
             <parameter key="port" value="993"/>
             <parameter key="timeout" value="3000"/>
             <parameter key="rrd-repository" value="/var/lib/opennms/rrd/response"/>
             <parameter key="rrd-base-name" value="imaps"/>
             <parameter key="ds-name" value="imaps"/>
          </service>
          <service name="SMTPS" interval="300000" user-defined="true" status="on">
             <parameter key="retry" value="1"/>
             <parameter key="timeout" value="3000"/>
             <parameter key="port" value="465"/>
             <parameter key="rrd-repository" value="/var/lib/opennms/rrd/response"/>
             <parameter key="rrd-base-name" value="smtps"/>
             <parameter key="ds-name" value="smtps"/>
          </service>
    ...
       </package>
    ...
       <monitor service="DNS" class-name="org.opennms.netmgt.poller.monitors.TcpMonitor"/>
       <monitor service="DOH" class-name="org.opennms.netmgt.poller.monitors.TcpMonitor"/>
       <monitor service="IMAPS" class-name="org.opennms.netmgt.poller.monitors.ImapsMonitor"/>
       <monitor service="SMTPS" class-name="org.opennms.netmgt.poller.monitors.TcpMonitor"/>
    ...

Expected outcome:
I have tested that these services are accessible with:

    ssh -p 8101 admin@localhost
    ...
    admin@opennms> opennms-poller:poll -S DNS -P local-private-lan <target-ip-addr>
    Package: local-private-lan
    Service: DNS
    Monitor: org.opennms.netmgt.poller.monitors.TcpMonitor
    Parameter ds-name: dns
    Parameter port: 53
    Parameter retry: 1
    Parameter rrd-base-name: dns
    Parameter rrd-repository: /var/lib/opennms/rrd/response
    Parameter timeout: 5000

    Service is Up on <target-ip-addr> using org.opennms.netmgt.poller.monitors.TcpMonitor:
    	response-time: 1.5044
    admin@opennms> opennms-poller:poll -S DOH -P local-private-lan <target-ip-addr>
    Package: local-private-lan
    Service: DOH
    Monitor: org.opennms.netmgt.poller.monitors.TcpMonitor
    Parameter ds-name: dns
    Parameter port: 853
    Parameter retry: 1
    Parameter rrd-base-name: dns
    Parameter rrd-repository: /var/lib/opennms/rrd/response
    Parameter timeout: 5000

    Service is Up on <target-ip-addr> using org.opennms.netmgt.poller.monitors.TcpMonitor:
    	response-time: 5.6491
    admin@opennms> opennms-poller:poll -S IMAPS -P local-private-lan <target-ip-addr>
    Package: local-private-lan
    Service: IMAPS
    Monitor: org.opennms.netmgt.poller.monitors.ImapsMonitor
    Parameter ds-name: imaps
    Parameter port: 993
    Parameter retry: 1
    Parameter rrd-base-name: imaps
    Parameter rrd-repository: /var/lib/opennms/rrd/response
    Parameter timeout: 3000

    Service is Up on <target-ip-addr> using org.opennms.netmgt.poller.monitors.ImapsMonitor:
    	response-time: 41.0357
    admin@opennms> opennms-poller:poll -S SMTPS -P local-private-lan <target-ip-addr>
    Package: local-private-lan
    Service: SMTPS
    Monitor: org.opennms.netmgt.poller.monitors.TcpMonitor
    Parameter ds-name: smtps
    Parameter port: 465
    Parameter retry: 1
    Parameter rrd-base-name: smtps
    Parameter rrd-repository: /var/lib/opennms/rrd/response
    Parameter timeout: 3000

    Service is Up on <target-ip-addr> using org.opennms.netmgt.poller.monitors.TcpMonitor:
    	response-time: 1.5641

On the GUI side, if I go to Info --> Nodes --> , the usual services are listed below “Availability”: ICMP, SMTP, SNMP & SSH. No trace of previously defined services.

I have probably missed a config step.
Any suggestion?

Also, do I need to modify response-graph.properties and how?

OpenNMS version:
25.2.1-1

In the poller-configuration.xml you define in general speaking how do you want to test a service with a name let’s say from your example DNS. Associated with the DNS service name you have chosen to use the TcpMonitor at the bottom of your file with the monitor service definition.

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

The section:

<service name="DNS" interval="300000" user-defined="true" status="on">
  <parameter key="retry" value="1"/>
  <parameter key="port" value="53"/>
  <parameter key="timeout" value="5000"/>
  <parameter key="rrd-repository" value="/var/lib/opennms/rrd/response"/>
  <parameter key="rrd-base-name" value="dns"/>
  <parameter key="ds-name" value="dns"/>
</service>

are the configuration parameter for the TcpMonitor like retries, port etc. The next step is to tell OpenNMS for which IP addresses in the nodes inventory should it test this service. There are several ways to get this done, a) you assign it manually in the Provisioning system on a node or b) you try it like a port scanner and try to find it automatically using service Detectors. There exist already a few default ones. You find them in the Provisioning Requisition interface in the Admin section (More actions … -> Edit detectors & policies).

What I first notice in your configuration, you have used the TcpMonitor for DNS which is only used for DNS zone transfers and uses UDP for the queries.

Seconde you have used the dns as rrd-base-name and dns-name for DNS and your DOH service, should use different names. This is timeseries storage for response time measurements and if you write both to the same place becomes funky. In hope, this helps.

Thanks for your answer.
It was not shown in my first post, but I have already removed <include-range …> and defined some specific hosts like this:

   <package name="local-private-lan">
      <filter>IPADDR != '0.0.0.0'</filter>
      <specific>target-ip-addr</specific>
      <specific>another-target-ip-addr</specific>
...

target-ip-addr matches the IP address which has already been discovered and already appears below the Availability section of the GUI.

Regarding DNS, I chose TcpMonitor on purpose because for some strange reason, “DnsMonitor” and “DNSResolutionMonitor” don’t work (the service is reported by the manual test as down although it is really up on the target).

You’re right for the DOH service, I changed “dns” to “doh”:

      <service name="DOH" interval="300000" user-defined="true" status="on">
         <parameter key="retry" value="1"/>
         <parameter key="port" value="853"/>
         <parameter key="timeout" value="5000"/>
         <parameter key="rrd-repository" value="/var/lib/opennms/rrd/response"/>
         <parameter key="rrd-base-name" value="doh"/>
         <parameter key="ds-name" value="doh"/>
      </service>

Restarting opennms and checking the “Availability” section in the GUI: same old services as before.
Is it necessary to define/include the new “local-private-lan” package somewhere in the GUI?

You have to assign the services to an IP interface of your node. You can do it manually in the requisition by adding it to the Nodes IP interface in the “Manage Provisioning Requisitions” admin user interface.

This is probably something for a dedicated topic discourse. Let’s get your service first assigned to a node.

Admin --> Provisioning Requisitions
There are no requisitions
–> Add requisition --> local-private-lan --> OK
Synchronize
After some time:
Refresh --> Reload Deployed Data
Nodes defined & Nodes in Database remain at 0.
I could not find a way to synchronize the existing nodes listed under “Info --> Nodes” with the defined requisition to avoid adding the same node(s) twice.

Maybe I should rather edit " Default Foreign Source Definition", although I’m a bit lost because there is a list of default detectors, but the services manually defined in poller-configuration.xml do not show up anywhere.

Nor should they. You have to create them.

I definitely needed some doc reading; after adding/updating some default detectors such as the ones needed for the services described in my first post, (DNS, IMAPs, …), I rescanned the remote device (Info --> Nodes --> node --> Rescan) and waited; after reloading the page, most services now appear below “Availability”.

There was no need to add any specific policy.

There is a minor issue though with the default detectors definition: when adding a 21st detector, it is not displayed; there are 10 detectors per page and there is no 3rd page displayable.

Also, all the “Availablity” info is gone for the “localhost”.
There is just a list of “SNMP Attributes” & all “Node Interfaces”.
Could this be linked to the fact that I deleted some (not all) interfaces (which correspond to tap interfaces) in the “Delete Nodes” admin config page?

Regarding the minor issue, I edited the “default-foreign-source.xml”, reorganized (alphabetically) the list of detectors, and the issue is gone: now I see a third page in the list of default detectors on the GUI after restarting opennms systemd service.