Internal documentation only
This page has been marked as draft.
Docker Monitoring – LWP.pm and Docker API Issues
Purpose Copied
This covers common issues encountered when configuring Docker monitoring in Opsview, specifically errors related to the missing Perl module LWP.pm and connectivity problems with the Docker Remote API, particularly when the configured TCP port (e.g., 4245) is unavailable, not listening.
Problem Copied
You may encounter the following error when running the check_docker plugin:
Can't locate LWP.pm in @INC (you may need to install the LWP module)
BEGIN failed--compilation aborted at check_docker line 15
After installing the Perl module, the check may still fail with:
Docker UNKNOWN - Error returned from Docker API:
500 Can't connect to 127.0.0.1:4245 (Connection refused)
Possible cause(s) Copied
The check_docker plugin relies on the Perl LWP module to communicate with the Docker API. This module is not included by default in the Opsview or Infrastructure Agent installation.
Installing LWP.pm on the Opsview master or collector does not resolve the issue if the plugin runs on the monitored host.
- Docker Remote API may not be Enable
- Not Listening on the Configured Port (e.g., Port 4245)
- Not accessible due to firewall restrictions
Solution(s) Copied
Step 1:
Identify Where the Plugin Runs
For agent-based Docker checks, check_docker runs on the monitored Docker host where the Infrastructure Agent is installed.
Ensure all actions below are performed on that host.
Step 2:
Install the required Perl module using CPAN:
perl -MCPAN -e 'install "LWP::Simple"'
Repeat this step on every Docker host monitored using check_docker.
Step 3:
Confirm Docker is listening on configured port (e.g., Port 4245):
sudo netstat -tuln | grep 4245
Expected output should show Docker listening on the configured IP and port.