Forum Discussion
FTP Monitor Help
Setup a custom external monitor. add a file with the contents of "SUCCESS" make sure you chmod +x the .sh file in /usr/bin/monitors/ftp.tools.sh
monitor ftp.tools { defaults from external FILENAME "filename.txt" PASSWORD "****" run "/usr/bin/monitors/ftp.tools.sh" USER "" }
external monitor:
!/bin/sh These arguments supplied automatically for all external monitors: $1 = IP (nnn.nnn.nnn.nnn notation) $2 = port (decimal, host byte order) This script expects the following Name/Value pairs: USER = the username associated with a mailbox PASSWORD = the password for the user account FILENAME = File Name/Path to get from FTP Server Remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)NODE=
echo ${1} | sed 's/::ffff://'
PORT=${2}
RECV='SUCCESS'
PIDFILE="/var/run/
basename ${0}.${NODE}_${PORT}.pid"
kill of the last instance of this monitor if hung and log current pid
if [ -f $PIDFILE ] then echo "FTP-Tools exceeded runtime needed to kill ${NODE}:${PORT}" | logger -p local0.error kill -9
cat $PIDFILE > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
curl ftp://${USER}:${PASSWORD}@${NODE}/${FILENAME} | grep -i "${RECV}" 2>&1 > /dev/null
if [ $? -eq 0 ] then echo "Node ${NODE}:${PORT} Status is UP" | logger -p local0.error /bin/rm -f $PIDFILE echo "Removed $PIDFILE" | logger -p local0.error echo "up" fi
exit
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com