Monitor SSH on Non-Standard Port in OpenNMS
Posted 100 days ago by Alex in Software, Technology
To enhance security, I run SSH on a non-standard port. When using OpenNMS to monitor systems, it only looks for SSH servers on the standard port (22) so I had to update the configuration to monitor systems running SSH on a different port. Here’s the configuration I used:
Note: I spent a long time trying to figure this out. The key is that the ‘banner’ property is the String that the monitor daemon looks for to confirm that it’s communicating with an SSH server. I erroneously put ‘SSH-1920′ which would never match the SSH server’s response banner.
<!-- capsd-configuration.xml --> <protocol-plugin protocol="SSH-1920" class-name="org.opennms.netmgt.capsd.plugins.SshPlugin" scan="on"> <property key="banner" value="SSH" /> <property key="port" value="1920" /> <property key="timeout" value="3000" /> <property key="retry" value="1" /> </protocol-plugin> <!-- poller-configuration.xml --> <service name="SSH-1920" interval="300000" user-defined="false" status="on"> <parameter key="retry" value="1"/> <parameter key="banner" value="SSH"/> <parameter key="port" value="1920"/> <parameter key="timeout" value="3000"/> <parameter key="rrd-repository" value="/opt/opennms/share/rrd/response"/> <parameter key="rrd-base-name" value="ssh-1920"/> <parameter key="ds-name" value="ssh-1920"/> </service> <!-- ... and farther down below ... --> <monitor service="SSH-1920" class-name="org.opennms.netmgt.poller.monitors.SshMonitor"/>