-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problems running custom plugins (check_nrpe) #15
Comments
Hi @tr1plus , In our image the # Sets $USER1$ to be the path to the plugins
$USER1$=/opt/nagios/libexec Nagios is installed in $USER1$=/usr/local/nagios/libexec Can you please check if this configuration change fixes your issue? |
I'm sorry, that was copied over from my old set-up. On the docker image I didn't make any change and I can confirm it is indeed As mentioned I think nagios/the docker can indeed see and find the plugin. If I make some changes to the authorization of the check_nrpe plugin I get a different error: If I remove the executable (CHMOD 644) I see the following in Nagios dashboard If I make it exacutable again (CHMOD 755) I get the mentioned error: My feeling is that for whatever reason the docker is unable to successfully get the "reply" from running the command.
|
Hi @tr1plus , I have a suspicion. You use I have tested other external plugins such as mzupan/nagios-plugin-mongodb as a subdirectory mounted in If you continue to have problems, can you please provide me with steps to reproduce it? I will need:
Thank you , |
oh my oh my. You are totally right! It was indeed compiled on the raspberry pi itself, and not on alpine linux. My bad! Changing everything to the already available plugin seems to be working and everything is reporting green once again! I assume this docker contains all the same 'custom' plugins as JasonRivers/Docker-Nagios? I didn't realize this... Thank you sooo much for helping on this one :) This saved me a lot of hair pulling and time! P.S. one small question, do python plugins work out of the box? I see you referencing the mongodb one and it is python. Anything special I need to do? |
Hi @tr1plus ! Thanks for testing this in such a short notice! As far as the image is concerned, it is inspired by JasonRivers/Docker-Nagios but follows a different approach targeted to a very lightweight size and basic features. That said, I tried to make a small, yet operational base image which contains:
To use Python plugins you can either install Python inside the container, or create a custom Dockerfile with I hope that it helps, |
That clears up a whole lot! it would be nice if you would put that in the read-me file, but otherwise I am really enjoying this container. Time to start monitoring my home set-up again with all the bells & whistles ;) Many thanks once more! |
Hey
I decided to switch from a dedicated machine running nagios to a docker.
docker is running fine and I'm able to connect to the dashboard. All "standard" plugins (check_ping, ...) are also running fine.
I do have a few 'custom' plugins (check_nrpe, ...) that I used to run. However I keep getting the following error when running them via the nagios dashboard
Running the command manually via ssh on the host returns correct results, so the plugin does work. It seems a 'translation' from the host to the docker is preventing some things from running correctly.
NOTE: this set-up used to work outside of docker, so I'm assuming it's related to authorizations or something like that, but even setting chmod 777 doesn't seem to work...
commands.cfg
define command{ command_name check_nrpe command_line $USER1$/custom/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ }
resource.cfg
$USER1$=/usr/local/nagios/libexec
calling the plugin
define service{ use generic-service ; Name of service template to use host_name dockerpi service_description Current Users check_command check_nrpe!check_users }
plugin file stats
pi@dockerpi2:~/docker/containers/nagios/libexec/custom $ stat check_nrpe File: check_nrpe Size: 102112 Blocks: 200 IO Block: 4096 regular file Device: b302h/45826d Inode: 129480 Links: 1 Access: (0755/-rwxr-xr-x) Uid: ( 100/systemd-timesync) Gid: ( 101/systemd-journal) Access: 2020-01-05 17:22:49.000000000 +0100 Modify: 2017-10-29 16:56:32.000000000 +0100 Change: 2020-01-05 17:37:03.604777318 +0100 Birth: -
Docker is set to bind
/home/pi/docker/containers/nagios/libexec/custom --> /opt/nagios/libexec/custom
The text was updated successfully, but these errors were encountered: