2011-12-07 KIKUCHI Koichiro <koichiro@rworks.jp>
* pandora_agent_installer: Removed duplicated lines and spaces to tabs. Also removed lines that set group to wheel (gid of wheel is 0). * plugins/files_indir: Added support for FreeBSD. * plugins/pandora_update: Fixed $conf_path for FreeBSD and spaces to tabs. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5237 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
916127733e
commit
8d487fd13e
|
@ -1,3 +1,11 @@
|
||||||
|
2011-12-07 KIKUCHI Koichiro <koichiro@rworks.jp>
|
||||||
|
|
||||||
|
* pandora_agent_installer: Removed duplicated lines and spaces to
|
||||||
|
tabs. Also removed lines that set group to wheel (gid of wheel is 0).
|
||||||
|
* plugins/files_indir: Added support for FreeBSD.
|
||||||
|
* plugins/pandora_update: Fixed $conf_path for FreeBSD and spaces
|
||||||
|
to tabs.
|
||||||
|
|
||||||
2011-11-15 Ramon Novoa <rnovoa@artica.es>
|
2011-11-15 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* pandora_agent: Re-wrote broker agent code (was not working properly).
|
* pandora_agent: Re-wrote broker agent code (was not working properly).
|
||||||
|
|
|
@ -171,7 +171,7 @@ install () {
|
||||||
echo "Detecting Unix distribution: $OS_NAME version $OS_VERSION"
|
echo "Detecting Unix distribution: $OS_NAME version $OS_VERSION"
|
||||||
if [ -f $PANDORA_BASE$PANDORA_HOME ] && [ "$FORCE" = "0" ]
|
if [ -f $PANDORA_BASE$PANDORA_HOME ] && [ "$FORCE" = "0" ]
|
||||||
then
|
then
|
||||||
echo "Seems that default dir already exists. Please use --force to"
|
echo "Seems that default dir already exists. Please use --force-install to"
|
||||||
echo "force installer to install on $PANDORA_BASE$PANDORA_HOME"
|
echo "force installer to install on $PANDORA_BASE$PANDORA_HOME"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
|
@ -180,7 +180,7 @@ install () {
|
||||||
|
|
||||||
if [ -f $PANDORA_BASE$PANDORA_BIN ] && [ "$FORCE" = "0" ]
|
if [ -f $PANDORA_BASE$PANDORA_BIN ] && [ "$FORCE" = "0" ]
|
||||||
then
|
then
|
||||||
echo "Seems that $PANDORA_BASE$PANDORA_BIN already exists. Please use --force to"
|
echo "Seems that $PANDORA_BASE$PANDORA_BIN already exists. Please use --force-install to"
|
||||||
echo "force installer to reinstall overwriting it"
|
echo "force installer to reinstall overwriting it"
|
||||||
echo " "
|
echo " "
|
||||||
exit
|
exit
|
||||||
|
@ -296,14 +296,8 @@ install () {
|
||||||
chmod 755 $PANDORA_BASE$PANDORA_BIN
|
chmod 755 $PANDORA_BASE$PANDORA_BIN
|
||||||
cp pandora_agent_exec $PANDORA_BASE$PANDORA_EXEC_BIN
|
cp pandora_agent_exec $PANDORA_BASE$PANDORA_EXEC_BIN
|
||||||
chmod 755 $PANDORA_BASE$PANDORA_EXEC_BIN
|
chmod 755 $PANDORA_BASE$PANDORA_EXEC_BIN
|
||||||
if [ "$OS_NAME" = "FreeBSD" ]
|
|
||||||
then
|
|
||||||
chown $PANDORA_USER:wheel $PANDORA_BASE$PANDORA_BIN
|
|
||||||
chown $PANDORA_USER:wheel $PANDORA_BASE$PANDORA_EXEC_BIN
|
|
||||||
else
|
|
||||||
chown $PANDORA_USER:0 $PANDORA_BASE$PANDORA_BIN
|
chown $PANDORA_USER:0 $PANDORA_BASE$PANDORA_BIN
|
||||||
chown $PANDORA_USER:0 $PANDORA_BASE$PANDORA_EXEC_BIN
|
chown $PANDORA_USER:0 $PANDORA_BASE$PANDORA_EXEC_BIN
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Copying Pandora FMS Agent configuration file to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf..."
|
echo "Copying Pandora FMS Agent configuration file to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf..."
|
||||||
if [ -f $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf ]
|
if [ -f $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf ]
|
||||||
|
@ -325,23 +319,12 @@ install () {
|
||||||
echo "Copying tentacle server to $PANDORA_BASE$TENTACLE_SERVER"
|
echo "Copying tentacle server to $PANDORA_BASE$TENTACLE_SERVER"
|
||||||
cp tentacle_server $PANDORA_BASE$TENTACLE_SERVER
|
cp tentacle_server $PANDORA_BASE$TENTACLE_SERVER
|
||||||
chmod 755 $PANDORA_BASE$TENTACLE_SERVER
|
chmod 755 $PANDORA_BASE$TENTACLE_SERVER
|
||||||
if [ "$OS_NAME" = "FreeBSD" ]
|
|
||||||
then
|
|
||||||
chown $PANDORA_USER:wheel $PANDORA_BASE$TENTACLE_SERVER
|
|
||||||
else
|
|
||||||
chown $PANDORA_USER:0 $PANDORA_BASE$TENTACLE_SERVER
|
chown $PANDORA_USER:0 $PANDORA_BASE$TENTACLE_SERVER
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Copying tentacle client to $PANDORA_BASE$TENTACLE"
|
echo "Copying tentacle client to $PANDORA_BASE$TENTACLE"
|
||||||
cp tentacle_client $PANDORA_BASE$TENTACLE
|
cp tentacle_client $PANDORA_BASE$TENTACLE
|
||||||
chmod 755 $PANDORA_BASE$TENTACLE
|
chmod 755 $PANDORA_BASE$TENTACLE
|
||||||
if [ "$OS_NAME" = "FreeBSD" ]
|
|
||||||
then
|
|
||||||
chown $PANDORA_USER:wheel $PANDORA_BASE$TENTACLE
|
|
||||||
else
|
|
||||||
chown $PANDORA_USER:0 $PANDORA_BASE$TENTACLE
|
chown $PANDORA_USER:0 $PANDORA_BASE$TENTACLE
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo "Installing the Pandora Agent and Tentacle Client manuals"
|
echo "Installing the Pandora Agent and Tentacle Client manuals"
|
||||||
cp man/man1/tentacle_client.1.gz $PANDORA_BASE/$PANDORA_MAN/man1
|
cp man/man1/tentacle_client.1.gz $PANDORA_BASE/$PANDORA_MAN/man1
|
||||||
|
@ -353,14 +336,12 @@ install () {
|
||||||
chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_HOME
|
chown -R $PANDORA_USER $PANDORA_BASE$PANDORA_HOME
|
||||||
chmod -R 700 $PANDORA_BASE$PANDORA_TEMP/data_out
|
chmod -R 700 $PANDORA_BASE$PANDORA_TEMP/data_out
|
||||||
chmod 640 $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
chmod 640 $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
||||||
|
chown $PANDORA_USER:0 $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
||||||
if [ "$OS_NAME" = "FreeBSD" ]
|
if [ "$OS_NAME" = "FreeBSD" ]
|
||||||
then
|
then
|
||||||
chown $PANDORA_USER:wheel $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
|
||||||
chown $PANDORA_USER:daemon $PANDORA_BASE$PANDORA_TEMP
|
chown $PANDORA_USER:daemon $PANDORA_BASE$PANDORA_TEMP
|
||||||
chmod -R 770 $PANDORA_BASE$PANDORA_TEMP
|
chmod -R 770 $PANDORA_BASE$PANDORA_TEMP
|
||||||
chmod 775 $PANDORA_BASE$PANDORA_TEMP
|
chmod 775 $PANDORA_BASE$PANDORA_TEMP
|
||||||
else
|
|
||||||
chown $PANDORA_USER:0 $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Copying default agent configuration to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf"
|
echo "Copying default agent configuration to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf"
|
||||||
|
@ -432,12 +413,6 @@ install () {
|
||||||
chown root:wheel $PANDORA_STARTUP
|
chown root:wheel $PANDORA_STARTUP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing the Pandora Agent and Tentacle Client manuals"
|
|
||||||
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
|
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
echo " "
|
echo " "
|
||||||
echo "You have your startup script ready at $PANDORA_STARTUP"
|
echo "You have your startup script ready at $PANDORA_STARTUP"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Syntax:
|
# Syntax:
|
||||||
#
|
#
|
||||||
|
@ -13,10 +13,14 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DIRE=$1
|
DIRE=$1
|
||||||
|
if [ `uname -s` = "FreeBSD" ];then
|
||||||
|
DIRETMP=`echo $DIRE | /sbin/md5`;
|
||||||
|
else
|
||||||
DIRETMP=`echo $DIRE | md5sum | awk '{ print $1 }'`
|
DIRETMP=`echo $DIRE | md5sum | awk '{ print $1 }'`
|
||||||
|
fi
|
||||||
DIRETMP=/tmp/$DIRETMP
|
DIRETMP=/tmp/$DIRETMP
|
||||||
|
|
||||||
CURRENT=`ls -la ${DIRE} | wc -l`
|
CURRENT=`ls -la ${DIRE} | wc -l | tr -d ' '`
|
||||||
|
|
||||||
if [ -e $DIRETMP ]
|
if [ -e $DIRETMP ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -145,18 +145,17 @@ if (defined($ARGV[1])) {
|
||||||
# Location of binaries
|
# Location of binaries
|
||||||
|
|
||||||
# Unix
|
# Unix
|
||||||
my $running_binary;
|
my ($running_binary, $updated_binary, $conf_path);
|
||||||
my $updated_binary;
|
|
||||||
if ($^O eq 'freebsd') {
|
if ($^O eq 'freebsd') {
|
||||||
$running_binary = $opt_dir."/usr/local/bin/pandora_agent";
|
$running_binary = $opt_dir."/usr/local/bin/pandora_agent";
|
||||||
$updated_binary = $opt_dir."/usr/local/etc/pandora/collections/$fc_path/pandora_agent";
|
$updated_binary = $opt_dir."/usr/local/etc/pandora/collections/$fc_path/pandora_agent";
|
||||||
|
$conf_path = $opt_dir."/usr/local/etc/pandora";
|
||||||
} else {
|
} else {
|
||||||
$running_binary = $opt_dir."/usr/bin/pandora_agent";
|
$running_binary = $opt_dir."/usr/bin/pandora_agent";
|
||||||
$updated_binary = $opt_dir."/etc/pandora/collections/$fc_path/pandora_agent";
|
$updated_binary = $opt_dir."/etc/pandora/collections/$fc_path/pandora_agent";
|
||||||
|
$conf_path = $opt_dir."/etc/pandora";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $conf_path = $opt_dir."/etc/pandora";
|
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
|
|
||||||
#my $running_binary = $base_path."/../PandoraAgent.exe";
|
#my $running_binary = $base_path."/../PandoraAgent.exe";
|
||||||
|
|
Loading…
Reference in New Issue