NRPE Newbie

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.

Thanks Ahead of time…

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.

And how do i stop it if I need to.

Thanks

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:

    nrpe    stream  tcp     nowait  <user> /usr/sbin/tcpd <nrpebin> -c <nrpecfg> --inetd

If your system uses the inetd superserver WITHOUT tcpwrappers, add an
entry to /etc/inetd.conf as follows:

    nrpe    stream  tcp     nowait  <user> <nrpebin> -c <nrpecfg> --inetd
  • 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.
  1. Restart inetd or xinetd will the following command (pick the
    on that is appropriate for your system:

     /etc/rc.d/init.d/inet restart
    
     /etc/rc.d/init.d/xinetd restart

[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.

Thanks Thunder got it all up and running and it’s running great… Thanks for all the help and info…

:slight_smile:

I can’t get nrpe to run, i ahve compiled it properly, but when i start it in daemon mode it bombs out with no error. Could someone assist?

  1. do i need to install nagios on the remote host? or i just need to install the nrpe on remote host?

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.

what about monitoring windows client, what is the nsclient to use? has anyone done this?

I can’t seem to get mine working. how did you iron it all out. I going in circles with the .cfg file.