Monitoring Docker Container

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Monitoring Docker Container

Post by CloudOps »

Hi,

We need help in configuring docker container using check_docker.py (https://exchange.nagios.org/directory/P ... er/details).

Can anyone help in configuring the plugin with example, as we are not able to do so.

Thanks,
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Monitoring Docker Container

Post by bwallace »

We'll certainly assist but keep in mind that at some point you may need to contact the plugins' author for support if it pertains to coding or the like. Reason being, these plugins are not maintained nor were they written by Nagios.
Now with that disclaimer out of the way, at what specific step are you having problems?
What, if any error messages are you seeing?
If you have tried to test the plugin via command line, what were the results?
If applicable, please post text or screenshots relevant to the above questions.
Be sure to check out the Knowledgebase for helpful articles and solutions!
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Re: Monitoring Docker Container

Post by CloudOps »

bwallace wrote:We'll certainly assist but keep in mind that at some point you may need to contact the plugins' author for support if it pertains to coding or the like. Reason being, these plugins are not maintained nor were they written by Nagios.
Now with that disclaimer out of the way, at what specific step are you having problems?
What, if any error messages are you seeing?
If you have tried to test the plugin via command line, what were the results?
If applicable, please post text or screenshots relevant to the above questions.
Hi,

This is the error i am getting :

"[root@vm-nagiosxi-prod libexec]# ./check_docker.py --connection 172.26.4.46 --memory 85:90
Traceback (most recent call last):
File "/usr/local/lib/python3.5/urllib/request.py", line 1240, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/local/lib/python3.5/http/client.py", line 1083, in request
self._send_request(method, url, body, headers)
File "/usr/local/lib/python3.5/http/client.py", line 1128, in _send_request
self.endheaders(body)
File "/usr/local/lib/python3.5/http/client.py", line 1079, in endheaders
self._send_output(message_body)
File "/usr/local/lib/python3.5/http/client.py", line 911, in _send_output
self.send(msg)
File "/usr/local/lib/python3.5/http/client.py", line 854, in send
self.connect()
File "/usr/local/lib/python3.5/http/client.py", line 826, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/local/lib/python3.5/socket.py", line 707, in create_connection
raise err
File "/usr/local/lib/python3.5/socket.py", line 698, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./check_docker.py", line 469, in <module>
raise e
File "./check_docker.py", line 441, in <module>
containers = get_containers(args.containers)
File "./check_docker.py", line 201, in get_containers
containers_list = get_url(daemon + '/containers/json?all=1')
File "./check_docker.py", line 158, in get_url
response = better_urllib_get.open(url, timeout=timeout)
File "/usr/local/lib/python3.5/urllib/request.py", line 465, in open
response = self._open(req, data)
File "/usr/local/lib/python3.5/urllib/request.py", line 483, in _open
'_open', req)
File "/usr/local/lib/python3.5/urllib/request.py", line 443, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.5/urllib/request.py", line 1268, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/local/lib/python3.5/urllib/request.py", line 1242, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
"


Can you tell me with example how we can pass the argument.

Thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitoring Docker Container

Post by mcapra »

It looks as though the connection was refused. Since we didn't develop this plugin, it's hard to offer specific insights into it.

Are you certain the machine you're running the check from is using Python 3? Can you share the outputs of:

Code: Select all

python -V
/usr/local/nagios/libexec/check_docker.py
Former Nagios employee
https://www.mcapra.com/
Locked