December 8, 2017

op5


------------------
Download OP5
------------------

op5-monitor-6.2.0.1-20131024.tar.gz

[http://www.op5.com/download-op5-monitor/]

------------------
Query RPM Package
------------------

Det finns två rpm i denna tar boll

# ll *nrpe*
-rw-rw-r--. 1 500 500 23068 Oct 24 10:17 nrpe-2.13.3-op5.1.x86_64.rpm
-rw-rw-r--. 1 500 500 11992 Oct 24 10:17 nrpe-client-2.13.3-op5.1.x86_64.rpm

Filer som RPM innehåller

# rpm -qpl nrpe-2.13.3-op5.1.x86_64.rpm
warning: nrpe-2.13.3-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY
/etc/init.d/nrpe
/etc/nrpe.conf
/etc/nrpe.d
/etc/nrpe.d/op5_commands.cfg
/usr/sbin/nrpe

RPM Dependency/Requires [-R,--requires]

# rpm -qpR nrpe-2.13.3-op5.1.x86_64.rpm 
warning: nrpe-2.13.3-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY
/bin/sh  
/bin/sh  
config(nrpe) = 2.13.3-op5.1
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libcrypto.so.10()(64bit)  
libnsl.so.1()(64bit)  
libssl.so.10()(64bit)  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(VersionedDependencies) <= 3.0.3-1
rtld(GNU_HASH)  
rpmlib(PayloadIsXz) <= 5.2-1

RPM installation scripts

# rpm -qp --scripts nrpe-2.13.3-op5.1.x86_64.rpm
warning: nrpe-2.13.3-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY
postinstall scriptlet (using /bin/sh):
/sbin/chkconfig --add nrpe || :
/sbin/service nrpe stop || :
/sbin/service nrpe start || :

# Move command definitions to 'include_dir' if upgrading
if [ $1 -eq 2 ]; then
   grep -q '^command\[' /etc/nrpe.conf || :
   if [ $? -eq 0 ]; then
          echo "" >> /etc/nrpe.d/op5_commands.cfg
          echo "# Imported from /etc/nrpe.cfg" >> /etc/nrpe.d/op5_commands.cfg
          grep '^command\[' /etc/nrpe.conf >> /etc/nrpe.d/op5_commands.cfg || :
          sed '/^[\#]\?[ tab]\?command\[\[*/d' -i /etc/nrpe.conf || :
          echo "" >> /etc/nrpe.conf
          echo "# NOTE!" >> /etc/nrpe.conf
          echo "# Command definitions have meed moved to 'include_dir'." >> /etc/nrpe.conf
          echo "# Any commands defined in this file will be moved by future upgrades." >> /etc/nrpe.conf
          echo "" >> /etc/nrpe.conf
   fi

   grep -q '^include_dir' /etc/nrpe.conf || :
   if [ $? -ne 0 ]; then
          echo "# In order to make remote config with conf_nrpe work, you need to" >> /etc/nrpe.conf
          echo "# create the following directory. It needs to be read/writeable by" >> /etc/nrpe.conf
          echo "# nrpe_user specified above. " >> /etc/nrpe.conf
          echo "# All command definitions should be placed in the 'include_dir'" >> /etc/nrpe.conf
          echo "# NOTE: files in 'include_dir' must have a '.cfg' suffix." >> /etc/nrpe.conf
          echo "include_dir=/etc/nrpe.d" >> /etc/nrpe.conf
   fi
fi


------------------
NRPE RPM Installation
------------------
# rpm -ipvh nrpe-2.13.3-op5.1.x86_64.rpm
warning: nrpe-2.13.3-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY
Preparing...                ########################################### [100%]
   1:nrpe                   ########################################### [100%]
nrpe doesn't seem to be running.
Starting nrpe in daemon mode ... done

Check process 

# ps auxZ | grep nrpe
unconfined_u:system_r:nrpe_t:s0 nobody 1271 0.0 0.0 39364 1364 ? Ss 13:27 0:00 /usr/sbin/nrpe -c /etc/nrpe.conf -d
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 1274 0.0 0.0 103244 832 pts/0 S+ 13:27 0:00 grep nrpe

------------------
NRPE RPM Configuration
------------------

# vi /etc/nrpe.conf
...
allowed_hosts=127.0.0.1,192.168.122.93
...

Restart NRPE to let configuration changes take effect

# service nrpe restart

------------------
Test NRPE Installation
------------------

From server 

# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.122.12
NRPE v2.13

------------------
Plugin RPM Installation
------------------

# cat /etc/nrpe.d/op5_commands.cfg 
################################################################################
#
# op5-nrpe command configuration file
#

# COMMAND DEFINITIONS
# Syntax:
# command[<command_name>]=<command_line>
#
command[users]=/opt/plugins/check_users -w 5 -c 10
...

# ll *plugins*
-rw-rw-r--. 1 500 500 417248 Oct 24 10:17 plugins-community-2.8.5-op5.1.x86_64.rpm
-rw-rw-r--. 1 500 500  47920 Oct 24 10:17 plugins-metadata-2.8.7-op5.1.x86_64.rpm
-rw-rw-r--. 1 500 500 594020 Oct 24 10:17 plugins-nagios-2.6.5.1-op5.1.x86_64.rpm
-rw-rw-r--. 1 500 500  94088 Oct 24 10:17 plugins-nagios-local-2.6.5.1-op5.1.x86_64.rpm
-rw-rw-r--. 1 500 500   3160 Oct 24 10:17 plugins-op5-3.0.0-op5.1.el6.x86_64.rpm

# rpm -qpl plugins-community-2.8.5-op5.1.x86_64.rpm | grep check_users
warning: plugins-community-2.8.5-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY

# rpm -qpl plugins-nagios-2.6.5.1-op5.1.x86_64.rpm | grep check_users
warning: plugins-nagios-2.6.5.1-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY

# rpm -qpl plugins-nagios-local-2.6.5.1-op5.1.x86_64.rpm | grep check_users
warning: plugins-nagios-local-2.6.5.1-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY
/opt/plugins/check_users

# rpm -qpl plugins-op5-3.0.0-op5.1.el6.x86_64.rpm | grep check_users
warning: plugins-op5-3.0.0-op5.1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY





# rpm -ipvh plugins-nagios-local-2.6.5.1-op5.1.x86_64.rpm
warning: plugins-nagios-local-2.6.5.1-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY
error: Failed dependencies:
 perl(Exporter) is needed by plugins-nagios-local-2.6.5.1-op5.1.x86_64


# rpm -qpR plugins-nagios-local-2.6.5.1-op5.1.x86_64.rpm
warning: plugins-nagios-local-2.6.5.1-op5.1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f6e3ade7: NOKEY
/bin/sh  
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libc.so.6(GLIBC_2.8)(64bit)  
libdl.so.2()(64bit)  
libm.so.6()(64bit)  
libm.so.6(GLIBC_2.2.5)(64bit)  
libpthread.so.0()(64bit)  
libpthread.so.0(GLIBC_2.2.5)(64bit)  
perl(Exporter)  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)  
rpmlib(PayloadIsXz) <= 5.2-1

Måste installera perl

# rpm -q --provides perl | grep Exporter
perl(Exporter) = 5.63
perl(Exporter::Heavy)  


-----------------------
Troubleshooting
-----------------------

# less /var/log/messages
...
nrpe[2703]: Error: Could not complete SSL handshake. 1
...

Från server enbart testa NRPE kommunikationen, genom att anropa NRPE utan kommando

# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.122.12
NRPE v2.13

------------------
Plugin SELinux Problems
------------------

plugins does not seem to work with SELinux

On client set SELinux to Permissive

# setenforce 0

Double check that audit deamon is installed and running

# service auditd status
auditd (pid  983) is running...

sealert:

yum install setroubleshoot-server


semanage:
audit2allow:

yum install policycoreutils-python

No comments: