Forum Discussion
Josh_Hildebran1
Nimbostratus
Jul 21, 2008Monitor for SFTP
Does anyone have a sample external monitor for monitoring nodes that are running an SFTP (via ssh) server?
A default "tcp" monitor on port 22 seems to kill the FTP server to the p...
FMA_199355
Nimbostratus
Feb 15, 2017Hey 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.Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects