This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SFTP Monitor

This monitor uses a combination sftp file upload and file last modify monitor. Using psftp.exe, the PowerShell script uploads a test file to the SFTP server where it can be monitored for last modify date. If the file cannot be uploaded to the server, the file last modify monitor will alert based on aging criteria.

The script will need psftp.exe on each polling engine, and currently uses the following directorys:

C:\PUTTY - this is where psftp.exe goes.

C:\PUTTY\Scripts - this is where the sample file goes. Name this file SFTP_Monitor.exe.

The script will use the built in credentials assigned for the monitor to make the connection, but you can also place a Credentials.csv file in the C:\PUTTY\Scripts directory, or hard code the credentials in the script.

I'm aware that the error handling in the UX monitor is a little quirky, however I'm counting primarily on the file last modify date to alert me of issues with the FTP server.

(2015, 07 14) Uploaded a new powershell script that is slightly improved from the original monitor.

SFTP_2.ps1
  • LAG,

    Have you or anyone else used this when connecting to a Linux server with an SSH key exchange?

    --Jason

  • I haven't had to point this to a LINUX box yet. I did have to confirm the certificate against the Win boxes, though. When initially setting up the monitor, I had to edit the script and test it once before I could put it into production. Testing it with the modification created the key, and it worked after switching it back:

    I'm not sure if this helps in your situation, but to install the script in Orion as a monitor for my windows servers, I had to modify the configuration to accept the new connection this way:

    # Command Line Configuration

    $changeToolDir =  "cd C:\PUTTY\"

    $toolDir = "C:\PUTTY\"

    $tool="psftp.exe"

    $cmd = @(

    "`n",

    "put $file`n",

    "bye"

    )

    to

    # Command Line Configuration

    $changeToolDir =  "cd C:\PUTTY\"

    $toolDir = "C:\PUTTY\"

    $tool="psftp.exe"

    $cmd = @(

    "y`n",

    "put $file`n",

    "bye"

    )

    Once tested, convert back to original code.

  • Thanks....That got me a little farther than I was before.  I believe what is stopping me now is the private/public key exchange.  I am going to contact one of our developers to see how tough it would be to write that into the script

  • Getting the following error when trying to download the monitor...

    Import Application Template Status

    There was an error deserializing the object of type System.Collections.Generic.List`1[[SolarWinds.APM.Common.Models.ApplicationTemplate, SolarWinds.APM.Common, Version=6.2.1.2395, Culture=neutral, PublicKeyToken=null]]. The data at the root level is invalid. Line 1, position 1.

    Any idea what the issue might be?

  • Not sure - maybe an issue with Thwack?

    Here's the content of the file on GitHub:

    PSFTP_Monitor.ps1 · GitHub

  • I keep getting an error trying to import this template   "The file format is not a valid template format. Please check the template format on THWACK. The imported file format should be XML with an .apm-template extension." 

    Can anyone help on this?