-
Notifications
You must be signed in to change notification settings - Fork 252
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
check_nrpe -H <<Host>> always return "connection refused" #26
Comments
Do you have https://cyruslab.net/2012/10/24/adding-allowed-list-to-nrpe-cfg/ You'll need to reload the nrpe service after changes to the conf file. |
Yes, I have What might be wrong? |
Can you try running the Nagios docker container with host networking? |
On the client running the nrpe server (192.168.43.110) could you run
Is the host 192.168.43.110 the system that's running the docker container? How is the nrpe daemon running? did you install from a package manager or compile from source? Do you have a firewall configured? can you paste the output of I don't expect that a check_nrpe -H localhost will work from within the container, as the nrpe daemon isn't running within the container unless you've set it to do so. |
Its working now. Thanks. But the postfix mail service inside the container is unable to send any emails. Please let me know if I'm missing something. |
Glad you have this running see issue #28 for the mail - I'll be looking in to this hopefully this week as part of the upgrade to some other parts (nagios plugins) |
Jason, I have gone through this thread. Yeah, please let me know if you can
figure something out over the weekend.
…On 20 Apr 2017 1:25 p.m., "Jason Rivers" ***@***.***> wrote:
Glad you have this running see issue #28
<#28> for the mail -
I'll be looking in to this hopefully this week as part of the upgrade to
some other parts (nagios plugins)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFvqjBXb1l4dLzpAWB93bOUj78M3_3gPks5rxw-FgaJpZM4MUf8m>
.
|
@JasonRivers I'm reopening the issue because I'm still facing this if I run it from within the container. Can you elaborate more on this statement of yours, "I don't expect that a check_nrpe -H localhost will work from within the container, as the nrpe daemon isn't running within the container unless you've set it to do so." ? What needs to be done? Thanks |
NRPE is designed to execute check_ commands on a REMOTE server, as a result NRPE has 2 parts to it, the client (check_nrpe) and the server (nrpe). nrpe (server) listens on port 5666 by default when it's run, and the client talks to this to run commands remotely. The Docker container does not itself run the nrpe server (nagios has access to any checks directly, you don't need to run a remote execution to the local machine that is running nagios). The container only has the client check_nrpe, you would have to run nrpe on the remote system and set -H $HOSTNAME to be the host of the remote server (not localhost). In order to run the NRPE server within the docker container (not recommended) you will need to build it with the following:
This will put a binary in /tmp/nrpe/src/nrpe - you will need to run this and give it a config file (see /tmp/nrpe/sample-config/nrpe.cfg) to run this - This way your "localhost" will work. However As the nagios system already has access to all the check commands on the local system this isn't needed at all, the nrpe server should be run on the remote systems that you wish to monitor. |
@JasonRivers Thanks Jason for the awesome explanation. I was able to make it work. Now, when I'm trying to run a check on a remote host using the NRPE plugin, I run in this error Another point which I must also mention is that the checks work just fine when executed on the remote Host. So the problem boils down to the fact that the user which is trying to run the check using the NRPE plugin does not have proper privileges. Any idea on how I can resolve it in context to this docker container? P.S> - I'm trying to run something like |
Although, the version check with NRPE plugin is working fine
|
I have the nagios server up and running (I have checked it thoroughly) along with the nagios client on my Host <<192.168.43.110>>. I have also tried to ping the container's locahost
And I get the same problem again
Also, the web interface of Nagios Core shows perfectly the two hosts (192.168.43.110 and localhost), but I am unable to check with the check_nrpe command.
I believe this is something specific to this container which is causing the problem. Any ideas?
The text was updated successfully, but these errors were encountered: