Docker over nrpe not working remotely

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pkeller
Posts: 1
Joined: Thu Feb 21, 2019 3:14 pm

Docker over nrpe not working remotely

Post by pkeller »

Hello :)

I'm trying to monitor some containers with a docker plugin, but I'm having no luck to run the command remotely, they only work locally. I have tested several plugins but I suspect the same issue whatever it is, is affecting all of them.
It's important to say that all other checks work perfectly (such as check_disk, check_cpu, etc), so the problem seems to be something particular with the docker plugins.

I took steps such as adding the nrpe user (and the nagios user aswell just in case) to the docker group on the host, and I also added those users to the sudoers file so they could run all commands without password. But all of this changes only allowed me to run the plugins locally (with or without sudo).

When I run the command remotely with sudo, I get the following error:

NRPE: Unable to read output

I'm convinced it is a permission issue but I just can't figure out where.

When I run the command remotely without sudo, depending on the plugin, I get some errors:

UNKNOWN - Unable to talk to the docker daemon (https://gist.github.com/ekristen/11254304)

('Connection aborted.', PermissionError(13, 'Permission denied')) (https://github.com/elacheche/docker_check)

NRPE: Unable to read output (https://exchange.nagios.org/directory/P ... er/details)


Any ideas? I'll keep looking.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Docker over nrpe not working remotely

Post by ssax »

SSH into the remote machine and run it this way:

su - nagios
sudo /path/to/your/plugin -with -args <- This should match the line in your nrpe.cfg
echo $?

Please link us to the exact docker plugin you are talking about.
Locked