Page 8 of 9

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 2:50 pm
by abrist
A.Cormack wrote:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Rebooted the server, but Nagios still says the same
You restarted the nrpe daemon on the remote host, correct?
What happens when you run the following from the cli on the nagios XI server?

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H 192.168.19.141 -c check_disk -a '-w 20% -c 10% -p /'
I was unware that you had to install a plug-in for a service in which Nagios offers you during the configuration wizard.
This is mostly due to your installation method, as source and repo installs may not include all the plugins used by the linux nrpe wizard in XI (which uses the linux-nrpe-agent tarball but does not support all linux distros). That was actually the primary purpose of the ubuntu ppa, but it looks like you were having problems with that. You could always just grab the few non standard plugins you want to use with the linux agent wizard by extracting them out of the linux-nrpe-agent tarball.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 2:56 pm
by A.Cormack
Yeah I restarted Xinetd and then stopped/started NRPE

Output after that command

Code: Select all

DISK CRITICAL = 20% is not accessible: No such file or directory

and ah ok. I'll try get the basics done before moving on to that. Thanks

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:20 pm
by abrist
By restarting xinetd and nrpe, you most likely now have 2 nrpe services running. So lets kill all instances of nrpe, and delete the /etc/init.d/nrpe init script so that does not get loaded again. And then from now on, only restart nrpe through xinetd.

Code: Select all

ps -aef | grep nrpe
You will most likely see 2 of them running now.
Lets stop them:

Code: Select all

/etc/init.d/nrpe stop
/etc/init.d/xinetd stop
ps -aef | grep nrpe
They should all be gone now, if not, kill them with -9 fire:

Code: Select all

kill -9 nrpe
Now delete the /etc/init.d/nrpe file

Code: Select all

rm /etc/init.d/nrpe
Now restart xinetd:

Code: Select all

/etc/init.d/xinetd start

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:28 pm
by A.Cormack
I'm really not making this easy for you am i? Sorry... lol

Ok so when I did the PS command originally I had

Code: Select all

nagios 763 1 0 11:34 ?     00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
1000 2073 994 0 12:22 tty1   00:00:00 grep --color=auto nrpe
Then I did

Code: Select all

cd /etc/init.d
sudo nrpe stop
sudo xinetd stop
after doing the PS command I still had

Code: Select all

nagios 763 1 0 11:34 ?     00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
1000 2073 994 0 12:22 tty1   00:00:00 grep --color=auto nrpe
I did the kill command and got

Code: Select all

kill: failed to parse argument: 'nrpe'
After trying to delete the file, it says the NRPE directory did not exsist. So I did LS and the only one that slightly resembeled it was nagios-nrpe-server, should I delete that instead?

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:35 pm
by abrist
hmmmm. We need to full stop here. You should consider either rolling back to before nrpe was installed, or you need to clean up the conflicting installations. nagios-nrpe-server is the init script installed from the debian(ubuntu) package. So that would be the one to remove, though you may be better off uninstalling the nrpe package through apt:

Code: Select all

sudo apt-get remove nagios-nrpe-server

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:38 pm
by A.Cormack
It feels like I haven't got the knowledge in order to complete this set-up, even with your remote help. What would you suggest? because I can't keep bothering you day after day.

I could try the PPA again? Or I may just have to edit my project and try and different server but apart from Windows and Ubuntu, I can't see any other that would be easier to configure.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:41 pm
by abrist
CentOS 6 is very easy (for a remote host) as our linux-nrpe-agent works out of the box with it. My suggestion would be to start fresh with the ubuntu ppa or try centos on the monitored host.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:44 pm
by A.Cormack
I'll take your advise and try PPA with Ubuntu first and then if that fails I'll try CentOS6. The reason I went for ubuntu is because I just felt it was more widley used in business rather than other options (excluding windows).

Not to be cheeky, but Is it ok If I still ask for help regarding the PPA installation? As no doubt I'll get into trouble and if so do you want me to keep posting here? Or should I PM you in order to stop flooding this post?.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:54 pm
by abrist
Lets close this thread out and start a new one with the ppa install. You can follow the information in Tony's post on page 1 in this thread. But we should probably not push this thread any further as any resolution will just confuse a future forum searcher. The trick with nrpe is that there are multiple ways to compile/install it. You should only use one. For your use case with ubuntu, the ppa is the easiest way. You will run into other distros that do not have any "special" nrpe support, and those you will have to use a package install or a source install. But for ease of learning, start with the ppa.

Note: you should wipe the ubuntu box or at least remove the the nrpe package from apt and cleanup the install from source. If this box is just pure testing and not production, just wipe it.

Re: Monitoring Ubuntu, Agent File

Posted: Mon Feb 04, 2013 3:56 pm
by A.Cormack
Understood. Yeah its only a sandbox network so I've just started up a fresh Ubuntu server.

Once again, thanks for all your help, I know it hasn't been easy. I'll follow Tony's guide as much as I can and then I'll open up a new thread.

Thank You.