Monitoring TCP

This article will help you get the Tcp plugin for sd-agent configured and returning metrics

Installing the tcp plugin package

Install the tcp plugin on Debian/Ubuntu:

sudo apt-get install sd-agent-tcp-check

Install the tcp plugin on RHEL/CentOS:

sudo yum install sd-agent-tcp-check

Read more about agent plugins.

Configuring the agent to monitor TCP services

1. Configure /etc/sd-agent/conf.d/tcp_check.yaml


  - name: My first service
    port: 8080
    timeout: 1

    # The (optional) collect_response_time parameter will instruct the
    # check to create a metric 'network.tcp.response_time', tagged with
    # the url, reporting the response time in seconds.
    # collect_response_time: false

  # - name: My second service
  #   host:
  #   port: 80

Configure a name, the host and port and finally a timeout. It's also possible to enable collection of the response time by enabling collect_response_time

2. Restart the agent

sudo /etc/init.d/sd-agent restart


sudo systemctl restart sd-agent

Verifying the configuration
Execute info to verify the configuration with the following:

sudo /etc/init.d/sd-agent info 


/usr/share/python/sd-agent/ info

If the agent has been configured correctly you'll see an output such as:

  - instance #0 [OK]
  - Collected * metrics

You can also view the metrics returned with the following command:

sudo -u sd-agent /usr/share/python/sd-agent/ check tcp_check

Configuring graphs

Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the tcp metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.


Monitored metrics

Metric Values

The response time of a given host and TCP port, tagged with url, e.g. 'url:'.
second / None
Type: float
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.