diff --git a/pandora_agents/linux/pandora_agent.sh b/pandora_agents/linux/pandora_agent.sh index 7f56477e9c..9a7fadd51e 100755 --- a/pandora_agents/linux/pandora_agent.sh +++ b/pandora_agents/linux/pandora_agent.sh @@ -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 diff --git a/pandora_agents/linux/pandora_user.conf b/pandora_agents/linux/pandora_user.conf index 96ef653353..392d5aaee2 100755 --- a/pandora_agents/linux/pandora_user.conf +++ b/pandora_agents/linux/pandora_user.conf @@ -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 "" +#echo "www.artica.es_WEBContenct" +#echo "generic_proc" +#echo "$MD5SUM" +#echo "" + +# 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 "" +#echo "DNS_CHECK" +#echo "generic_proc" +#echo "$DNS_STATUS" +#echo "" + +# 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 "generic_proc" #echo "$PLC_STATUS" #echo "" - +# MODULE END ======================== \ No newline at end of file