Hi Team,
I am trying to monitor containers on my OpenShift platform. For some reason, below curl command does not works from my nagios VM to the OpenShift VMs:
curl -f -g http://ip:port/containers/json?all=true
If I try to run below curl command locally from the OpenShift node, I get all details:
curl --unix-socket /var/run/docker.sock http:/containers/json
Please let me know how to fix this issue as after adding this to nagios, I'm getting "UNKNOWN: cURL call failed" under status.
Thanks,
Rahul Agarwal
Docker Remote API
Re: Docker Remote API
Try running the following:
curl -v -g http://ip:port/containers/json?all=true
The -f option tells the command to fail silently and -v will give us verbose output
curl -v -g http://ip:port/containers/json?all=true
The -f option tells the command to fail silently and -v will give us verbose output
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Docker Remote API
You can do much of this with NCPA and the Docker Wizard built into the current version of Nagios XI
Re: Docker Remote API
Hi Scott,scottwilkerson wrote:You can do much of this with NCPA and the Docker Wizard built into the current version of Nagios XI
Thanks for the update. I tried NCPA but there is a field "Docker API Base URL" which is sort of confusing to me. As I said in my previous post, curl command "curl --unix-socket /var/run/docker.sock http:/containers/json" works from the node itself but in order for nagios to get those json updates, its trying to run "curl -f -g http://ip:port/containers/json?all=true" which fails with no route to the host.
Thanks,
Rahul
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Docker Remote API
I'm not exactly sure if this works with Openshift, but in the Wizard there is a field "Docker API Base URL:" which you can use the single slash format, e.g.
Code: Select all
http:/containers/json