Forum Discussion

Josh_Hildebran1's avatar
Josh_Hildebran1
Icon for Nimbostratus rankNimbostratus
Jul 21, 2008

Monitor 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 point where my FTP monitor on 21 stops functioning.. well, the monitor probably functions, but the server dies for a little while. I'm taking that up with the vendor (serv-u)..

 

 

But in the meantime, I'd like to have a real SFTP monitor that logs in and grabs a file. Preferably one that uses password authentication, not private key.

 

 

Thanks in advance!

 

 

-Kyoo

3 Replies

  • Has anyone successfully installed "lftp" on an LTM BigIP box? passing passwords on the command line to lftp is simple, and it handles SFTP and FTPS.
  • 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.

  • Hi FMA,

     

    How do you manage the public key authenticatiion?

     

    "PubkeyAuthentication=yes -o IdentityFile=/root/.ssh/sftpmonitor_rsa". I assume sftpmonitor_rsa is the private key and is stored in server(/root/.ssh/sftpmonitor_rsa).