How to add ip:port with provision.pl ? Monitor all unused ports on all nodes

We are using OpenNMS Horizon 25.2.1 on redhat 8.1

Problem:
I need to add a list of different IPs with different ports into.

Is there a way to do this with provision.pl ?
For example:
192.168.0.1 on port 5432 - PostgreSQL
192.168.0.1 on port 10514 - Rsyslog
192.168.0.2 on port 10514 - Rsyslog

And is there also a way to monitor all unused ports on all nodes ?

Thanks for any input
Michael

OpenNMS will only monitor sevices defined in poller-configuration.xml. There is a PostgreSQL service shipped in the default config, and you can create a new service (probably using TcpMonitor) for Rsyslog to watch port 10514. Then you would assign those services either directly to your nodes in a requisition or setup detectors to determine if the service is open or not and then start monitoring.

There is no fuction to monitor all other unused ports to tell when they start being used. By configuring poller services and adding detectors to requisitions, the system can auto-add specific services when they are found on nodes.

I saw that in poller-configuration.xml is a Postgres service. But I was wondering that my database was not monitored/listed automatically.

In order for services to be monitored automatically, there has to be a Detector setup in the foreign source definition (FS Definition) of the requisition. If no requisition is used, the Default FS will apply.

Could you please send the details in a document what to do, where to do …

The default poller config should have a service for Postgres:

      <service name="Postgres" interval="300000" user-defined="false" status="on">
         <parameter key="retry" value="1"/>
         <parameter key="banner" value="*"/>
         <parameter key="port" value="5432"/>
         <parameter key="timeout" value="3000"/>
      </service>
...
      <monitor service="Postgres" class-name="org.opennms.netmgt.poller.monitors.TcpMonitor"/>

You can make a copy of that and rename the label and port for tracking syslog on 10514.

If you want rsyslog auto-detected on all nodes, edit the Foreign Source definition (FS) of your requisition to include a TcpMonitor looking at port 10514. Make sure the name of the detector matches the name you put on on the <service /> for the poller.
Repeat for any other service you want to monitor up/down state.

Note that v25 is almost a year and a half old at this time. I would suggest taking a look at moving to a new version, if possible.

Thanks a lot, I will try that and report back.

It is working. But I have a question about the service names. In my standard installation there are services predefined: e.g. Postgres and PostgreSQL. If I check the os the service name is postgresql.

Is the service name undependant and the only thing is the port number which is to consider ?