Skip to main content

TCP Protocol

Pack Assets​

Templates​

The Monitoring Connector Protocol TCP brings 2 host templates:

  • App-Protocol-Tcp
  • App-Protocol-Tcp-Only

The connector brings the following service templates (sorted by host template):

Service AliasService TemplateService Description
N/AN/AN/A

Collected metrics & status​

Metric nameUnit
statusN/A
tcp.response.time.secondss

Setup​

Monitoring Pack​

If the platform uses an online license, you can skip the package installation instruction below as it is not required to have the pack displayed within the Configuration > Monitoring Connector Manager menu. If the platform uses an offline license, install the package on the central server with the command corresponding to the operating system's package manager:

dnf install centreon-pack-applications-protocol-tcp

Whatever the license type (online or offline), install the Protocol TCP Pack through the Configuration > Monitoring Connector Manager menu.

Plugin​

Since Centreon 22.04, you can benefit from the 'Automatic plugin installation' feature. When this feature is enabled, you can skip the installation part below.

You still have to manually install the plugin on the poller(s) when:

  • Automatic plugin installation is turned off
  • You want to run a discovery job from a poller that doesn't monitor any resource of this kind yet

More information in the Installing the plugin section.

Use the commands below according to your operating system's package manager:

dnf install centreon-plugin-Applications-Protocol-Tcp

Configuration​

Host​

  1. Log into Centreon and add a new host through Configuration > Hosts.
  2. Fill the Name, Alias & IP Address/DNS fields according to your ressource settings.
  3. Apply the App-Protocol-Tcp-custom template to the host.
MandatoryMacroDescriptionDefault
TCPPACKETLOSSPERCENT50
TCPPACKETS1
TCPPORT80
TCPTIMEOUT3

Service​

Once the template is applied, fill in the corresponding macros. Some macros are mandatory.

MandatoryMacroDescriptionDefault
TIMEOUTConnection timeout in seconds (Default: 3)5
PORTPort used
WARNING
CRITICAL
EXTRAOPTIONSAny extra option you may want to add to the command line (eg. a --verbose flag)

How to check in the CLI that the configuration is OK and what are the main options for?​

Once the plugin is installed, log into your Centreon poller's CLI using the centreon-engine user account (su - centreon-engine) and test the plugin by running the following command:

/usr/lib/centreon/plugins//centreon_protocol_tcp.pl \
--plugin=apps::protocols::tcp::plugin \
--mode=response-time \
--hostname='10.0.0.1' \
--port='80' \
--timeout='' \
--warning-rta='' \
--critical-rta='' \
--warning-rtmax='' \
--critical-rtmax='' \
--warning-rtmin='' \
--critical-rtmin='' \
--warning-pl='' \
--critical-pl='' \

The expected command output is shown below:

OK: TCP '10.0.0.1' port 80 rta 0.633ms, lost 0% | 'tcp.roundtrip.time.average.milliseconds'=0.633ms;;;0; 'tcp.roundtrip.time.maximum.milliseconds'=2.145ms;;;0; 'tcp.roundtrip.time.minimum.milliseconds'=0.193ms;;;0; 'tcp.packets.loss.percentage'=0%;;;0;100

Available modes​

All available modes can be displayed by adding the --list-mode parameter to the command:

/usr/lib/centreon/plugins//centreon_protocol_tcp.pl \
--plugin=apps::protocols::tcp::plugin \
--list-mode

The plugin brings the following modes:

ModeLinked service template
connection-statusApp-Protocol-Tcp-Connection-Status
response-timeApp-Protocol-Tcp-Response-Time

Available options​

OptionDescriptionType
--modeChoose a mode.Global
--dyn-modeSpecify a mode with the path (separated by '::').Global
--list-modeList available modes.Global
--mode-versionCheck minimal version of mode. If not, unknown error.Global
--versionDisplay plugin version.Global
--pass-managerUse a password manager.Global
--verboseDisplay long output.Output
--debugDisplay also debug messages.Output
--filter-perfdataFilter perfdata that match the regexp.Output
--filter-perfdata-advAdvanced perfdata filter. Eg: --filter-perfdata-adv='not (%(value) == 0 and %(max) eq "")'Output
--explode-perfdata-maxPut max perfdata (if it exist) in a specific perfdata (without values: same with '_max' suffix) (Multiple options)Output
--change-perfdata --extend-perfdataChange or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target[,[newuom],[min],[m ax]] Common examples: Change storage free perfdata in used: --change-perfdata=free,used,invert() Change storage free perfdata in used: --change-perfdata=used,free,invert() Scale traffic values automaticaly: --change-perfdata=traffic,,scale(auto) Scale traffic values in Mbps: --change-perfdata=traffic_in,,scale(Mbps),mbps Change traffic values in percent: --change-perfdata=traffic_in,,percent()Output
--extend-perfdata-groupExtend perfdata from multiple perfdatas (methods in target are: min, max, average, sum) Syntax: --extend-perfdata-group=searchlabel,newlabel,target[,[newuom],[m in],[max]] Common examples: Sum wrong packets from all interfaces (with interface need --units-errors=absolute): --extend-perfdata-group=',packets_wrong,sum(packets_(discard |error)_(in|out))' Sum traffic by interface: --extend-perfdata-group='traffic_in_(.*),traffic_$1,sum(traf fic_(in|out)_$1)'Output
--change-short-output --change-long-outputChange short/long output display: --change-short-output=pattern~replace~modifierOutput
--change-exitChange exit code: --change-exit=unknown=criticalOutput
--range-perfdataChange perfdata range thresholds display: 1 = start value equals to '0' is removed, 2 = threshold range is not display.Output
--filter-uomFilter UOM that match the regexp.Output
--opt-exitOptional exit code for an execution error (i.e. wrong option provided, SSH connection refused, timeout, etc) (Default: unknown).Output
--output-ignore-perfdataRemove perfdata from output.Output
--output-ignore-labelRemove label status from output.Output
--output-xmlDisplay output in XML format.Output
--output-jsonDisplay output in JSON format.Output
--output-openmetricsDisplay metrics in OpenMetrics format.Output
--output-fileWrite output in file (can be used with json and xml options)Output
--disco-formatDisplay discovery arguments (if the mode manages it).Output
--disco-showDisplay discovery values (if the mode manages it).Output
--float-precisionSet the float precision for thresholds (Default: 8).Output
--source-encodingSet encoding of monitoring sources (In some case. Default: 'UTF-8').Output

Modes options​

All modes specific options are listed here:

OptionDescriptionType
--hostnameIP Addr/FQDN of the hostMode
--portPort usedMode
--sslUse SSL connection. (no attempt is made to check the certificatevalidity by default).Mode
--timeoutConnection timeout in seconds (Default: 3)Mode
--unknown-statusSet unknown threshold for status. Can used special variables like: %{status}, %{port}, %{error_message}Mode
--warning-statusSet warning threshold for status. Can used special variables like: %{status}, %{port}, %{error_message}Mode
--critical-statusSet critical threshold for status (Default: '%{status} eq "failed"'). Can used special variables like: %{status}, %{port}, %{error_message}Mode
--warning-timeThreshold warning in secondsMode
--critical-timeThreshold critical in secondsMode

All available options for a given mode can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins//centreon_protocol_tcp.pl \
--plugin=apps::protocols::tcp::plugin \
--mode=connection-status \
--help

Troubleshooting​

Please find the troubleshooting documentation for Centreon Plugins typical issues.