2009-11-05 19:26:54 +01:00
|
|
|
#!/bin/sh
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
# **********************************************************************
|
|
|
|
# Pandora FMS Agent Installer for Unix (generic installer)
|
2010-05-18 18:09:06 +02:00
|
|
|
# (c) 2008-2010 Artica ST
|
|
|
|
# (c) 2008-2010 Sancho Lerena <slerena@gmail.com>
|
2009-11-05 19:26:54 +01:00
|
|
|
#
|
2010-06-07 03:36:45 +02:00
|
|
|
# This is a generic installer for all Unix-like systems.(AIX, HP-UX, SunOS, Linux, FreeBSD)
|
2010-05-18 18:09:06 +02:00
|
|
|
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
# **********************************************************************
|
|
|
|
|
2010-11-15 11:32:23 +01:00
|
|
|
PI_VERSION=3.2
|
|
|
|
PI_BUILD=101115
|
2009-11-05 19:26:54 +01:00
|
|
|
OS_NAME=`uname -s`
|
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
FORCE=0
|
|
|
|
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
PANDORA_HOME=/usr/share/pandora_agent
|
2009-11-05 19:26:54 +01:00
|
|
|
PANDORA_BIN=/usr/bin/pandora_agent
|
2010-12-27 11:18:20 +01:00
|
|
|
PANDORA_EXEC_BIN=/usr/bin/pandora_agent_exec
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
PANDORA_TEMP=/var/spool/pandora
|
|
|
|
PANDORA_CFG=/etc/pandora
|
2009-11-05 19:26:54 +01:00
|
|
|
PANDORA_LOG_DIR=/var/log/pandora
|
|
|
|
PANDORA_LOG=pandora_agent.log
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
TENTACLE=/usr/bin/tentacle_client
|
2010-06-07 03:36:45 +02:00
|
|
|
PANDORA_MAN=/usr/share/man
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
|
|
|
MODE=$1
|
2010-11-19 15:18:34 +01:00
|
|
|
PANDORA_BASE=`echo $2 | sed -e 's/\/$//'`
|
2010-06-18 14:36:19 +02:00
|
|
|
PANDORA_USER=$3
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
# Check for Perl 5.6.x or higher available
|
|
|
|
PERL_VERSION=`perl -v | egrep 'v5.6|v5.7|v5.8|v5.9|v5.1[0-9]' | grep perl`
|
2009-11-05 19:26:54 +01:00
|
|
|
|
|
|
|
if [ -z "$PERL_VERSION" ]
|
|
|
|
then
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Perl 5.6.x or higher is not detected. This is required for Pandora FMS"
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "Detected: $PERL_VERSION "
|
|
|
|
echo "Aborting install..."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
UNIX_KIND=`uname -s`
|
2010-06-07 03:36:45 +02:00
|
|
|
if [ -z "`echo Linux HP-UX SunOS AIX Solaris Darwin BSD bsd FreeBSD | grep \"$UNIX_KIND\"`" ]
|
2009-11-05 19:26:54 +01:00
|
|
|
then
|
|
|
|
echo "This system: '$UNIX_KIND' is not supported by this script"
|
|
|
|
echo "Please make the install yourself as it's described in documentation"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# check for root to do the install
|
|
|
|
if [ -z "`id | grep \"uid=0(root)\"`" ]
|
|
|
|
then
|
|
|
|
echo "You need to be root to do the install. Please made a manual install"
|
|
|
|
echo "if you want to install Pandora FMS agent without root"
|
|
|
|
echo " "
|
|
|
|
echo "Aborting install"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2010-06-18 14:36:19 +02:00
|
|
|
help () {
|
|
|
|
echo "Syntax":
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
echo " "
|
2010-06-18 14:36:19 +02:00
|
|
|
echo " ./pandora_agent_installer < --mode > [ destination_path ] [ user_to_run_as ]"
|
2010-05-18 18:09:06 +02:00
|
|
|
echo " "
|
2010-06-18 14:36:19 +02:00
|
|
|
echo "Modes:"
|
2009-11-05 19:26:54 +01:00
|
|
|
echo " "
|
2010-06-18 14:36:19 +02:00
|
|
|
echo " --force-install To force installation if already installed on system"
|
|
|
|
echo " --install To install Pandora FMS Agent on this system"
|
|
|
|
echo " --uninstall To uninstall/remove Pandora FMS Agent on this System"
|
|
|
|
echo " "
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Some exaples of how to use the installer:"
|
|
|
|
echo " "
|
2009-11-05 19:26:54 +01:00
|
|
|
echo " ./pandora_agent_installer --install"
|
2010-05-18 18:09:06 +02:00
|
|
|
echo " ./pandora_agent_installer --install /opt/pandora"
|
2010-06-18 14:36:19 +02:00
|
|
|
echo " ./pandora_agent_installer --install \"\" pandora"
|
|
|
|
echo " ./pandora_agent_installer --uninstall /opt/pandora"
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
echo " "
|
2010-06-18 14:36:19 +02:00
|
|
|
}
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
uninstall () {
|
2010-06-07 03:36:45 +02:00
|
|
|
OS_NAME=`uname -s`
|
2010-11-15 11:32:23 +01:00
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
2010-06-07 03:36:45 +02:00
|
|
|
PANDORA_HOME=/usr/local/share/pandora_agent
|
|
|
|
PANDORA_BIN=/usr/local/bin/pandora_agent
|
2010-12-27 11:18:20 +01:00
|
|
|
PANDORA_EXEC_BIN=/usr/local/bin/pandora_agent_exec
|
2010-06-07 03:36:45 +02:00
|
|
|
PANDORA_CFG=/usr/local/etc/pandora
|
|
|
|
TENTACLE=/usr/local/bin/tentacle_client
|
|
|
|
PANDORA_MAN=/usr/local/man
|
2010-11-15 11:32:23 +01:00
|
|
|
fi
|
2010-06-07 03:36:45 +02:00
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "Removing Pandora FMS Agent..."
|
2010-05-18 18:09:06 +02:00
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_BIN 2> /dev/null
|
2010-06-18 14:36:19 +02:00
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null
|
2010-02-11 18:21:42 +01:00
|
|
|
|
|
|
|
#Test if exist Pandora Server in this machine
|
2010-05-18 18:09:06 +02:00
|
|
|
if [ -d $PANDORA_BASE$PANDORA_TEMP/data_in ]
|
2010-02-11 18:21:42 +01:00
|
|
|
then
|
|
|
|
echo "You have a Pandora Server in this machine. Then don't delete "$PANDORA_TEMP
|
2010-07-20 13:37:29 +02:00
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_TEMP/data_out 2> /dev/null
|
2010-02-11 18:21:42 +01:00
|
|
|
else
|
2010-05-18 18:09:06 +02:00
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_TEMP 2> /dev/null
|
|
|
|
fi
|
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf 2> /dev/null
|
2009-11-05 19:26:54 +01:00
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
rm -Rf $PANDORA_BASE/etc/init.d/pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE/sbin/init.d/pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE/etc/rc.pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE/etc/rc?.d/S90pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE/sbin/rc?.d/S90pandora_agent_daemon 2> /dev/null
|
2010-11-29 13:50:14 +01:00
|
|
|
rm -Rf $PANDORA_BASE/etc/rc?.d/S90pandora_agent 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE/sbin/rc?.d/S90pandora_agent 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE/etc/rc.d/rc?.d/S90pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE/etc/rc.d/rc?.d/S90pandora_agent 2> /dev/null
|
2010-06-07 03:36:45 +02:00
|
|
|
rm -Rf $PANDORA_BASE/usr/local/etc/rc.d/pandora_agent 2> /dev/null
|
2010-11-29 13:50:14 +01:00
|
|
|
rm -Rf /etc/init.d/pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf /sbin/init.d/pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf /etc/rc.pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf /etc/rc?.d/S90pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf /sbin/rc?.d/S90pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf /etc/rc?.d/S90pandora_agent 2> /dev/null
|
|
|
|
rm -Rf /sbin/rc?.d/S90pandora_agent 2> /dev/null
|
|
|
|
rm -Rf /etc/rc.d/rc?.d/S90pandora_agent_daemon 2> /dev/null
|
|
|
|
rm -Rf /etc/rc.d/rc?.d/S90pandora_agent 2> /dev/null
|
|
|
|
rm -Rf /usr/local/etc/rc.d/pandora_agent 2> /dev/null
|
2009-11-05 19:26:54 +01:00
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_HOME 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_LOG_DIR 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE$TENTACLE 2> /dev/null
|
2009-11-05 19:26:54 +01:00
|
|
|
|
2010-06-07 03:36:45 +02:00
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_MAN/{man1,cat1}/tentacle_client.1.gz 2> /dev/null
|
|
|
|
rm -Rf $PANDORA_BASE$PANDORA_MAN/{man1,cat1}/pandora_agent.1.gz 2> /dev/null
|
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
# Skip delete of /etc/pandora if exists configuration of a server
|
2010-06-07 03:36:45 +02:00
|
|
|
if [ ! -f $PANDORA_BASE/$PANDORA_CFG/pandora_server.conf ]
|
2009-11-05 19:26:54 +01:00
|
|
|
then
|
2010-06-07 03:36:45 +02:00
|
|
|
rm -Rf $PANDORA_BASE/$PANDORA_CFG 2> /dev/null
|
2009-11-05 19:26:54 +01:00
|
|
|
fi
|
|
|
|
|
2010-11-15 11:32:23 +01:00
|
|
|
if [ ! -z "$PANDORA_BASE" ]
|
|
|
|
then
|
|
|
|
echo "Please delete manually $PANDORA_BASE for complete uninstall"
|
|
|
|
fi
|
2010-05-18 18:09:06 +02:00
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
echo " "
|
|
|
|
echo "Done"
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
install () {
|
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
OS_VERSION=`uname -r`
|
|
|
|
OS_NAME=`uname -s`
|
|
|
|
OLDFILENAMETMP=`date +"%Y-%m-%d"`
|
2010-06-07 03:36:45 +02:00
|
|
|
|
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
|
|
|
PANDORA_HOME=/usr/local/share/pandora_agent
|
|
|
|
PANDORA_BIN=/usr/local/bin/pandora_agent
|
2010-12-27 11:18:20 +01:00
|
|
|
PANDORA_EXEC_BIN=/usr/local/bin/pandora_agent_exec
|
2010-06-07 03:36:45 +02:00
|
|
|
PANDORA_CFG=/usr/local/etc/pandora
|
|
|
|
TENTACLE=/usr/local/bin/tentacle_client
|
|
|
|
PANDORA_MAN=/usr/local/man
|
|
|
|
fi
|
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "Detecting Unix distribution: $OS_NAME version $OS_VERSION"
|
2010-05-18 18:09:06 +02:00
|
|
|
if [ -f $PANDORA_BASE$PANDORA_HOME ] && [ "$FORCE" = "0" ]
|
2009-11-05 19:26:54 +01:00
|
|
|
then
|
|
|
|
echo "Seems that default dir already exists. Please use --force to"
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "force installer to install on $PANDORA_BASE$PANDORA_HOME"
|
2009-11-05 19:26:54 +01:00
|
|
|
exit
|
|
|
|
else
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Checking default dir $PANDORA_BASE$PANDORA_HOME..."
|
2009-11-05 19:26:54 +01:00
|
|
|
fi
|
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
if [ -f $PANDORA_BASE$PANDORA_BIN ] && [ "$FORCE" = "0" ]
|
2009-11-05 19:26:54 +01:00
|
|
|
then
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Seems that $PANDORA_BASE$PANDORA_BIN already exists. Please use --force to"
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "force installer to reinstall overwriting it"
|
|
|
|
echo " "
|
|
|
|
exit
|
|
|
|
else
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Checking Pandora FMS Agent on $PANDORA_BASE$PANDORA_BIN...."
|
2009-11-05 19:26:54 +01:00
|
|
|
fi
|
|
|
|
|
2010-11-19 15:18:34 +01:00
|
|
|
# Alter dynamically the daemon launcher and setup the new path
|
|
|
|
# if PANDORA_BASE is customized.
|
|
|
|
|
|
|
|
if [ ! -z "$PANDORA_BASE" ]
|
|
|
|
then
|
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
|
|
|
DAEMON_SCRIPT=FreeBSD/pandora_agent
|
|
|
|
DAEMON_TEMP=pandora_agent_daemon_temp
|
|
|
|
else
|
|
|
|
DAEMON_SCRIPT=pandora_agent_daemon
|
|
|
|
DAEMON_TEMP=pandora_agent_daemon_temp
|
|
|
|
fi
|
|
|
|
|
|
|
|
AGENT_CFG=$OS_NAME/pandora_agent.conf
|
|
|
|
AGENT_CFG_TEMP=$OS_NAME/pandora_agent.conf.temp
|
|
|
|
|
|
|
|
echo $PANDORA_BASE > PANDORA_BASE.temp
|
|
|
|
sed 's/\//\\\//g' PANDORA_BASE.temp > PANDORA_BASE.temp2
|
|
|
|
|
|
|
|
PANDORA_BASE_DECODED=`cat PANDORA_BASE.temp2`
|
|
|
|
rm PANDORA_BASE.temp PANDORA_BASE.temp2
|
|
|
|
|
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
|
|
|
sed -e "s/^PATH\=[.]*/PATH\=$PANDORA_BASE_DECODED\/usr\/local\/bin\:/g" $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
|
|
|
|
|
|
|
sed -e "s/^command\=[.]*/command\=$PANDORA_BASE_DECODED/g" $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
|
|
|
|
|
|
|
sed -e 's/^command_args\=\"[.]*/command_args\=\"$PANDORA_BASE_DECODED/g' $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
|
|
|
|
|
|
|
sed -e 's/^required_files\=\"[.]*/required_files\=\"$PANDORA_BASE_DECODED/g' $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
|
|
|
else
|
|
|
|
sed -e "s/^PATH\=[.]*/PATH\=$PANDORA_BASE_DECODED\/usr\/bin\:/g" $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
|
|
|
|
|
|
|
sed -e "s/^PANDORA_PATH\=[.]*/PANDORA_PATH\=$PANDORA_BASE_DECODED/g" $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
|
|
|
|
|
|
|
sed -e "s/^LOGFILE\=[.]*/LOGFILE\=$PANDORA_BASE_DECODED/g" $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
|
|
|
|
|
|
|
sed -e "s/^DAEMON\=[.]*/DAEMON\=$PANDORA_BASE_DECODED/g" $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
2010-12-16 20:34:22 +01:00
|
|
|
|
|
|
|
sed -e "s/^PANDORA_USER\=.*/PANDORA_USER\=$PANDORA_USER/g" $DAEMON_SCRIPT > $DAEMON_TEMP
|
|
|
|
mv $DAEMON_TEMP $DAEMON_SCRIPT
|
2010-11-19 15:18:34 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
sed -e "s/^temporal [.]*/temporal $PANDORA_BASE_DECODED/g" $AGENT_CFG > $AGENT_CFG_TEMP
|
|
|
|
mv $AGENT_CFG_TEMP $AGENT_CFG
|
|
|
|
|
|
|
|
sed -e "s/^logfile [.]*/logfile $PANDORA_BASE_DECODED/g" $AGENT_CFG > $AGENT_CFG_TEMP
|
|
|
|
mv $AGENT_CFG_TEMP $AGENT_CFG
|
|
|
|
fi
|
|
|
|
echo "Creating Pandora FMS Agent home directory at $PANDORA_BASE$PANDORA_HOME"
|
|
|
|
if [ ! -z "$PANDORA_BASE" ]
|
|
|
|
then
|
|
|
|
mkdir -p $PANDORA_BASE 2> /dev/null
|
|
|
|
mkdir -p $PANDORA_BASE/var/log 2> /dev/null
|
|
|
|
mkdir -p $PANDORA_BASE/$PANDORA_MAN/man1 2> /dev/null
|
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
2010-06-07 03:36:45 +02:00
|
|
|
then
|
2010-11-19 15:18:34 +01:00
|
|
|
mkdir -p $PANDORA_BASE/usr/local/bin 2> /dev/null
|
|
|
|
else
|
|
|
|
mkdir -p $PANDORA_BASE/usr/bin 2> /dev/null
|
2010-06-07 03:36:45 +02:00
|
|
|
fi
|
2010-11-19 15:18:34 +01:00
|
|
|
fi
|
2010-05-18 18:09:06 +02:00
|
|
|
|
|
|
|
mkdir -p $PANDORA_BASE$PANDORA_HOME 2> /dev/null
|
|
|
|
|
|
|
|
# Create directories based on PANDORA_BASE
|
|
|
|
|
|
|
|
mkdir -p $PANDORA_BASE/tmp 2> /dev/null
|
|
|
|
mkdir -p $PANDORA_BASE$PANDORA_TEMP/data_out 2> /dev/null
|
|
|
|
mkdir -p $PANDORA_BASE$PANDORA_CFG 2> /dev/null
|
|
|
|
mkdir -p $PANDORA_BASE$PANDORA_LOG_DIR 2> /dev/null
|
2009-11-05 19:26:54 +01:00
|
|
|
|
2010-06-18 14:36:19 +02:00
|
|
|
# Set the user the agent will run as
|
|
|
|
if [ "$PANDORA_USER" != "" ]
|
|
|
|
then
|
2010-11-19 15:18:34 +01:00
|
|
|
sed -e "s/.*pandora_user .*/pandora_user $PANDORA_USER/" $AGENT_CFG > $AGENT_CFG_TEMP 2> /dev/null && \
|
|
|
|
mv $AGENT_CFG_TEMP $AGENT_CFG
|
2010-06-18 14:36:19 +02:00
|
|
|
chmod 755 pandora_agent_daemon
|
2010-11-19 15:18:34 +01:00
|
|
|
chown -R $PANDORA_USER $PANDORA_BASE
|
2010-09-27 03:51:13 +02:00
|
|
|
else
|
|
|
|
PANDORA_USER="root"
|
2010-06-18 14:36:19 +02:00
|
|
|
fi
|
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
# Create logfile
|
2010-05-18 18:09:06 +02:00
|
|
|
if [ ! -z "`touch $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG`" ]
|
2009-11-05 19:26:54 +01:00
|
|
|
then
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Seems to be a problem generating logfile ($PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG) please check it";
|
2009-11-05 19:26:54 +01:00
|
|
|
else
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Created logfile at $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG..."
|
2009-11-05 19:26:54 +01:00
|
|
|
fi
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "$LOG_TIMESTAMP Pandora FMS installer has created this file at startup" > $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
2009-11-05 19:26:54 +01:00
|
|
|
|
|
|
|
# Copying agent and securing it
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Copying Pandora FMS Agent to $PANDORA_BASE$PANDORA_BIN..."
|
|
|
|
cp pandora_agent $PANDORA_BASE$PANDORA_BIN
|
|
|
|
chmod 755 $PANDORA_BASE$PANDORA_BIN
|
2010-12-27 11:18:20 +01:00
|
|
|
cp pandora_agent_exec $PANDORA_BASE$PANDORA_EXEC_BIN
|
2010-06-18 14:36:19 +02:00
|
|
|
chmod 755 $PANDORA_BASE$PANDORA_EXEC_BIN
|
2010-06-07 03:36:45 +02:00
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
2009-11-05 19:26:54 +01:00
|
|
|
then
|
2011-04-04 12:42:57 +02:00
|
|
|
chown $PANDORA_USER:wheel $PANDORA_BASE$PANDORA_BIN
|
|
|
|
chown $PANDORA_USER:wheel $PANDORA_BASE$PANDORA_EXEC_BIN
|
2010-06-07 03:36:45 +02:00
|
|
|
else
|
2011-04-04 12:42:57 +02:00
|
|
|
chown $PANDORA_USER:root $PANDORA_BASE$PANDORA_BIN
|
|
|
|
chown $PANDORA_USER:root $PANDORA_BASE$PANDORA_EXEC_BIN
|
2010-06-07 03:36:45 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Copying Pandora FMS Agent configuration file to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf..."
|
|
|
|
if [ -f $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf ]
|
|
|
|
then
|
|
|
|
cp $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf.$OLDFILENAMETMP
|
|
|
|
echo "Backing up old configuration file to $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf.$OLDFILENAMETMP"
|
2009-11-05 19:26:54 +01:00
|
|
|
fi
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Copying Pandora FMS Agent plugins to $PANDORA_BASE$PANDORA_HOME/plugins..."
|
|
|
|
cp -r plugins $PANDORA_BASE$PANDORA_HOME
|
|
|
|
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/plugins
|
2010-11-15 11:32:23 +01:00
|
|
|
ln -s $PANDORA_BASE$PANDORA_HOME/plugins $PANDORA_BASE$PANDORA_CFG
|
2010-07-20 12:45:55 +02:00
|
|
|
|
|
|
|
echo "Copying Pandora FMS Agent collections to $PANDORA_BASE$PANDORA_HOME/collections..."
|
|
|
|
cp -r collections $PANDORA_BASE$PANDORA_HOME
|
|
|
|
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections
|
2010-11-15 11:32:23 +01:00
|
|
|
ln -s $PANDORA_BASE$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Copying tentacle client to $PANDORA_BASE$TENTACLE"
|
|
|
|
cp tentacle_client $PANDORA_BASE$TENTACLE
|
|
|
|
chmod 755 $PANDORA_BASE$TENTACLE
|
2011-04-04 17:47:44 +02:00
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
|
|
|
chown $PANDORA_USER:wheel $PANDORA_BASE$TENTACLE
|
|
|
|
else
|
|
|
|
chown $PANDORA_USER:root $PANDORA_BASE$TENTACLE
|
|
|
|
fi
|
|
|
|
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
2010-06-09 13:29:23 +02:00
|
|
|
echo "Installing the Pandora Agent and Tentacle Client manuals"
|
2010-11-15 11:32:23 +01:00
|
|
|
cp man/man1/tentacle_client.1.gz $PANDORA_BASE/$PANDORA_MAN/man1
|
|
|
|
chmod 644 $PANDORA_BASE/$PANDORA_MAN/man1/tentacle_client.1.gz
|
|
|
|
cp man/man1/pandora_agent.1.gz $PANDORA_BASE/$PANDORA_MAN/man1
|
|
|
|
chmod 644 $PANDORA_BASE/$PANDORA_MAN/man1/pandora_agent.1.gz
|
2010-05-12 17:03:10 +02:00
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Setting secure permissions and ownership for all Pandora FMS Agent files..."
|
2010-07-20 13:37:29 +02:00
|
|
|
chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_HOME
|
|
|
|
chmod -R 700 $PANDORA_BASE$PANDORA_TEMP/data_out
|
2010-05-18 18:09:06 +02:00
|
|
|
chmod 640 $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
2010-06-07 03:36:45 +02:00
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
2010-11-15 11:32:23 +01:00
|
|
|
chown $PANDORA_USER:wheel $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
|
|
|
chown $PANDORA_USER:daemon $PANDORA_BASE$PANDORA_TEMP
|
|
|
|
chmod -R 770 $PANDORA_BASE$PANDORA_TEMP
|
|
|
|
chmod 775 $PANDORA_BASE$PANDORA_TEMP
|
2010-06-07 03:36:45 +02:00
|
|
|
else
|
2011-04-04 12:42:57 +02:00
|
|
|
chown $PANDORA_USER:root $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
2010-06-07 03:36:45 +02:00
|
|
|
fi
|
2010-05-18 18:09:06 +02:00
|
|
|
|
2010-11-19 15:18:34 +01:00
|
|
|
echo "Copying default agent configuration to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf"
|
2010-05-18 18:09:06 +02:00
|
|
|
|
|
|
|
cp $OS_NAME/pandora_agent.conf $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf
|
|
|
|
chmod 600 $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf
|
2010-06-18 14:36:19 +02:00
|
|
|
chown $PANDORA_USER $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf
|
|
|
|
chmod 711 $PANDORA_BASE$PANDORA_LOG_DIR
|
|
|
|
chown $PANDORA_USER $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
2009-11-05 19:26:54 +01:00
|
|
|
|
2010-06-07 03:36:45 +02:00
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
|
|
|
echo "Linking start-up daemon script 'pandora_agent' on $OS_NAME";
|
|
|
|
else
|
|
|
|
echo "Linking start-up daemon script 'pandora_agent_daemon' on $OS_NAME";
|
|
|
|
fi
|
2009-11-05 19:26:54 +01:00
|
|
|
|
|
|
|
if [ "$OS_NAME" = "AIX" ]
|
|
|
|
then
|
|
|
|
cp pandora_agent_daemon /etc/rc.pandora_agent_daemon
|
|
|
|
ln -s /etc/rc.pandora_agent_daemon /etc/rc.d/rc2.d/S90pandora_agent_daemon
|
2010-12-16 20:34:22 +01:00
|
|
|
chmod 755 $PANDORA_STARTUP
|
|
|
|
chown root:root $PANDORA_STARTUP
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "Pandora FMS agent has been included in /etc/rc.d/rc2.d/S90pandora_agent_daemon"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $OS_NAME = "HP-UX" ]
|
|
|
|
then
|
2010-11-15 11:32:23 +01:00
|
|
|
PANDORA_STARTUP=/sbin/init.d/pandora_agent_daemon
|
2010-05-18 18:09:06 +02:00
|
|
|
cp pandora_agent_daemon $PANDORA_STARTUP
|
|
|
|
ln -s /sbin/init.d/pandora_agent_daemon /sbin/rc3.d/S90pandora_agent_daemon 2> /dev/null
|
|
|
|
ln -s /sbin/init.d/pandora_agent_daemon /sbin/rc2.d/S90pandora_agent_daemon 2> /dev/null
|
2010-12-16 20:34:22 +01:00
|
|
|
chmod 755 $PANDORA_STARTUP
|
|
|
|
chown root:root $PANDORA_STARTUP
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "Pandora FMS agent has been included in /sbin/rcX.d/S90pandora_agent_daemon"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $OS_NAME = "SunOS" ]
|
|
|
|
then
|
2010-11-15 11:32:23 +01:00
|
|
|
PANDORA_STARTUP=/etc/init.d/pandora_agent_daemon
|
2010-05-18 18:09:06 +02:00
|
|
|
cp pandora_agent_daemon $PANDORA_STARTUP
|
|
|
|
ln -s /etc/init.d/pandora_agent_daemon /etc/rc2.d/S90pandora_agent_daemon 2> /dev/null
|
2010-12-16 20:34:22 +01:00
|
|
|
chmod 755 $PANDORA_STARTUP
|
|
|
|
chown root:root $PANDORA_STARTUP
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "Pandora FMS agent has been included in /etc/rc2.d/S90pandora_agent_daemon"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $OS_NAME = "Linux" ]
|
|
|
|
then
|
2010-11-15 11:32:23 +01:00
|
|
|
PANDORA_STARTUP=/etc/init.d/pandora_agent_daemon
|
2010-05-18 18:09:06 +02:00
|
|
|
cp pandora_agent_daemon $PANDORA_STARTUP
|
2009-11-05 19:26:54 +01:00
|
|
|
if [ -d /etc/rc.d/ ]
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
then
|
2010-05-18 18:09:06 +02:00
|
|
|
ln -s /etc/init.d/pandora_agent_daemon /etc/rc.d/rc2.d/S90pandora_agent 2> /dev/null
|
|
|
|
ln -s /etc/init.d/pandora_agent_daemon /etc/rc.d/rc3.d/S90pandora_agent 2> /dev/null
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
else
|
2010-05-18 18:09:06 +02:00
|
|
|
ln -s /etc/init.d/pandora_agent_daemon /etc/rc2.d/S90pandora_agent 2> /dev/null
|
|
|
|
ln -s /etc/init.d/pandora_agent_daemon /etc/rc2.d/S90pandora_agent 2> /dev/null
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
fi
|
2010-12-16 20:34:22 +01:00
|
|
|
chmod 755 $PANDORA_STARTUP
|
|
|
|
chown root:root $PANDORA_STARTUP
|
2009-11-05 19:26:54 +01:00
|
|
|
fi
|
|
|
|
|
2010-06-07 03:36:45 +02:00
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
2010-12-16 20:34:22 +01:00
|
|
|
PANDORA_STARTUP=/usr/local/etc/rc.d/pandora_agent
|
2010-06-07 03:36:45 +02:00
|
|
|
cp FreeBSD/pandora_agent $PANDORA_STARTUP
|
2010-06-14 04:38:10 +02:00
|
|
|
chmod 555 $PANDORA_STARTUP
|
|
|
|
chown root:wheel $PANDORA_STARTUP
|
2010-06-07 03:36:45 +02:00
|
|
|
fi
|
|
|
|
|
2010-06-09 13:29:23 +02:00
|
|
|
echo "Installing the Pandora Agent and Tentacle Client manuals"
|
2010-11-15 11:32:23 +01:00
|
|
|
cp man/man1/tentacle_client.1.gz $PANDORA_BASE/$PANDORA_MAN/man1
|
|
|
|
chmod 644 $PANDORA_BASE/$PANDORA_MAN/man1/tentacle_client.1.gz
|
|
|
|
cp man/man1/pandora_agent.1.gz $PANDORA_BASE/$PANDORA_MAN/man1
|
|
|
|
chmod 644 $PANDORA_BASE/$PANDORA_MAN/man1/pandora_agent.1.gz
|
2010-05-12 17:03:10 +02:00
|
|
|
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "Done."
|
|
|
|
echo " "
|
|
|
|
echo "You have your startup script ready at $PANDORA_STARTUP"
|
|
|
|
echo " "
|
|
|
|
echo "Tentacle is the default transfer mode since 2.0 version."
|
2010-11-15 11:32:23 +01:00
|
|
|
echo " "
|
2009-11-05 19:26:54 +01:00
|
|
|
echo "If you want to use SSH, firstly you need to copy your public SSH keys "
|
|
|
|
echo " ($HOME/.ssh/id_dsa) under /home/pandora/.ssh/authorized_keys "
|
|
|
|
echo "on your Pandora FMS Server host"
|
|
|
|
echo " "
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "You also need to setup your $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf config file"
|
2009-11-05 19:26:54 +01:00
|
|
|
echo " "
|
2010-06-07 03:36:45 +02:00
|
|
|
if [ "$OS_NAME" = "FreeBSD" ]
|
|
|
|
then
|
2010-11-15 11:32:23 +01:00
|
|
|
echo "Define 'pandora_agent_enable=\"YES\"' in /etc/rc.conf to enable the daemon."
|
2010-06-07 03:36:45 +02:00
|
|
|
else
|
2010-11-15 11:32:23 +01:00
|
|
|
echo "Check your startup configuration to be sure Pandora FMS Agent is ready "
|
|
|
|
echo "to start automatically when system restarts":
|
2010-06-07 03:36:45 +02:00
|
|
|
fi
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-06-18 14:36:19 +02:00
|
|
|
if [ ! -f "pandora_agent" ]
|
|
|
|
then
|
2010-05-18 18:09:06 +02:00
|
|
|
echo " "
|
2010-06-18 14:36:19 +02:00
|
|
|
echo "Execute installer from the directory where you have your files. "
|
|
|
|
help
|
|
|
|
exit 1
|
|
|
|
fi
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
|
|
|
# Script banner at start
|
|
|
|
echo " "
|
2010-05-18 18:09:06 +02:00
|
|
|
echo "Pandora FMS Agent UNIX Installer $PI_VERSION $PI_BUILD (c) 2008-2010 ArticaST"
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
echo "This program is licensed under GPL2 Terms. http://pandorafms.com"
|
|
|
|
echo " "
|
|
|
|
|
2010-05-18 18:09:06 +02:00
|
|
|
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
case "$MODE" in
|
|
|
|
|
|
|
|
'--force-install')
|
2010-11-15 11:32:23 +01:00
|
|
|
FORCE=1
|
|
|
|
install
|
|
|
|
exit
|
|
|
|
;;
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
|
|
|
'--install')
|
2010-11-15 11:32:23 +01:00
|
|
|
install
|
|
|
|
exit
|
|
|
|
;;
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
|
|
|
'--uninstall')
|
2010-11-15 11:32:23 +01:00
|
|
|
uninstall
|
|
|
|
exit
|
|
|
|
;;
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
|
|
|
|
*)
|
2010-11-15 11:32:23 +01:00
|
|
|
help
|
|
|
|
;;
|
2009-09-14 Ramon Novoa <rnovoa@artica.es>
* unix, unix/pandora_agent_installer,
unix/plugins, unix/pandora_agent,
unix/pandora_agent_daemon, unix/AUTHORS,
unix/pandora_agent.conf, unix/COPYING,
unix/pandora_agent.spec, unix/tentacle_client,
unix/README: Added to repository. Generic Pandora FMS Unix agent
written in PERL. The skeleton files where copied from the linux
subdirectory.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-14 17:57:00 +02:00
|
|
|
esac
|
|
|
|
|