Monitoring TP-Link Switch with Percona Monitoring and ManagementI have a local Percona Monitoring and Management (PMM) instance at home, which I use to look after my local databases. With the release of PMM 2.14 and its support for monitoring of external “serverless” stuff, I decided to check if I can get some insights into my local networking.

I have a TP-Link TL-SG108PE switch which has some basic management functions, and it provides basic port statistics:

TP-LINK port statistics

The first thing to do is to see if an Exporter is already available. The wonderful thing about the Prometheus ecosystem is that these days you can find exporters for almost everything! Googling for “tp-link switch-exporter” pointed me to this github project.

Two minutes later, we have an exporter running:

(I modified the command line from the docs slightly to daemonize the docker container instead of running it interactively.)

We can now go to http://10.11.13.140:9717/metrics  to see if metrics are collected.

Note that the host where the exporter is running is different from the host (switch) being monitored.

The next step is to connect this exporter to Percona Monitoring and Management. We do it by running the following command:

Note that this command does NOT need to be run on the same host that runs the exporter, and in my case, it did not. In the future, I hope we can add functionality so PMM Server can be used to configure external exporters, and the need to involve such intermediary hosts is avoided altogether.

Now let’s check if the data is being received by PMM. To do that we can use Explore mode and enter one of the metrics which is unique for this exporter:

PMM Explore mode

All right, we have some data coming in.

Finally, let’s see if we can get this data visualized on the dashboard. The exporter´s Github project provides a link to a Grafana dashboard. Some imported dashboards would work directly, while others, at least, can serve as a baseline to be customized.

To add a dashboard to PMM we will use the Dashboard Import functionality and just enter the ID of the dashboard you’re looking to import.

PMM Dashboard Import functionality

Here we go – this dashboard works beautifully without any need for customization.

Summing Things Up

You can monitor almost anything with Percona Monitoring and Management. To add some entity monitoring to PMM, you would usually:

  • Find an exporter for the thing you’re trying to monitor, or create one if it does not exist.
  • Register the exporter with PMM.
  • Find and import a dashboard from Grafana Dashboards or create one if there isn’t one that matches your needs.

Percona Monitoring and Management is free to download and use. Try it today!