[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

David GUENAULT dguenault at monitoring-fr.org
Tue Feb 28 22:09:35 UTC 2012


The following commit has been merged in the debian/master branch:
commit fdd2bf7cb8eaa882d82e4bd072d3eb546407a754
Author: David GUENAULT <dguenault at monitoring-fr.org>
Date:   Tue Dec 27 08:35:07 2011 +0100

    Added support for check_oracle_health plugin installation (only for debian like distro at the moment)

diff --git a/contrib/alternative-installation/shinken-install/shinken.conf b/contrib/alternative-installation/shinken-install/shinken.conf
index fdfc8ff..2c32d59 100644
--- a/contrib/alternative-installation/shinken-install/shinken.conf
+++ b/contrib/alternative-installation/shinken-install/shinken.conf
@@ -77,3 +77,7 @@ export CHECK_ESX3_SCRIPT="http://git.op5.org/git/?p=nagios/op5plugins.git;a=blob
 export NAGPLUGVERS="1.4.15"
 export NAGPLUGBASEURI="http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/$NAGPLUGVERS/nagios-plugins-$NAGPLUGVERS.tar.gz"
 export NAGPLUGAPTPKG="libgnutls-dev libmysqlclient-dev libssl-dev libsnmp-perl libkrb5-dev libldap2-dev libsnmp-dev libnet-snmp-perl gawk libwrap0-dev libmcrypt-dev fping snmp gettext smbclient dnsutils"
+
+export CHECKORACLEHEALTHAPTPKG="libdbi-perl libaio1"
+export CHECKORACLEHEALTHCPAN="http://search.cpan.org/CPAN/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.36.tar.gz"
+export CHECKORACLEHEALTH="http://labs.consol.de/wp-content/uploads/2011/09/check_oracle_health-1.7.3.tar.gz"
diff --git a/contrib/alternative-installation/shinken-install/shinken.sh b/contrib/alternative-installation/shinken-install/shinken.sh
index d70ea74..014fad2 100755
--- a/contrib/alternative-installation/shinken-install/shinken.sh
+++ b/contrib/alternative-installation/shinken-install/shinken.sh
@@ -1086,6 +1086,87 @@ function install_nagios-plugins(){
 	
 }
 
+# check_oracle_health
+
+function install_check_oracle_health(){
+	cadre "Install nagios plugins" green
+
+	cadre "WARNING YOU SHOULD INSTALL ORACLE INSTANT CLIENT FIRST !!!!" yellow
+	cecho " > Download the oracle instant client there (basic AND sdk AND sqlplus) : " yellow
+	cecho " > 64 bits : http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html" yellow
+	cecho " > 32 bits : http://www.oracle.com/technetwork/topics/linuxsoft-082809.html" yellow
+	cecho " > Set the ORACLE_HOME environment variable (better to set it in the bashrc)" yellow
+	cecho " > Set LD_LIBRARY_PATH to ORACLE_HOME (or better create a config file in /etc/ld.so.conf) then run ldconfig" yellow
+	cecho " > press ENTER to continue or CTRL+C to abort" yellow
+	read taste
+
+	if [ -z "$ORACLE_HOME" ]
+	then
+		cecho " > you must set the ORACLE_HOME environment variable !" red
+		exit 2
+	fi
+
+	if [ "$CODE" == "REDHAT" ]
+	then
+		cecho " > Unsuported" red
+	else
+		cecho " > installing prerequisites" green 
+		sudo apt-get -y install $CHECKORACLEHEALTHAPTPKG > /dev/null 2>&1
+		cecho " > installing cpan prerequisites" green
+		cd /tmp
+		for m in $CHECKORACLEHEALTHCPAN
+		do
+			filename=$(echo $m | awk -F"/" '{print $NF}')
+			if [ ! -f "$filename" ]
+			then
+				wget $m > /dev/null 2>&1
+				if [ $? -ne 0 ]
+				then
+					cecho " > Error while downloading $m" red
+					exit 2
+				fi
+			fi	
+			tar zxvf $filename  > /dev/null 2>&1
+			cd $(echo $filename | sed -e "s/\.tar\.gz//g")
+			perl Makefile.PL > /dev/null 2>&1
+			make > /dev/null 2>&1
+			if [ $? -ne 0 ]
+			then
+				cecho " > There was an error building module" red
+				exit 2
+			fi
+			make install  > /dev/null 2>&1
+		done
+		cd /tmp
+		cecho " > Downloading check_oracle_health" green
+		wget $CHECKORACLEHEALTH > /dev/null 2>&1
+		if [ $? -ne 0 ]
+		then
+			cecho " > Error while downloading $filename" red
+			exit 2
+		fi
+		cecho " > Extracting archive " green
+		filename=$(echo $CHECKORACLEHEALTH | awk -F"/" '{print $NF}')
+		tar zxvf $filename > /dev/null 2>&1
+		cd $(echo $filename | sed -e "s/\.tar\.gz//g")
+		./configure --prefix=$TARGET --with-nagios-user=$SKUSER --with-nagios-group=$SKGROUP --with-mymodules-dir=$TARGET/libexec --with-mymodules-dyn-dir=$TARGET/libexec --with-statefiles-dir=$TARGET/var/tmp > /dev/null 2>&1
+		cecho " > Building plugin" green
+		make > /dev/null 2>&1
+		if [ $? -ne 0 ] 
+		then
+			cecho " > Error while building check_oracle_health module" red
+			exit 2
+		fi
+		make check > /dev/null 2>&1	
+		if [ $? -ne 0 ]
+		then
+			cecho " > Error while building check_oracle_health module" red
+			exit 2
+		fi
+		cecho " > Installing plugin" green
+		make install > /dev/null 2>&1
+	fi
+}
 
 # Check if we launch the script with root privileges (aka sudo)
 if [ "$UID" != "0" ]
@@ -1112,6 +1193,10 @@ while getopts "kidubcr:lz:hsvp:we:" opt; do
 			then
 				install_nagios-plugins
 				exit 0
+			elif [ "$OPTARG" == "check_oracle_health" ]
+			then
+				install_check_oracle_health
+				exit 0
 			else
 				cecho " > Unknown plugin $OPTARG" red
 			fi

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list