JasonRivers / Docker-Nagios

Docker image for Nagios
MIT License
232 stars 254 forks source link

NRPE plugin not installed in the container? #143

Open Sweeper5 opened 2 years ago

Sweeper5 commented 2 years ago

Either I must be going crazy, but as I finally managed to tweak and get the container on the road and running, at the same time I built a VM under Debian to actually figure out how to repair this container. In any case, I tried a check_nrpe command and I got the snarky message from Nagios regarding unknown plugin and that had me wondering.

So I poked around in the container and I can't see it trying to run the NRPE daemon at all, nor can I find the nrpe.cfg file. Since the documentation is rather laxing, I am wondering if it is at all installed in the container?

Also when you specify the volume for custom plugins, is that supposed to be a totally empty directory or should I find something in it?

JasonRivers commented 2 years ago

check_nrpe is located in /opt/nagios/libexec /check_nrpe - this where all the standard plugins are stored in the container.

The default configuration creates a resource.cfg to include /opt/nagios/libexec as $USER1$

the NRPE daemon is not required in the container as this allows you to execute checks on the system from a remote nagios, as Nagios is local to the container those commands can be called directly anyway. The daemon should be running on remote systems to be called by check_nrpe (which is also where the nrpe.cfg would be).

You've said you had to "repair the container" could you clarify what it is you had to do to "repair" it?

Hopefully this helps.

Sweeper5 commented 2 years ago

The same ongoing issue I found a while back and that seems to have followed you since 2019 with this container. Upon first launch I was left with a blank nagiosgraph /etc and /var folder that refused to populate themselves, so I fired up a blank container on a different host and sftp'd the files over, this got the graphing working as a module. However, the last issue I noticed was that it wasn't writing the performance data in the log, or it would write, but it would always overwrite it, and often before the graphing managed to grab the data. So I had to change the file attribute to only allow appending to the file, and then I got the graphs working fully.

I also had to do this with the /etc directory for the nagios, however this was with the previous version of your container before you updated it to the currently latest version of Nagios.

But if it is supposed to work over nrpe without the daemon running in the container, I will have to determine why it bailed and claimed check_nrpe wasn't defined anywhere when I attempted to just dry fire the nrpe on its own, which I expected to be defined.