diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 1d0774827a..de0b0bf7c0 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,8 @@ +2008-03-11 Ramon Novoa + + * linux/pandora_agent: Added support for Tentacle file transfers. + * linux/pandora_agent.conf: Added Tentacle specific options. + 2008-03-11 Manuel Arostegui * linux/pandora_agent_daemon: Added pidof checking to diff --git a/pandora_agents/linux/pandora_agent b/pandora_agents/linux/pandora_agent index 8a7f073e22..93a5822605 100755 --- a/pandora_agents/linux/pandora_agent +++ b/pandora_agents/linux/pandora_agent @@ -130,6 +130,34 @@ do PANDORA_NICE=`echo $a | awk '{ print $2 }' ` echo "$TIMESTAMP - [SETUP] - PandoraFMS Nice is $PANDORA_NICE" >> $PANDORA_LOGFILE fi + # Tentacle options + if [ ! -z "`echo $a | grep -e '^server_pwd'`" ] + then + SERVER_PWD=`echo $a | awk '{ print $2 }' ` + if [ ! -z "$SERVER_PWD" ] + then + TENTACLE_OPTS="-x $SERVER_PWD $TENTACLE_OPTS" + echo "$TIMESTAMP - [SETUP] - Tentacle server password set" >> $PANDORA_LOGFILE + fi + fi + if [ ! -z "`echo $a | grep -e '^server_ssl'`" ] + then + SERVER_SSL=`echo $a | awk '{ print $2 }' ` + if [ "$SERVER_SSL" == "yes" ] + then + TENTACLE_OPTS="-c $TENTACLE_OPTS" + echo "$TIMESTAMP - [SETUP] - OpenSSL enabled for Tentacle" >> $PANDORA_LOGFILE + fi + fi + if [ ! -z "`echo $a | grep -e '^server_opts'`" ] + then + SERVER_OPTS=`echo $a | awk -F'"' '{ print $2 }' ` + if [ ! -z "$SERVER_OPTS" ] + then + TENTACLE_OPTS="$SERVER_OPTS $TENTACLE_OPTS" + echo "$TIMESTAMP - [SETUP] - Extra options for the Tentacle client $SERVER_OPTS" >> $PANDORA_LOGFILE + fi + fi done @@ -350,6 +378,11 @@ do fi # Send packets to server and delete it + if [ "$TRANSFER_MODE" == "tentacle" ] + then + eval tentacle_client -v -a $SERVER_IP -p $SERVER_PORT $TENTACLE_OPTS $PANDORA_FILES > /dev/null 2> $PANDORA_LOGFILE.err + fi + if [ "$TRANSFER_MODE" == "ssh" ] then scp -P $SERVER_PORT $PANDORA_FILES pandora@$SERVER_IP:$SERVER_PATH > /dev/null 2> $PANDORA_LOGFILE.err diff --git a/pandora_agents/linux/pandora_agent.conf b/pandora_agents/linux/pandora_agent.conf index dd88690423..a25e888494 100755 --- a/pandora_agents/linux/pandora_agent.conf +++ b/pandora_agents/linux/pandora_agent.conf @@ -31,9 +31,18 @@ checksum 0 # By default is 22 (for ssh) #server_port 22 -# ftp, ssh or local +# tentacle, ftp, ssh or local transfer_mode ssh +# Tentacle server password. Leave empty for no password (default). +#server_pwd + +# Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default). +#server_ssl no + +# Extra options for the Tentacle client (for example, server_opts "-v -r 5"). +# server_opts + # delayed_startup defines number of MINUTES before start execution # for first time when startup Pandora Agent