pandorafms/pandora_agents/shellscript/openWRT/pandora_user.conf

75 lines
2.1 KiB
Plaintext
Executable File

# 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
#
# 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
#
# ================================
# 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 } '`
# if [ "$PLC_DNS" == "$PLC_LOCAL" ]
# then
# PLC_STATUS=1
# else
# PLC_STATUS=0
# fi
#
# echo "<module>"
# echo "<name>PLC_DNS_CHECK</name>"
# echo "<type>generic_proc</type>"
# echo "<data>$PLC_STATUS</data>"
# echo "</module>"
# MODULE END ========================