Page 2 of 2

Re: Shat down server

Posted: Mon Nov 19, 2012 5:13 pm
by slansing
What guide did you follow for installation, if you used one other than what our site has it may be in a different location, I suggest if you are still having trouble locating it to install "mlocate" and search for nrpe.cfg

Code: Select all

yum install mlocate

locate nrpe.cfg

Re: Shat down server

Posted: Wed Nov 21, 2012 12:16 pm
by inserm
slansing wrote:It is located in:

Code: Select all

/usr/local/nagios/etc/nrpe.cfg
Here is the link to the event handler document I had in my presentation, It is a little more than mid way down:

http://assets.nagios.com/downloads/nagi ... h_NRPE.pdf
1- I installed nagios-nrpe-server and there exists in the directory
/etc/nagios/

2- I want to stop a server not a service

3- I use nagios core

I tried to do something with the file that you'd gone.

Code: Select all

define command {
       command_name service-Restart
       command_line $USER1$/servicerestart.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$
}

Code: Select all

/usr/lib/nagios/plugin/check_nrpe -H
<ip_address> -p 5666 -c runcmd -a ntpd
CHECK_NRPE: Socket timeout after 10 seconds.

with

Code: Select all

# service ntpd stop
ntpd: unrecognized service

Re: Shat down server

Posted: Mon Nov 26, 2012 4:08 pm
by slansing
Ok, I was going off of the user's link to you regarding my presentation. I don't believe anyone has created something like this which restarts a server besides that information is for Windows, there is another document which is for Linux, I suggest you start there. I am not sure if you will be able to supply a system command like that remotely without security risk.:

http://assets.nagios.com/downloads/nagi ... h_NRPE.pdf

I suggest you try just running

Code: Select all

check_nrpe -H "hostname" -p 5666
this way if it is able to send and receive data it will report back with the version of NRPE that the server is running. Make sure to check that the IP's are cross-allowed in the nrpe.cfg file, or under your xinetd directory if you compiled for xinetd. In addition check to make sure that port 5666 UDP/TCP is open on both machines.