Code Monkey home page Code Monkey logo

Comments (11)

srstsavage avatar srstsavage commented on July 20, 2024

Do you have allowed_hosts set in nrpe's config (try /etc/nagios/nrpe_local.cfg or /usr/local/nagios/etc/nrpe.cfg on the server you're trying to monitor (192.168.43.110)?

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.

from docker-nagios.

aryak007 avatar aryak007 commented on July 20, 2024

Yes, I have allowed_hosts set and I have restarted the nrpe service using brew after making the changes
brew restart nrpe.
Also, I must again mention that I'm able to view my hosts' details (both localhost and this host) through the Nagios core web interface. Similarly, localhost also doesn't work which seems pretty strange since all its settings came along with the container.

What might be wrong?

from docker-nagios.

srstsavage avatar srstsavage commented on July 20, 2024

Can you try running the Nagios docker container with host networking? docker run ... --net host ...

from docker-nagios.

JasonRivers avatar JasonRivers commented on July 20, 2024

On the client running the nrpe server (192.168.43.110) could you run netstat -l -v | grep 5666

$ netstat -l -n  | grep 5666
tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN     

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 iptables -L?

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.

from docker-nagios.

aryak007 avatar aryak007 commented on July 20, 2024

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.

from docker-nagios.

JasonRivers avatar JasonRivers commented on July 20, 2024

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)

from docker-nagios.

aryak007 avatar aryak007 commented on July 20, 2024

from docker-nagios.

aryak007 avatar aryak007 commented on July 20, 2024

@JasonRivers I'm reopening the issue because I'm still facing this if I run it from within the container.

image

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

from docker-nagios.

JasonRivers avatar JasonRivers commented on July 20, 2024

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:

cd /tmp/nrpe
make nrpe

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.

from docker-nagios.

aryak007 avatar aryak007 commented on July 20, 2024

@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 NRPE: Unable to read output .I googled it and I found that the nagios user might not have a permission to execute the script.

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 ./check_nrpe -H 10.208.151.23 -c check_users -w 5 -c 10
Thanks

from docker-nagios.

aryak007 avatar aryak007 commented on July 20, 2024

Although, the version check with NRPE plugin is working fine

./check_nrpe -H 10.208.151.23 and it returns NRPE v2.15.

from docker-nagios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.