mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
2011-04-11 Dario Rodriguez <dario.rodriguez@artica.es>
* pandora_agent_installer: Added code to install tentacle_server with pandora agent. * AIX/pandora_agent.conf: Added two new parameters proxy_mode and proxy_user. * tentacle_server: Added tentacle server with proxy support. * pandora_agent_daemon: Add feature to stop tentacle_server when pandora agent stops. * Linux/pandora_agent.conf: Added two new parameters proxy_mode and proxy_user. * HP-UX/pandora_agent.conf: Added two new parameters proxy_mode and proxy_user. * pandora_agent: Added support to tentacle_server and proxy_mode. * SunOS/pandora_agent.conf: Added two new parameters proxy_mode and proxy_user. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4185 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
19ea476921
commit
827898cc21
@ -82,6 +82,12 @@ transfer_mode tentacle
|
|||||||
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
||||||
# remote_config 1
|
# remote_config 1
|
||||||
|
|
||||||
|
# If set to 1 start babel agent in proxy mode
|
||||||
|
# proxy_mode 1
|
||||||
|
|
||||||
|
# User which runs tentacle server in proxy mode. Required with if proxy mode is enable (by default babel)
|
||||||
|
# proxy_user pandora
|
||||||
|
|
||||||
# User the agent will run as
|
# User the agent will run as
|
||||||
#pandora_user root
|
#pandora_user root
|
||||||
|
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
2011-04-11 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||||
|
|
||||||
|
* pandora_agent_installer: Added code to install tentacle_server with
|
||||||
|
pandora agent.
|
||||||
|
* AIX/pandora_agent.conf: Added two new parameters proxy_mode and
|
||||||
|
proxy_user.
|
||||||
|
* tentacle_server: Added tentacle server with proxy support.
|
||||||
|
* pandora_agent_daemon: Add feature to stop tentacle_server when
|
||||||
|
pandora agent stops.
|
||||||
|
* Linux/pandora_agent.conf: Added two new parameters proxy_mode and
|
||||||
|
proxy_user.
|
||||||
|
* HP-UX/pandora_agent.conf: Added two new parameters proxy_mode and
|
||||||
|
proxy_user.
|
||||||
|
* pandora_agent: Added support to tentacle_server and proxy_mode.
|
||||||
|
* SunOS/pandora_agent.conf: Added two new parameters proxy_mode and
|
||||||
|
proxy_user.
|
||||||
|
|
||||||
2011-04-04 Dario Rodriguez <dario.rodriguez@artica.es>
|
2011-04-04 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||||
|
|
||||||
* pandora_agent_installer: Fixed an error with chown in AIX OS.
|
* pandora_agent_installer: Fixed an error with chown in AIX OS.
|
||||||
|
@ -82,6 +82,12 @@ transfer_mode tentacle
|
|||||||
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
||||||
# remote_config 1
|
# remote_config 1
|
||||||
|
|
||||||
|
# If set to 1 start babel agent in proxy mode
|
||||||
|
# proxy_mode 1
|
||||||
|
|
||||||
|
# User which runs tentacle server in proxy mode. Required with if proxy mode is enable (by default babel)
|
||||||
|
# proxy_user pandora
|
||||||
|
|
||||||
# User the agent will run as
|
# User the agent will run as
|
||||||
#pandora_user root
|
#pandora_user root
|
||||||
|
|
||||||
|
@ -97,6 +97,12 @@ transfer_mode tentacle
|
|||||||
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
||||||
#remote_config 1
|
#remote_config 1
|
||||||
|
|
||||||
|
# If set to 1 start babel agent in proxy mode
|
||||||
|
# proxy_mode 1
|
||||||
|
|
||||||
|
# User which runs tentacle server in proxy mode. Required with if proxy mode is enable (by default babel)
|
||||||
|
# proxy_user pandora
|
||||||
|
|
||||||
# Number of threads to execute modules in parallel
|
# Number of threads to execute modules in parallel
|
||||||
#agent_threads 1
|
#agent_threads 1
|
||||||
|
|
||||||
|
@ -82,6 +82,12 @@ transfer_mode tentacle
|
|||||||
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
||||||
# remote_config 1
|
# remote_config 1
|
||||||
|
|
||||||
|
# If set to 1 start babel agent in proxy mode
|
||||||
|
# proxy_mode 1
|
||||||
|
|
||||||
|
# User which runs tentacle server in proxy mode. Required with if proxy mode is enable (by default babel)
|
||||||
|
# proxy_user pandora
|
||||||
|
|
||||||
# User the agent will run as
|
# User the agent will run as
|
||||||
#pandora_user root
|
#pandora_user root
|
||||||
|
|
||||||
|
@ -148,7 +148,9 @@ my %Conf = (
|
|||||||
'agent_threads' => 1,
|
'agent_threads' => 1,
|
||||||
'udp_server_port' => 41122,
|
'udp_server_port' => 41122,
|
||||||
'udp_server_auth_address' => '0.0.0.0',
|
'udp_server_auth_address' => '0.0.0.0',
|
||||||
'udp_server' => 0
|
'udp_server' => 0,
|
||||||
|
'proxy_mode' => 0,
|
||||||
|
'proxy_user' => 'pandora'
|
||||||
);
|
);
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
@ -608,6 +610,28 @@ sub check_remote_config () {
|
|||||||
`renice "$Conf{'pandora_nice'}" "$PID"`;
|
`renice "$Conf{'pandora_nice'}" "$PID"`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# SUB launch_tentacle_proxy
|
||||||
|
# Launchs tentacle server in proxy mode.
|
||||||
|
################################################################################
|
||||||
|
sub launch_tentacle_proxy () {
|
||||||
|
|
||||||
|
# Check if proxy mode is enable.
|
||||||
|
if ($Conf{'proxy_mode'}) {
|
||||||
|
|
||||||
|
my $auxPid = fork();
|
||||||
|
|
||||||
|
if (! $auxPid) {
|
||||||
|
|
||||||
|
my $new_process = "sudo -u ".$Conf{'proxy_user'}." tentacle_server -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'};
|
||||||
|
|
||||||
|
log_message ('setup', 'Proxy mode enabled');
|
||||||
|
|
||||||
|
exec ($new_process);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Delete old collections and download new collections.
|
# Delete old collections and download new collections.
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -1379,6 +1403,9 @@ sleep ($Conf{'delayed_startup'});
|
|||||||
my $PID = $$;
|
my $PID = $$;
|
||||||
`renice "$Conf{'pandora_nice'}" "$PID"`;
|
`renice "$Conf{'pandora_nice'}" "$PID"`;
|
||||||
|
|
||||||
|
#Launch tentacle server in proxy mode if needed
|
||||||
|
launch_tentacle_proxy();
|
||||||
|
|
||||||
# Add the plugins directory to the PATH
|
# Add the plugins directory to the PATH
|
||||||
$ENV{'PATH'} .= ":$ConfDir/plugins";
|
$ENV{'PATH'} .= ":$ConfDir/plugins";
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
||||||
PANDORA_PATH=/etc/pandora
|
PANDORA_PATH=/etc/pandora
|
||||||
DAEMON=/usr/bin/pandora_agent
|
DAEMON=/usr/bin/pandora_agent
|
||||||
|
DAEMON_TENTACLE=/usr/bin/tentacle_server
|
||||||
LOGFILE=/var/log/pandora/pandora_agent.log
|
LOGFILE=/var/log/pandora/pandora_agent.log
|
||||||
PANDORA_USER=root
|
PANDORA_USER=root
|
||||||
|
|
||||||
@ -59,6 +60,19 @@ pidof_pandora () {
|
|||||||
echo $PANDORA_PID
|
echo $PANDORA_PID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pidof_tentacle () {
|
||||||
|
COLUMNS=400
|
||||||
|
OS_NAME=`uname -s`
|
||||||
|
if [ $OS_NAME = "HP-UX" ]
|
||||||
|
then
|
||||||
|
TENTACLE_PID=`ps -ex | grep "$DAEMON_TENTACLE" | grep -v grep | head -1 | awk '{ print $1 }'`
|
||||||
|
else
|
||||||
|
TENTACLE_PID=`ps -Af | grep "$DAEMON_TENTACLE" | grep -v grep | head -1 | awk '{ print $2 }'`
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $TENTACLE_PID
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -f $DAEMON ]
|
if [ ! -f $DAEMON ]
|
||||||
then
|
then
|
||||||
echo "Pandora FMS Agent not found at $DAEMON, please check setup"
|
echo "Pandora FMS Agent not found at $DAEMON, please check setup"
|
||||||
@ -90,6 +104,13 @@ case "$1" in
|
|||||||
echo "Stopping Pandora Agent."
|
echo "Stopping Pandora Agent."
|
||||||
su $PANDORA_USER -c "kill -9 $PANDORA_PID >/dev/null 2>&1"
|
su $PANDORA_USER -c "kill -9 $PANDORA_PID >/dev/null 2>&1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
TENTACLE_PID=`pidof_tentacle`
|
||||||
|
if [ ! -z "$TENTACLE_PID" ]
|
||||||
|
then
|
||||||
|
echo "Stopping Tentacle Server."
|
||||||
|
kill $TENTACLE_PID > /dev/null 2>&1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
status)
|
status)
|
||||||
|
@ -23,6 +23,7 @@ PANDORA_CFG=/etc/pandora
|
|||||||
PANDORA_LOG_DIR=/var/log/pandora
|
PANDORA_LOG_DIR=/var/log/pandora
|
||||||
PANDORA_LOG=pandora_agent.log
|
PANDORA_LOG=pandora_agent.log
|
||||||
TENTACLE=/usr/bin/tentacle_client
|
TENTACLE=/usr/bin/tentacle_client
|
||||||
|
TENTACLE_SERVER=/usr/bin/tentacle_server
|
||||||
PANDORA_MAN=/usr/share/man
|
PANDORA_MAN=/usr/share/man
|
||||||
|
|
||||||
MODE=$1
|
MODE=$1
|
||||||
@ -88,6 +89,7 @@ uninstall () {
|
|||||||
PANDORA_EXEC_BIN=/usr/local/bin/pandora_agent_exec
|
PANDORA_EXEC_BIN=/usr/local/bin/pandora_agent_exec
|
||||||
PANDORA_CFG=/usr/local/etc/pandora
|
PANDORA_CFG=/usr/local/etc/pandora
|
||||||
TENTACLE=/usr/local/bin/tentacle_client
|
TENTACLE=/usr/local/bin/tentacle_client
|
||||||
|
TENTACLE_SERVER=/usr/local/bin/tentacle_server
|
||||||
PANDORA_MAN=/usr/local/man
|
PANDORA_MAN=/usr/local/man
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -102,6 +104,7 @@ uninstall () {
|
|||||||
rm -Rf $PANDORA_BASE$PANDORA_TEMP/data_out 2> /dev/null
|
rm -Rf $PANDORA_BASE$PANDORA_TEMP/data_out 2> /dev/null
|
||||||
else
|
else
|
||||||
rm -Rf $PANDORA_BASE$PANDORA_TEMP 2> /dev/null
|
rm -Rf $PANDORA_BASE$PANDORA_TEMP 2> /dev/null
|
||||||
|
rm -Rf $PANDORA_BASE$TENTACLE_SERVER 2> /dev/null
|
||||||
fi
|
fi
|
||||||
rm -Rf $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf 2> /dev/null
|
rm -Rf $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf 2> /dev/null
|
||||||
|
|
||||||
@ -161,6 +164,7 @@ install () {
|
|||||||
PANDORA_EXEC_BIN=/usr/local/bin/pandora_agent_exec
|
PANDORA_EXEC_BIN=/usr/local/bin/pandora_agent_exec
|
||||||
PANDORA_CFG=/usr/local/etc/pandora
|
PANDORA_CFG=/usr/local/etc/pandora
|
||||||
TENTACLE=/usr/local/bin/tentacle_client
|
TENTACLE=/usr/local/bin/tentacle_client
|
||||||
|
TENTACLE_SERVER=/usr/local/bin/tentacle_server
|
||||||
PANDORA_MAN=/usr/local/man
|
PANDORA_MAN=/usr/local/man
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -317,7 +321,17 @@ install () {
|
|||||||
cp -r collections $PANDORA_BASE$PANDORA_HOME
|
cp -r collections $PANDORA_BASE$PANDORA_HOME
|
||||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections
|
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections
|
||||||
ln -s $PANDORA_BASE$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG
|
ln -s $PANDORA_BASE$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG
|
||||||
|
|
||||||
|
echo "Copying tentacle server to $PANDORA_BASE$TENTACLE_SERVER"
|
||||||
|
cp tentacle_server $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
|
||||||
|
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
|
||||||
|
1473
pandora_agents/unix/tentacle_server
Executable file
1473
pandora_agents/unix/tentacle_server
Executable file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user