Page 1 of 2

How to monitor Docker containers with Nagios

Posted: Sun Dec 18, 2016 10:34 am
by naveen46
I need help in Monitoring Docker containers with Nagios.

Re: How to monitor Docker containers with Nagios

Posted: Mon Dec 19, 2016 10:17 am
by dwhitfield
You'll want to check out https://exchange.nagios.com/directory/P ... er/details if you haven't already.

To help us help you: What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use. Also, please give us as much info as you can about what you are trying to monitor in docker...like, what applications and metrics? Thanks!

Re: How to monitor Docker containers with Nagios

Posted: Mon Dec 19, 2016 10:36 am
by naveen46
I am using CentOS release 6.6 (Final) OS, Nagios core Version is 4.2.0.

Re: How to monitor Docker containers with Nagios

Posted: Mon Dec 19, 2016 11:19 am
by dwhitfield
You neglected to give us any information about what you are trying to monitor in docker. If you are running enough of the OS in docker, you should be able to monitor them just like any other OS, but we will need more information if we are going to be more specific.

Did you look at the plugin I suggested?

Also, I will note that 4.2.4 fixes a serious security hole, so you might want to look at upgrading: https://assets.nagios.com/downloads/nag ... ading.html

Re: How to monitor Docker containers with Nagios

Posted: Tue Dec 20, 2016 2:56 pm
by naveen46
Yes, I tried to use that plugin getting error like NRPE: Unable to read output.

NRPE 3.0, Nagios-plugins -2.1.4

Re: How to monitor Docker containers with Nagios

Posted: Tue Dec 20, 2016 4:11 pm
by avandemore
We have a NRPE troubleshooting document: https://assets.nagios.com/downloads/nag ... utions.pdf

It says it's for XI, but it's applicable to Core as well.

Re: How to monitor Docker containers with Nagios

Posted: Tue Dec 20, 2016 4:12 pm
by dwhitfield
In addition to the trouble-shooting document, are you running NRPE through xinetd or stand-alone? If the second, did you allow it through the firewall? Did you add the server's IP into your allowed_from in your nrpe.cfg?

Also, can you upload as a file your /usr/local/nagios/var/objects.cache? Thanks!

Re: How to monitor Docker containers with Nagios

Posted: Tue Dec 20, 2016 4:40 pm
by naveen46
running through xinetd service, Yes I've added server's IP into nrpe.cfg file.

Re: How to monitor Docker containers with Nagios

Posted: Tue Dec 20, 2016 4:44 pm
by mcapra
If NRPE is running under xinetd, you will need to alter a different file to whitelist the Nagios XI machine. The file you want to be altering is usually located at /etc/xinetd.d/nrpe. Specifically, the only_from directive. You will also need to restart the xinetd service after changing this file.

Re: How to monitor Docker containers with Nagios

Posted: Tue Dec 20, 2016 4:57 pm
by naveen46
there is no NRPE file in /etc/xinetd.d/ location