Nrpe: Difference between revisions

From CLONWiki
Jump to navigation Jump to search
Boiarino (talk | contribs)
No edit summary
Boiarino (talk | contribs)
No edit summary
Line 68: Line 68:
Testing 'nrpe':
Testing 'nrpe':


NOTE: user 'nagios' must exist to run 'nrpe' daemon !!!
NOTE: user 'nagios' and group 'nagios' must exist to run 'nrpe' daemon !!!
(private group 'nagios' ?) On solaris use:  'useradd -d /home/nagios -m -c "Nagios" nagios'.
To create user on Solaris:  'useradd -d /home/nagios -m -c "Nagios" nagios' (-m will force home directory creation).
if complains, check passwd file by 'pwconv' (should not be blank lines !!!).
if complains, check passwd file by 'pwconv' (should not be blank lines !!!).
To add group on Solaris add following line to '/etc/group' file: 'nagios::9997:nagios' (id maybe different of course).
On Linux use system-config-.. utility.


on Linux (as 'root'):
To start/stop 'nrpe' daemon on Linux (as 'root'):


   /etc/init.d/nrpe start
   /etc/init.d/nrpe start
   /etc/init.d/nrpe stop
   /etc/init.d/nrpe stop


on Solaris (as 'root'):
To start 'nrpe' daemon on Solaris (as 'root'):


   /apps/nrpe2.6/bin/nrpe -c /apps/nrpe2.6/etc/nrpe.cfg -d
   /apps/nrpe2.6/bin/nrpe -c /apps/nrpe2.6/etc/nrpe.cfg -d
Line 87: Line 89:
   3051
   3051


In both systems it is running as 'nagios' in according to it's config file.
In both systems it is running under user 'nagios' in according to it's config file.

Revision as of 18:43, 6 January 2007

Configuring:

 cd /usr/local/src
 cp ../downloads/nrpe-2.6.tar.gz .
 gunzip nrpe-2.6.tar.gz
 tar xvf nrpe-2.6.tar
 rm nrpe-2.6.tar
 cd /usr/local/src/nrpe-2.6
 ./configure --prefix=/apps/nrpe2.6

During that step sparc said:

 checking for SSL... SSL found in /usr/local
 *** Generating DH Parameters for SSL/TLS ***
 warning, not much extra random data, consider using the -rand option
 Generating DH parameters, 512 bit long safe prime, generator 2
 This is going to take a long time
 4638:error:24064064:random number generator:SSLEAY_RAND_BYTES:PRNG not seeded:md_rand.c:503:
 You need to read the OpenSSL FAQ,   http://www.openssl.org/support/faq.html
 4638:error:05068003:Diffie-Hellman routines:DH_generate_parameters:BN lib:dh_gen.c:154:

Compiling:

 make all

On clonweb (where Nagios is running):

 cp src/check_nrpe /apps/nagios2.6/libexec

On any other machine which suppose to be remotely monitored by clonweb:

 mkdir /apps/nrpe2.6
 mkdir /apps/nrpe2.6/libexec
 mkdir /apps/nrpe2.6/etc
 mkdir /apps/nrpe2.6/bin
 cp sample-config/nrpe.cfg /apps/nrpe2.6/etc/
 cp src/nrpe /apps/nrpe2.6/bin
 cp src/check_nrpe /apps/nrpe2.6/libexec/
 cp init-script /etc/init.d/nrpe
 emacs /etc/init.d/nrpe:
 # config: /apps/nrpe2.6/etc/nrpe.cfg
 NrpeBin=/apps/nrpe2.6/bin/nrpe
 NrpeCfg=/apps/nrpe2.6/etc/nrpe.cfg
 emacs /apps/nrpe2.6/etc/nrpe.cfg: for example
 command[check_disk]=/apps/nrpe2.6/libexec/check_disk -w 20 -c 10 -p /dev/sda5

on clonweb: copy pluging we want to execute remotely

(remote machines will not see /www, only /apps !!!) cp /www/nagios2.6/libexec/check_disk /apps/nrpe2.6/libexec/


Testing 'check_nrpe':

on clonweb:

 /www/nagios2.6/libexec/check_nrpe -H clonpc1 -c check_disk
   must return:
 DISK OK - free space: / 7762 MB (54% inode=84%);| /=6411MB;14912;14922;0;14932

on non-clonweb:

 /apps/nrpe2.6/libexec/check_nrpe -H clonpc1 -c check_disk


Testing 'nrpe':

NOTE: user 'nagios' and group 'nagios' must exist to run 'nrpe' daemon !!! To create user on Solaris: 'useradd -d /home/nagios -m -c "Nagios" nagios' (-m will force home directory creation). if complains, check passwd file by 'pwconv' (should not be blank lines !!!). To add group on Solaris add following line to '/etc/group' file: 'nagios::9997:nagios' (id maybe different of course). On Linux use system-config-.. utility.

To start/stop 'nrpe' daemon on Linux (as 'root'):

 /etc/init.d/nrpe start
 /etc/init.d/nrpe stop

To start 'nrpe' daemon on Solaris (as 'root'):

 /apps/nrpe2.6/bin/nrpe -c /apps/nrpe2.6/etc/nrpe.cfg -d
 ps -ef | grep nrpe
 nagios  3051     1   0 13:09:24 ?           0:00  ./nrpe -c /apps/nrpe2.6/etc/nrpe.cfg -d
 more /var/run/nrpe.pid
 3051

In both systems it is running under user 'nagios' in according to it's config file.