Monitor:Docker Monitor
Collect and monitor general performance Metrics of Docker containers.
Pre-monitoring operations
If you want to monitor the container information in Docker, you need to open the port according to the following steps, so that the collection request can obtain the corresponding information.
1. Edit the docker.server file:
vi /usr/lib/systemd/system/docker.service
Find the [Service] node, modify the ExecStart property, and add -H tcp://0.0.0.0:2375
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375
This is equivalent to the 2375 port that is open to the outside world. Of course, it can be modified to other ports according to your own situation.
2. Reload the Docker configuration to take effect:
systemctl daemon-reload
systemctl restart docker
Note: Remember to open the 2375 port number in the server console.
3. If the above method does not work:
Open the 2375 port number inside the server.
firewall-cmd --zone=public --add-port=2375/tcp --permanent
firewall-cmd --reload
Configuration parameters
| Parameter name | Parameter help description |
|---|---|
| Monitor Host | Monitored peer IPV4, IPV6 or domain name. Note ⚠️ without protocol headers (eg: https://, http://). |
| Monitor Name | Identifies the name of this monitor. The name needs to be unique. |
| Port | The port provided by the database externally, the default is 2375. |
| Query Timeout | Set the timeout when getting the Docker server API interface, in ms, the default is 3000 ms. |
| Container Name | Generally monitors all running container information. |
| username | connection username, optional |
| password | connection password, optional |
| URL | Database connection URL, optional, if configured, the parameters such as database name, username and password in the URL will override the parameters configured above |
| Collection Interval | Monitor periodical collection data interval, in seconds, the minimum interval that can be set is 30 seconds |
| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring, and then continue to add and modify operations if the detection is successful |
| Description Remarks | More remarks that identify and describe this monitoring, users can remark information here |