Page 1 of 1

Monitoring Linux without NSClient++ running

Posted: Wed May 24, 2017 2:31 pm
by SavaSC
Hello,

I'm working on building a new Nagios box running on CentOS7 (coming off of CentOS5). I've got the new box most of the way up. But can't seem to get the Linux boxes to communicate with the new box. The old box works just fine. I backed up and then restored from the old box so the setting should all be the same.

There are a couple of oddities that are making things worse for me. First, it looks like the person who built the image we use for deploying Linux servers didn't install NSClient++ in the default directories. (For example, the nrpe.cfg file is in /usr/local/nagios/etc.) Second, the nrpe.cfg file only has 127.0.0.1 listed under allowed_hosts. Third, the nrpe service is not running or even pretending to. When I run "/sbin/service nrpe status" I get back "service: no such service nrpe".

I am completely flummoxed. How can one instance of Nagios work just fine and the other not work at all?

Any suggestions on where I can start looking?

Thanks!

Re: Monitoring Linux without NSClient++ running

Posted: Wed May 24, 2017 2:47 pm
by dwhitfield
Is there a reason you are using NSClient on Linux? I've known it was possible, but never actually heard of someone doing that.'

I suspect you missed page 6 of https://assets.nagios.com/downloads/nag ... ios-XI.pdf

What's the output of uname -a on both systems?

Re: Monitoring Linux without NSClient++ running

Posted: Wed May 24, 2017 4:04 pm
by SteveBeauchemin
Look in /etc/xinetd.d/ for the nrpe file. If you find it there then nrpe is running as part of xinetd and not as a stand alone daemon.
If it is there, then you need to modify the only_from line and have the Nagios Server IP listed. If you modify the file, you should restart the xinetd.

Code: Select all

systemctl restart xinetd
My nrpe.cfg file is in /usr/local/nagios/etc too.

Another thing that could prevent IP communication is the firewall. If you turn it off, and communication works, then you'll need to either leave it off, or configure it properly. Try running

Code: Select all

systemctl stop firewalld
and see if that makes a difference.

When I moved from Red Hat 6 to 7, I had to learn pretty fast about systemctl. If you need to find the systemctl configuration files, look in /usr/lib/systemd/system. If you plan to change a file, copy it from there to /etc/systemd/system and edit/change it in the /etc location. Whenever you do change one of those files, you have to tell the OS that you made a change. Do that by running

Code: Select all

systemctl daemon-reload
On Linux we run nrpe, on the MS systems NSClient++ is the agent. I'm sure you actually meant nrpe right?
Get yourself ready to learn a lot.

Good Luck.

Steve B

Re: Monitoring Linux without NSClient++ running

Posted: Wed May 24, 2017 4:07 pm
by dwhitfield
Thanks Steve!

@SavaSC, did you have any other questions?

Re: Monitoring Linux without NSClient++ running

Posted: Thu May 25, 2017 12:28 pm
by SavaSC
SteveBeauchemin wrote:Look in /etc/xinetd.d/ for the nrpe file. If you find it there then nrpe is running as part of xinetd and not as a stand alone daemon.
If it is there, then you need to modify the only_from line and have the Nagios Server IP listed. If you modify the file, you should restart the xinetd.

Code: Select all

systemctl restart xinetd
Steve,

Thanks! This cleared it up! (Although, I had to bounce the Linux server in order to get it to restart the xinetd service. Not sure why just yet.)

Re: Monitoring Linux without NSClient++ running

Posted: Thu May 25, 2017 12:37 pm
by dwhitfield
SavaSC wrote:(Although, I had to bounce the Linux server in order to get it to restart the xinetd service. Not sure why just yet.)
Hard to say without logs, but did you use killall? I realize that's not restarting in the general sense of the word, but it might have kept you from rebooting the entire system.

Re: Monitoring Linux without NSClient++ running

Posted: Thu May 25, 2017 3:18 pm
by SavaSC
dwhitfield wrote:
SavaSC wrote:(Although, I had to bounce the Linux server in order to get it to restart the xinetd service. Not sure why just yet.)
Hard to say without logs, but did you use killall? I realize that's not restarting in the general sense of the word, but it might have kept you from rebooting the entire system.
Bingo! That's what I needed. Thanks, again, Steve!

Re: Monitoring Linux without NSClient++ running

Posted: Thu May 25, 2017 3:21 pm
by dwhitfield
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!

Re: Monitoring Linux without NSClient++ running

Posted: Fri May 26, 2017 7:44 am
by SavaSC
Yes, I have what I need.

Thanks so much for y'all's help!