Docker Remote API

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ragarwal
Posts: 2
Joined: Tue Oct 09, 2018 1:17 pm

Docker Remote API

Post by ragarwal »

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
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Docker Remote API

Post by cdienger »

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
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

Post by scottwilkerson »

You can do much of this with NCPA and the Docker Wizard built into the current version of Nagios XI
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ragarwal
Posts: 2
Joined: Tue Oct 09, 2018 1:17 pm

Re: Docker Remote API

Post by ragarwal »

scottwilkerson wrote:You can do much of this with NCPA and the Docker Wizard built into the current version of Nagios XI
Hi Scott,

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

Post by scottwilkerson »

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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked