ok you seem to be having a lot of trouble with this, and even more trouble understanding how inetd works, so im going to explain how to run nrpe as a daemon.
ON YOUR CLIENT SOLARIS BOXES:
Download and untar the source code (superb-west.dl.sourceforge.net/s … 8.1.tar.gz) then run this is the directory you untarred the source to:
./configure
make all
This will make two binary files. One called ‘check_nrpe’, the other called ‘nrpe’. You need to copy the ‘nrpe’ file somewhere like /bin, or wherever you want. Copy the sample-config/nrpe.cfg.in file to /etc/nrpe.cfg.
Now edit your /etc/nrpe.cfg. Going through it, you’ll see that you need to set a number of things, like the user it will run as, the group, the server port (use 5666), and ALLOWED HOSTS (!important!) set that to the IP of your redhat box. Also set up your very first check command:
command[check_tester]=/home/abishek/check_tester.sh
add that to the bottom of the file.
Now create your first nagios check:
$ cat > /home/abishek/check_tester.sh
#!/bin/bash
echo “OMG IT WORX!”
[ctrl+D]
$ chmod 0755 /home/abishek/check_tester.sh
Now run the daemon by doing this:
/bin/nrpe -c /etc/nrpe.cfg
you can also do nrpe -n -c /etc/nrpe.cfg if you’re having troubles with SSL.
Now do a ‘netstat -pantu’ and look for NRPE, it should be listening on whatever port you defined in your /etc/nrpe.cfg.
If it’s not listening, go to your source directory and read the README file. Im going to say this again. read the README file. it tells you exactly how to do this. Also typing ‘/bin/nrpe -h’ will show you your options on how to run nrpe.
Remember, since you’re running it as a daemon, you have to restart the process every time you change your /etc/nrpe.cfg. Do yourself a favour and learn how inetd works, it tells you how to configure and use inetd for nrpe in the README file.
ON YOUR REDHAT BOX
Compile check_nrpe here again, just like above. Don’t just copy the binary you made in solaris. Recompile here. Now use:
./check_nrpe -H x.x.x.x -c check_omg
it should return “OMG IT WORX!”