* Final fixes for Pandora Agent 1.2 for Linux

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@96 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2006-07-06 11:05:42 +00:00
parent 0559fa3b63
commit 031c8ded7f
2 changed files with 57 additions and 12 deletions

View File

@ -237,19 +237,18 @@ do
echo $CHECKSUM_DATA > $CHECKSUM
fi
# Send packets to server and detele it
scp $PANDORA_FILES pandora@$SERVER_IP:$SERVER_PATH > /dev/null 2> /dev/null
if [ "$DEBUG_MODE" == "1" ]
then
mv $PANDORA_FILES $SERVER_PATH > /dev/null 2> /dev/null
echo "$TIMESTAMP - Copying $PANDORA_FILES to $SERVER_IP:$SERVER_PATH" >> $PANDORA_HOME/pandora.log
else
# Copy XML Data files to remote systems
scp $PANDORA_FILES pandora@$SERVER_IP:$SERVER_PATH > /dev/null 2> /dev/null
# Delete it
rm -f $PANDORA_FILES> /dev/null 2> /dev/null
fi
# Delete it
rm -f $PANDORA_FILES> /dev/null 2> /dev/null
# Go to bed
# Go to bed :-)
sleep $INTERVAL

View File

@ -1,16 +1,62 @@
# Pandora User-Defined adquisition script
# This code is under GPL licence
# This is the default user script file
# If you're using this is because default config doest fit all your needs
# You can use the following variables
#
# $DATA is XML output file where you need to write your module output
# All STDOUT output will be written in final XML file sent to Pandora Server.
#
# Please refer documentatation for more example and a more depth usage instructions
#
# a little example, to monitor changes on DNS versus actual IP on interface ppp0
# Uncomment below this line to execute. All output needs to be in Pandora XML Agent-Output format
# ================================
# Check for WEBPage content change
# ================================
#MYMD5=`echo -e "GET / HTTP/1.0\n\n\n" | nc -w 30 www.artica.es 80 | grep -v "Date:" | md5sum | awk '{ print $1 }'`
#VALIDMD5=e85c0b9018a22c1086c8e0179cd224b1
#if [ "$MYMD5" != "$VALIDMD5" ]
#then
# MD5SUM=0
#else
# MD5SUM=1
#fi
#echo "<module>"
#echo "<name>www.artica.es_WEBContenct</name>"
#echo "<type>generic_proc</type>"
#echo "<data>$MD5SUM</data>"
#echo "</module>"
# MODULE END ========================
# ================================
# Check for DNS Entry change
# ================================
#HOSTNAME=arcadia.genterara.com
#MAXHOPS=1
#MAXHOPS2=`expr $MAXHOPS + 1`
#SALIDA=`traceroute -n $HOSTNAME -w 5 -m $MAXHOPS2 2> /dev/null | awk '{ print $1 }' | tail -1`
# if SALIDA != MAXHOPS, error (more than MAXHOPS hop, if this is our local IP, no more than MAXHOPS hop its needed
#if [ "$SALIDA" == "$MAXHOPS" ]
#then
# DNS_STATUS=1
#else
# DNS_STATUS=0
#fi
#echo "<module>"
#echo "<name>DNS_CHECK</name>"
#echo "<type>generic_proc</type>"
#echo "<data>$DNS_STATUS</data>"
#echo "</module>"
# MODULE END ========================
# ================================
# Check for DNS Entry change
# on local interface ppp0
# ================================
#PLC_DNS=`dig @194.179.1.101 plc.genterara.com A +short | tail -1 `
#PLC_LOCAL=`ifconfig ppp0 | head -2 | tail -1 | tr -s ":" " " | awk ' { print $3 } '`
@ -26,4 +72,4 @@
#echo "<type>generic_proc</type>"
#echo "<data>$PLC_STATUS</data>"
#echo "</module>"
# MODULE END ========================