Wednesday, November 2, 2016

compile and install nagios nrpe 2.15 on solaris 10 sparc

 compile and install nagios nrpe 2.15 on solaris 10 sparc  
   
 # useradd -c "nagios system user" -d /usr/local/nagios -m nagios  
 # groupadd nagios  
 add nagios user to nagios group  
   
 # chown nagios:nagios /usr/local/nagios/  
 # cd /usr/local/src  
 # wget http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz  
 # wget --no-check-certificate https://nagios-plugins.org/download/nagios-plugins-1.4.11.tar.gz  
   
 compile and install nrpe   
 # gunzip nrpe-2.15.tar.gz  
 # tar xvf nrpe-2.15.tar  
 # cd nrpe-2.15  
 # ./configure  
 # make && make install  
 # make install-daemon-config  
   
 compile and install plugins  
 # gunzip nagios-plugins-1.4.11.tar.gz  
 # tar xvf nagios-plugins-1.4.11.tar  
 # cd nagios-plugins-1.4.11  
 # ./configure --without-mysql  
 # make && make install  
   
 set up nrpe  
 # cat nrpe 5666/tcp # NRPE >> /etc/services  
   
 # cat nrpe stream tcp nowait nagios \  
 /usr/sfw/sbin/tcpd /usr/local/nagios/bin/nrpe -c \  
 /usr/local/nagios/etc/nrpe.cfg -i >> nrpe stream tcp nowait nagios \  
 /usr/sfw/sbin/tcpd /usr/local/nagios/bin/nrpe -c \  
 /usr/local/nagios/etc/nrpe.cfg -i  
 
 in /etc/inetd.conf add:
 nrpe stream tcp nowait nagios /usr/sfw/sbin/tcpd /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -i

  
 convert inetd to smf  
 # inetconv  
  nrpe -> /var/svc/manifest/network/nrpe-tcp.xml  
  Importing nrpe-tcp.xml …Done  
   
 did it work?  
 # inetconv -e  
  svc:/network/nrpe/tcp:default enabled  
   
 online?  
 # svcs svc:/network/nrpe/tcp:default  
 STATE STIME FMRI  
 online 15:49:55 svc:/network/nrpe/tcp:default  
 
# netstat -a | grep nrpe  
 *.nrpe *.* 0 0 49152 0 LISTEN  
   
   
 look at npre.cfg on client  
 first, add the host and the servers that may access it.  
   
 restart the service  
 # svcadm disable svc:/network/nrpe/tcp:default  
 # svcadm enable svc:/network/nrpe/tcp:default  
   
 check if npre is accessible. the rev show show up.  
 # /usr/local/nagios/libexec/check_nrpe -H localhost  
  NRPE v2.15  
   
 problems?  
 # ldd /usr/local/nagios/bin/nrpe <- missing libs?  
 # less /var/svc/log/network-nrpe:default.log <- logs  
   
 and then on the nagios server itself, match the   
 services with what is defined in npre.cfg  
   
 solaris npre plugins look like:  
   
 command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10  
 command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20  
 command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /  
 command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z  
 command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200  
   
 note: check_hda1. usually / is defined as /dev/hda1 ; this is not match  
 the entry in /etc/vfstab . is the system is global root zone for zones  
 check_procs will need to be edited. change it to something insane like  
 100 for every zone. it is 150 200, by default.  
   
 
 define service {  
     host_name            sparc01  
     service_description       Root Partition  
     check_command          check_nrpe!check_hda1  
     use               generic-service  
     }  
   
 define service {  
     host_name            sparc01  
     service_description       Current Users  
     check_command          check_nrpe!check_users  
     use               generic-service  
     }  
   
 define service {  
     host_name            sparc01  
     service_description       CPU Load  
     check_command          check_nrpe!check_load  
     use               generic-service  
     }  
   
 define service {  
     host_name            sparc01  
     service_description       Total Processes  
     check_command          check_nrpe!check_total_procs  
     use               generic-service  
     }  
   
 define service {  
     host_name            sparc01  
     service_description       Zombie Processes  
     check_command          check_nrpe!check_zombie_procs  
     use               generic-service  
     }  
   
Post a Comment