Docker Container Sensor
The sensor monitors basic statistics of the Docker container
The sensor uses Docker Engine REST API to communicate with the container.
Performance Counters:
- % CPU Usage
- % Memory Usage
- Interface bytes IN
- Interface bytes OUT
Statuses:
- State
- Uptime
Default Alerts:
- The container is not running - Alert generated when NetCrunch detects the container is not in the 'running' state.
Monitoring
To monitor the Docker container, you have to enable remote API.
To enable remote API:
-
Open /lib/system/system/docker.service file with any text editor
vi /lib/systemd/system/docker.service -
Find the line which starts with ExecStart and add -H=tcp://0.0.0.0:2375
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -
Save the Modified File
-
Reload the docker daemon
systemctl daemon-reload -
Restart the container
sudo service docker restart -
Open a port on the firewall if necessary.
-
To test that API is accessible, try to run test on the docker sensor, make sure you added that sensor to the proper node (just configured one)
Please note that enabling remote API on a different version of the docker and system where installed may look slightly different.