Forum Discussion
SFTP External Monitor fails but manual script execution succeeds
Hi,
I've been working on setting up an SFTP monitor for some time now. I'm getting really close but there's one thing left that I'm having a hard time understanding and is just not working as expected.
Here is the base script:
!/bin/bash
IP=`echo ${1} | sed 's/::ffff://'`
PORT=${2}
sftp -o Port=${PORT} -b /home/ext_monitor/cyclone/sftpmonitor.input sftpMonitor@${IP} | grep 'IB' 2>$1 > /dev/null
mark node UP if expected response was received
if [ $? -eq 0 ]
then
echo "UP"
fi
When I upload this script to the F5 and execute it manually (using IP and Port arguments in-line) it works just fine.
What I'm trying to do is attach this to the pool level; there are 4 pool members and my understanding is the first two variables ($1 (ipv6 address) and $2 (port)) are auto-populated by the F5 when it tries connecting in the external monitor, but the monitor was failing.
Next, I modified the script a bit so that instead of using IP and PORT variables, I just hard-coded one of the pool member information and attached the monitor at the pool member level, but that also failed.
Any assistance I could get would be very appreciated... I feel like I'm very close and just missing a couple key things here.
Here's the current monitor configuration:
ltm monitor external external-sftp-cyclone {
defaults-from external
destination *:*
interval 5
run /Common/external-cyclone-sftp-2022
time-until-up 0
timeout 16
}
Also, in case it is relevant: I do also have a tcp monitor attached alongside it as I cannot risk the pool member going down at this time while I test this.
- jpeterson6Nimbostratus
I should add: The batch file sftpmonitor.input simply runs 'dir' and 'bye' commands.
have a look at an older but still good article on trouble shooting external monitors: https://devcentral.f5.com/articles/ltm-external-monitors-troubleshooting
- b_kodan_313047Nimbostratus
Hi,
How do you authenticate the user'sftpMonitor' in the above mentioned sftp monitor script.
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