UNKNOWN: cURL call failed' - Docker monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
amane
Posts: 77
Joined: Thu Jan 18, 2018 9:53 am

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by amane »

Hi lmiltchev,

10.23.201.85 is the docker ip address.

Now the status is showing ok (No values) for CPU, Memory usage and running count isin critical state with 0 running.


Docker Container: CPU Usage: Store-order-svc Ok 7d 13h 2m 9s 1/5 2019-12-10 06:57:02 OK:
Docker Container: Memory Usage: Store-order-svc Ok 4d 13h 32m 40s 1/5 2019-12-10 06:55:40 OK:
Docker Container: Running Count: Store-order-svc Critical 24d 20h 51m 45s 5/5 2019-12-10 06:57:48 CRITICAL: 0 running, 1 not running, containers not running: ['/store-order-svc']

Thanks & Regards,
amane
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by lmiltchev »

Try running something like this from the command line on the Nagios XI server:

Code: Select all

/usr/local/nagios/libexec/check_docker.py -H http://10.23.201.85:1111/ --check-type 'containers_running' -C ''/store-order-svc' -t 0 -l -w '2:' -c '1:'
or this

Code: Select all

/usr/local/nagios/libexec/check_docker.py -H http://10.23.201.85:1111/ --check-type 'containers_running' --all -t 0 -l -w '2:' -c '1:'
You should get a "CRITICAL" state, since your container is not running.
Now the status is showing ok (No values) for CPU, Memory usage and running count isin critical state with 0 running.
I will talk to our developers about this, but I would assume that the state is set to "OK" since the containers are NOT running, and CPU & Memory values cannot be determined. Start your container, then run your CPU & Memory checks. You should get some values back now.

Did this help?
Be sure to check out our Knowledgebase for helpful articles and solutions!
amane
Posts: 77
Joined: Thu Jan 18, 2018 9:53 am

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by amane »

Hi lmiltchev,

Below is the output for given command.

[nagios@<NagiosXI> libexec]$ ./check_docker.py -H http://10.23.201.85:1111/ --check-type 'containers_running' --all -t 0 -l -w '2:' -c '1:'
WARNING: 1 running | count=1;2:;1:

Below is the statue in Console for same docker
'Docker Container: Running Count: Store-order-svc Critical 25d 23h 10m 38s 5/5 2019-12-11 09:16:03 CRITICAL: 0 running, 1 not running, containers not running: ['/store-order-svc']'


Thanks & Regards,
amane
swolf

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by swolf »

I'm not sure why the plugin would show different values from your console. Can you show output for these two commands?

Code: Select all

curl  'http://10.23.201.85:1111/containers/json?&all=true' -g -f
./check_docker.py -H http://10.23.201.85:1111/ --check-type 'containers_running' --all -t 0 -l -w '2:' -c '1:' --debug
amane
Posts: 77
Joined: Thu Jan 18, 2018 9:53 am

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by amane »

Hi swolf,

Please find below output for given command.

[nagios@<nagiosXI> ~]$ curl 'http://10.23.201.85:1111/containers/json?&all=true' -g -f
[{"Id":"afe5db67b697cffbfa418301046909bb8e5930edf2be7d90b3f133b008ac66be","Names":["/store-order-svc"],"Image":"wsvmlnnep01.ec.lowes.com:8800/docker-hosted/store-order-svc:v10-release-1.1.4","ImageID":"sha256:2b9ef8a2924296b4b690a6e9b0a64a518d474006e5c79fae793b277e15946823","Command":"java -jar /app/order-service.jar","Created":1576232098,"Ports":[{"IP":"127.0.0.1","PrivatePort":10001,"PublicPort":10001,"Type":"tcp"}],"Labels":{},"State":"running","Status":"Up 3 days","HostConfig":{"NetworkMode":"container-network"},"NetworkSettings":{"Networks":{"container-network":{"IPAMConfig":null,"Links":null,"Aliases":null,"NetworkID":"96bb406d447beb79585f5db4d1710ef9341edd019afc0238eb082bdf0ca80ed5","EndpointID":"e6f4a9e8f2e197dcadb0ecd3f19c87a369dd4372f47f7b25a2cdea0f1ffc9671","Gateway":"192.168.100.1","IPAddress":"192.168.100.2","IPPrefixLen":24,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:c0:a8:64:02","DriverOpts":null}}},"Mounts":[]}]


[nagios@<NagiosXI> libexec]$ ./check_docker.py -H http://10.23.201.85:1111/ --check-type 'containers_running' --all -t 0 -l -w '2:' -c '1:' --debug
all
['all']
End selection + type
Traceback (most recent call last):
File "./check_docker.py", line 988, in <module>
_ = main()
File "./check_docker.py", line 959, in main
checks = choose_checks(options)
File "./check_docker.py", line 226, in choose_checks
check_data = get_threshold_maps(options.warning, options.critical, selection)
File "./check_docker.py", line 329, in get_threshold_maps
for triplet in zip(attrs.keys(), warning_list, critical_list):
AttributeError: 'list' object has no attribute 'keys'

Getting the output for second command in other nagios instance.

[nagios@nagiosXI2 libexec]$ ./check_docker.py -H http://10.23.201.85:1111/ --check-type 'containers_running' --all -t 0 -l -w '2:' -c '1:' --debug
[]
[]
End containers + networks
hit get_thresholds
hit threshold_string_to_tuple
hit threshold_string_to_tuple
hit get_all_container_IDs
hit talk_to_docker
curl 'http://10.23.201.85:1111/containers/json?&all=1' -g -f
hit do_check
hit check_containers_running
hit talk_to_docker
curl 'http://10.23.201.85:1111/containers/jso ... ning%22%5D}' -g -f
hit process_value
hit process_counter
hit make_perfdata
hit check_all_values_against_thresholds
hit check_against_thresholds
hit check_against_threshold
hit check_against_threshold
hit nagios_exit
WARNING: 1 running | count=1;2:;1:

Thanks & Regards,
amane
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by ssax »

Are both versions of check_docker.py the same? Please validate.

Code: Select all

diff file1 file2
Which version are you using?

Code: Select all

grep VERSION /usr/local/nagios/libexec/check_docker.py
Does this one work on the non-working system?
- Let me know if you're unable to view this post

https://support.nagios.com/forum/viewto ... 32#p284532

Thank you!
amane
Posts: 77
Joined: Thu Jan 18, 2018 9:53 am

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by amane »

Hi Ssax,

Tried this https://support.nagios.com/forum/viewto ... 32#p284532
Still same issue.

Tried comparing version of check_docker.py on two of our nagios instances.

[nagios@lxapxxxxx ~]$ grep VERSION /usr/local/nagios/libexec/check_docker.py
__VERSION__ = "1.1.0"
version = '%s, Version %s. See --help for more info.' % (__PLUGIN_NAME__, __VERSION__)
[nagios@lxapxxxx ~]$ timed out waiting for input: auto-logout


[nagios@lxapxxxx ~]$ grep VERSION /usr/local/nagios/libexec/check_docker.py
__VERSION__ = "1.0.4" version = '%s, Version %s. See --help for more info.' % (__PLUGIN_NAME__, __VERSION__)
[nagios@lxapxxxx ~]$ timed out waiting for input: auto-logout

Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: UNKNOWN: cURL call failed' - Docker monitoring

Post by lmiltchev »

The latest version of the check_docker.py plugin is 1.1.1. You can download it from the "Configuration Wizard: Docker - Step 1" page in Nagios XI. Try using the latest plugin to see if this is going to fix your issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked