Shat down server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Shat down server

Post 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
inserm
Posts: 24
Joined: Tue Jul 31, 2012 6:05 am

Re: Shat down server

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Shat down server

Post 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.
Locked