Had no trouble installing NRPE… But a couple of questions. After reading the README it does not say where to put the nrpe.cfg. I’m thinking in the nagios dir. Also, to run as a deamon how would i do that or would it be better to run as one of two other ways.
It doesn’t really matter where you put the nrpe.cfg, as long as you remember where it is. If you want to start nrpe as a daemon, you just need to run (from the directory in which the nrpe command is found) ./nrpe -d <path to nrpe.cfg>. I think that that’s necessary only if you don’t have the daemon and the .cfg file in the same directory, though.
If you want to use the init-script that nrpe provides, you will need to the paths it defaults to to find the nrpe daemon and nrpe.cfg file. Edited Wed Jan 11 2006, 10:33PM ]
What is the ./ … I know the -d is deamon… so if to say i copy the nrpe.cfg in the /usr/local/nagios directory then all i really have to do is run the command. Could i use ps aux | grep nrpe to see if it is running.
Since it’s a config file, put the nrpe.cfg in the nagios/etc directory. But as stated, it doesn’t matter where you put it, just as long as you define correctly.
The check_nrpe plugin should be placed on the Nagios host along
with your other plugins. In most cases, this will be in the
/usr/local/nagios/libexec directory.
The nrpe program and the configuration file (nrpe.cfg) should
be placed somewhere on the remote host. Note that you will also
have to install some plugins on the remote host if you want to
make much use of this addon.
***** INETD *****
If your system uses the inetd superserver WITH tcpwrappers, add an
entry to /etc/inetd.conf as follows:
Replace with the name of the user that the nrpe server should run as.
Example: nagios
Replace with the path to the nrpe binary on your system.
Example: /usr/local/nagios/nrpe
Replace with the path to the nrpe config file on your system.
Example: /usr/local/nagios/nrpe.cfg
***** XINETD *****
If your system uses xinetd instead of inetd, you’ll probably
want to create a file called ‘nrpe’ in your /etc/xinetd.d
directory that contains the following entries:
# default: on
# description: NRPE
service nrpe
{
flags = REUSE
socket_type = stream
wait = no
user = <user>
server = <nrpebin>
server_args = -c <nrpecfg> --inetd
log_on_failure += USERID
disable = no
only_from = <ipaddress1> <ipaddress2> ...
}
Replace with the name of the user that the nrpe server should run as.
Replace with the path to the nrpe binary on your system.
Replace with the path to the nrpe config file on your system.
Replace the fields with the IP addresses of hosts which
are allowed to connect to the NRPE daemon. This only works if xinetd was
compiled with support for tcpwrappers.
Restart inetd or xinetd will the following command (pick the
on that is appropriate for your system:
[quote=“mwiesner”]What is the ./ … I know the -d is deamon… so if to say i copy the nrpe.cfg in the /usr/local/nagios directory then all i really have to do is run the command. Could i use ps aux | grep nrpe to see if it is running.
And how do i stop it if I need to.
Thanks[/quote]
The ./ just specifies the current directory you’re in. Once I give executable permissions to my files, I often have to preface the command to run them with ./
Yes, running a ps aux | grep nrpe should turn up at least two results: one of the nrpe daemon and one of the grep of the nrpe daemon. To stop the daemon, you can either use the start-up script or run a kill command on the process. I don’t know how to stop it if you have it running under inetd or xinetd, though.
Remote host uses the nrpe daemon. The central nagios server will execute the check_nrpe client and make a connection to the daemon. The daemon will then perform the check that you wish it to and send the data back to client.