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

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


The following commit has been merged in the debian/master branch:
commit 1b606882dabcdda448f246c969bf30458b0386ae
Author: David GUENAULT <dguenault at monitoring-fr.org>
Date:   Sun Jan 1 21:25:43 2012 +0100

    Added check_wmi_plus support (debian only at the moment)

diff --git a/contrib/alternative-installation/shinken-install/shinken.conf b/contrib/alternative-installation/shinken-install/shinken.conf
index 700aa87..3bf3386 100644
--- a/contrib/alternative-installation/shinken-install/shinken.conf
+++ b/contrib/alternative-installation/shinken-install/shinken.conf
@@ -94,3 +94,8 @@ export MKVER="1.1.12p6"
 export MKURI="http://mathias-kettner.de/download/check_mk-$MKVER.tar.gz"
 export MKPREFIX="/usr/local/check_mk"
 export MKAPTPKG="libapache2-mod-python"
+
+export WMICAPTPKG="autoconf python libdatetime-perl libnagios-plugin-perl libconfig-inifiles-perl"
+export WMIC="http://dev.zenoss.org/svn/trunk/inst/externallibs/wmi-1.3.13.tar.bz2"
+export CHECKWMIPLUS="http://edcint.co.nz/checkwmiplus/sites/default/files/check_wmi_plus.v1.49.tar.gz"
+
diff --git a/contrib/alternative-installation/shinken-install/shinken.sh b/contrib/alternative-installation/shinken-install/shinken.sh
index 0b9dc95..8350ef7 100755
--- a/contrib/alternative-installation/shinken-install/shinken.sh
+++ b/contrib/alternative-installation/shinken-install/shinken.sh
@@ -1033,6 +1033,7 @@ echo "Usage : shinken -k | -i | -w | -d | -u | -b | -r | -l | -c | -h | -a | -z
                      nagios-plugins
                      check_oracle_health
                      check_mysql_health
+		     check_wmi_plus
                      capture_plugin
                      pnp4nagios
                      multisite
@@ -1258,6 +1259,68 @@ function install_nagios-plugins(){
 	
 }
 
+# check_wmi_plus
+function install_check_wmi_plus(){
+	cadre "Install check_wmi_plus" green
+
+	if [ "$CODE" == "REDHAT" ]
+	then
+		cecho " > Unsuported" red
+	else
+		cecho " > installing prerequisites" green 
+		sudo apt-get -y install $WMICAPTPKG > /dev/null 2>&1
+		cd /tmp
+		cecho " > Downloading wmic" green
+		filename=$(echo $WMIC | awk -F"/" '{print $NF}')
+		if [ ! -f $(echo $filename | sed -e "s/\.bz2//g") ]
+		then
+			wget $WMIC > /dev/null 2>&1
+			bunzip2 $filename
+		else
+			rm -Rf $(echo $filename | sed -e "s/\.tar//g")
+		fi
+		if [ $? -ne 0 ]
+		then
+			cecho " > Error while downloading $filename" red
+			exit 2
+		fi
+		cecho " > Extracting archive " green
+		tar xvf $(echo $filename| sed -e "s/\.bz2//g") > /dev/null 2>&1
+		cd $(echo $filename | sed -e "s/\.tar\.bz2//g")
+		cecho " > Building wmic" green
+		make > /dev/null 2>&1
+		if [ $? -ne 0 ] 
+		then
+			cecho " > Error while building wmic" red
+			exit 2
+		fi
+		cecho " > Installing wmic" green
+		cp Samba/source/bin/wmic $TARGET/libexec/
+		chown $SKUSER:$SKGROUP Samba/source/bin/wmic
+		cd /tmp
+		cecho " > Downloading check_wmi_plus" green
+		filename=$(echo $CHECKWMIPLUS | awk -F"/" '{print $NF}')
+		folder=$(echo $filename | sed -e "s/\.tar\.gz//g")
+		if [ ! -f "$filename" ]
+		then
+			wget $CHECKWMIPLUS > /dev/null 2>&1 
+		fi
+		cecho " > Extracting archive" green
+		tar zxvf $filename > /dev/null 2>&1
+		cecho " > Installing plugin" green
+		cp check_wmi_plus.conf.sample $TARGET/libexec/check_wmi_plus.conf 
+		cp check_wmi_plus.pl $TARGET/libexec/check_wmi_plus.pl
+		cp -R /tmp/check_wmi_plus.d $TARGET/libexec/
+		chown $SKUSER:$SKGROUP $TARGET/libexec/check_wmi_plus* 
+		cecho " > configuring plugin" green
+		sed -i "s#/usr/lib/nagios/plugins#"$TARGET"/libexec#g" $TARGET/libexec/check_wmi_plus.conf
+		sed -i "s#/bin/wmic#"$TARGET"/libexec/wmic#g" $TARGET/libexec/check_wmi_plus.conf
+		sed -i "s#/opt/nagios/bin/plugins#"$TARGET"/libexec#g" $TARGET/libexec/check_wmi_plus.pl
+		sed -i "s#/usr/lib/nagios/plugins#"$TARGET"/libexec#g" $TARGET/libexec/check_wmi_plus.pl
+		
+	fi
+}
+
 # check_oracle_health
 
 function install_check_oracle_health(){
@@ -1417,6 +1480,10 @@ while getopts "kidubcr:lz:hsvp:we:" opt; do
 			then
 				install_capture_plugin
 				exit 0
+			elif [ "$OPTARG" == "check_wmi_plus" ]
+			then
+				install_check_wmi_plus
+				exit 0
 			elif [ "$OPTARG" == "pnp4nagios" ]
 			then
 				install_pnp4nagios

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list