TcpMonitor
This monitor uses TCP to test OSI Layer 4 connectivity. The monitor establishes a TCP connection to a specific port. The greetings banner of the application is evaluated to check the availability of the service. The behavior is similar to a simple test using the telnet command as shown in the example.
root@vagrant:~# telnet 127.0.0.1 22
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 (1)
1 | Service greeting banner |
Configuration and Use
Parameter | Description | Default |
---|---|---|
Required |
||
port |
TCP port of the application. |
-1 |
Optional |
||
retry |
Number of retries before the service is marked as down. |
0 |
banner |
Evaluation of the service connection banner with regular expression. By default any banner result is valid. |
* |
This monitor implements the Common Configuration Parameters.
Examples
This example shows how to test if the Independent Computing Architecture (ICA) service is available on TCP port 1494.
The test evaluates the connection banner starting with ICA
.
The example uses a CentOS/RHEL path name.
For Debian/Ubuntu, use /var/lib/opennms/rrd/response
.
<service name="TCP-Citrix-ICA" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="0" />
<parameter key="banner" value="ICA" />
<parameter key="port" value="1494" />
<parameter key="timeout" value="3000" />
<parameter key="rrd-repository" value="/opt/opennms/share/rrd/response" />
<parameter key="rrd-base-name" value="tcpCitrixIca" />
<parameter key="ds-name" value="tcpCitrixIca" />
</service>
<monitor service="TCP-Citrix-ICA" class-name="org.opennms.netmgt.poller.monitors.TcpMonitor" />