diff --git a/centreon-plugins/.project b/centreon-plugins/.project new file mode 100644 index 000000000..bc15201e8 --- /dev/null +++ b/centreon-plugins/.project @@ -0,0 +1,11 @@ + + + Plugins + + + + + + + + diff --git a/centreon-plugins/CHANGELOG b/centreon-plugins/CHANGELOG new file mode 100644 index 000000000..2ece92566 --- /dev/null +++ b/centreon-plugins/CHANGELOG @@ -0,0 +1,22 @@ +########################## +# Oreon Plugins Change Log +########################## + +1.2.3 - 02/11/2005 +---------------- +* Enhanced Oreon Perl Package oreon.pm (wistof) +* Integration of some Manubulon plugins (wistof) +* New install script for plugins (wistof) +* Minor bug fixes + +1.2.2 - xx/08/2005 +---------------- +* Add Oreon Perl Package oreon.pm (gollum123) +* Globalization of paths in oreon.conf (gollum123) +* Management of RRDTOOL errors (wistof) +* Use Net::SNMP instead of snmpwalk and snmpget (wistof) +* Disable regex for '-H' option (wistof) +* Minor bug fixes + + + diff --git a/centreon-plugins/INSTALL b/centreon-plugins/INSTALL new file mode 100644 index 000000000..ebefe6175 --- /dev/null +++ b/centreon-plugins/INSTALL @@ -0,0 +1,8 @@ +############################ +# Oreon Plugins Installation +############################ + +- just run install.sh in src/ directory +- don't directly copy plugins in Nagios plugins directory + + diff --git a/centreon-plugins/REQUIREMENT b/centreon-plugins/REQUIREMENT new file mode 100644 index 000000000..1ba6eba1d --- /dev/null +++ b/centreon-plugins/REQUIREMENT @@ -0,0 +1,12 @@ +########################### +# Oreon Plugins Requirement +########################### + +- Perl in /usr/bin/perl - or just run 'perl script' +- Net::SNMP +- Config::IniFiles +- RRDTool installed (RRDs.pm) +- Oreon perl module (oreon.pm) +- Oreon configuration file for Oreon perl module (oreon.conf) +- file 'utils.pm' in plugin diretory (/usr/local/nagios/libexec) +- sed program for installation script \ No newline at end of file diff --git a/centreon-plugins/install.sh b/centreon-plugins/install.sh new file mode 100644 index 000000000..b952bc377 --- /dev/null +++ b/centreon-plugins/install.sh @@ -0,0 +1,228 @@ +#!/bin/sh +# +# Oreon is developped with Apache Licence 2.0 : +# http://www.apache.org/licenses/LICENSE-2.0.txt +# Developped by : Julien Mathis - Romain Le Merlus +# Christophe Coraboeuf - Mathieu Chateau + +# The Software is provided to you AS IS and WITH ALL FAULTS. +# OREON makes no representation and gives no warranty whatsoever, +# whether express or implied, and without limitation, with regard to the quality, +# safety, contents, performance, merchantability, non-infringement or suitability for +# any particular or intended purpose of the Software found on the OREON web site. +# In no event will OREON be liable for any direct, indirect, punitive, special, +# incidental or consequential damages however they may arise and even if OREON has +# been previously advised of the possibility of such damages. + +#Load install script functions +. ../functions + +## +## VARIABLES +## +## Make sure you know what you do if you modify it !! + +PWD=`pwd` + +PLUGINS_DIR="" + +LOG_FILE="../log/install_oreon.log" + +date > $LOG_FILE + +echo +echo "##########################################################################" +echo "# OREON Project (www.oreon-project.org) #" +echo "# Thanks for using OREON #" +echo "# #" +echo "# v 1.2.3 #" +echo "# #" +echo "# infos@oreon-project.org #" +echo "# #" +echo "# Make sure you have installed and configured #" +echo "# perl - sed #" +echo "# #" +echo "# #" +echo "##########################################################################" +echo "# The Team OREON #" +echo "##########################################################################" +echo "" +echo "" +$SETCOLOR_WARNING +echo " Make sure you have root permissions !" +$SETCOLOR_NORMAL +echo "" + +echo "Are you sure to continue?" +echo -n "[y/n], default to [n]:" +read temp +if [ -z $temp ];then + temp=n +fi + +if [ $temp = "n" ];then + echo "Bye bye !" + exit +fi + +test_answer() +{ + #$1 variable to fill + #$2 text typed by user + if [ ! -z $2 ];then + if [ $2 != "" ];then + eval $1=$2 + fi + fi +} + +## +## CONFIGURATION +## +if test -a $OREON_CONF ; then + echo "" + echo_success "Finding Oreon configuration file '$OREON_CONF' :" "OK" + echo "You already seem to have to install Oreon." + echo "Do you want use last Oreon install parameters ?" + echo -n "[y/n], default to [y]:" + read temp + if [ -z $temp ];then + temp=y + fi + + if [ $temp = "y" ];then + echo "" + echo_passed "Using '$OREON_CONF' :" "PASSED" + . $OREON_CONF + echo "" + else + echo "" + echo "First, let's talk about you !" + echo "-----------------------------" + echo "" + fi +fi + if [ -z $INSTALL_DIR_NAGIOS ];then + INSTALL_DIR_NAGIOS="/usr/local/nagios" + echo "Where is installed Nagios ?" + echo -n "default to [$INSTALL_DIR_NAGIOS]:" + read temp + test_answer INSTALL_DIR_NAGIOS $temp + echo "" + fi + + if [ -z $NAGIOS_ETC ];then + #nagios etc directory for oreon + NAGIOS_ETC="$INSTALL_DIR_NAGIOS/etc" + echo "Where are your nagios etc directory ?" + echo -n "default to [$NAGIOS_ETC]:" + read temp + test_answer NAGIOS_ETC $temp + echo "" + fi + + if [ -z $NAGIOS_PLUGIN ];then + #nagios plugins directory for oreon + NAGIOS_PLUGIN="$INSTALL_DIR_NAGIOS/libexec" + echo "Where are your nagios plugin / libexec directory ?" + echo -n "default to [$NAGIOS_PLUGIN]:" + read temp + test_answer NAGIOS_PLUGIN $temp + echo "" + fi + + if [ -z $INSTALL_DIR_OREON ];then + #setup directory for oreon + INSTALL_DIR_OREON="/usr/local/oreon" + echo "Where do I install Oreon ?" + echo -n "default to [$INSTALL_DIR_OREON]:" + read temp + test_answer INSTALL_DIR_OREON $temp + echo "" + fi + + if [ -z $SUDO_FILE ];then + #Configuration file for sudo + SUDO_FILE="/etc/sudoers" + echo "Where is sudo ?" + echo -n "default to [$SUDO_FILE]:" + read temp + test_answer SUDO_FILE $temp + echo "" + fi + + if [ -z $RRD_PERL ];then + #RRDTOOL perl module directory + RRD_PERL="/usr/local/rrdtool/lib/perl" + echo "Where is RRD perl modules RRDs.pm ?" + echo -n "default to [$RRD_PERL]:" + read temp + test_answer RRD_PERL $temp + echo "" + fi + +## +## FUNCTION +## + +# When exit on error + +function error() +{ + echo "ERROR" + exit 2 +} + +# install OREON PLUGIN + +function confirm_oreon() +{ + install_oreon_plugins +} + +# installation script + +#check_group_nagios +#check_user_nagios +#check_group_nagiocmd +#confirm_oreon + +## +## INSTALL +## +echo "Users Management" +echo "----------------" +# check for httpd directory +check_httpd_directory +## group apache +check_group_apache +## user apache +check_user_apache +check_group_nagios +check_user_nagios +echo "" + +echo "Other Stuff" +echo "------------" +if test -d $NAGIOS_PLUGIN ; then + echo_success "Nagios libexec directory" "OK" +else + mkdir -p $NAGIOS_PLUGIN > /dev/null + echo_success "Nagios libexec directory created" "OK" +fi + +# installation script + +confirm_oreon +#oreon_post_install + +echo "" +echo "###############################################################################" +echo "# #" +echo "# Report bugs at bugs@oreon-project.org #" +echo "# #" +echo "# Thanks for using OREON. #" +echo "# ----------------------- #" +echo "# Contact : infos@oreon-project.org #" +echo "# http://www.oreon-project.org #" +echo "###############################################################################"