Hey guys,
I followed hoolio's approach (thanks for you idea) to build a tiny monitor and this seems to be working fine for me.
Here is the string which is executed within external monitor:
sftp -o PubkeyAuthentication=yes -o IdentityFile=/root/.ssh/${PKEY} -b /home/${BFILE} ${USER}@${HOST} | grep ${MATCH} 2>&1 > /dev/null
Arguments here:
`PKEY` - private key file name for SFTP authentication
`BFILE` - batch file specifing which commands to execute after login
`HOST` - ip address of SFTP server
`DEBUG` - 0/1 = on/off
`MATCH` - a string we are looking for to check health
`USER` - account to access SFTP
`
In CLI it looks like:
sftp -o PubkeyAuthentication=yes -o IdentityFile=/root/.ssh/sftpmonitor_rsa -b /home/sftpmonitor.input f5_monitor@10.128.192.192
Batch file
sftpmonitor.input
is nothing more than:
dir
bye
SFTP administrator created a file named
f5_health
which monitor is looking for. If it gets this string with grep, then we are marking pool member up. Otherwise it is red.