Submit a ticketCall us

Solarwinds & Cisco Live! Barcelona
Join us from the 29th of January to the 2nd of February at Cisco Live 2018 in Barcelona, where we will continue to show how monitoring the network with SolarWinds will keep you ahead of the game. At our booth (WEP 1A), we will demonstrate how SolarWinds network solutions can help. As a bonus, we are also hosting a pre-event webinar - Blame the Network, Hybrid IT Edition with our SolarWinds Head Geek™, Patrick Hubbard on January 24th - GMT (UTC+0): 10:00 a.m. to 11:00 a.m. There's still time to RSVP.

Home > Success Center > Archive > 2017December07 - WIP Deletes > Alert Action - Run Linux Script With Putty

Alert Action - Run Linux Script With Putty



Chad Every created this article that shows how you can execute scripts against a linux server as an alert action. The scripts can be customized however you'd prefer them to function. This example will show how to do a simple service/daemon restart for Apache. There are some prerequisites that need to happen first beforehand. If you've already done those then skip down to the Orion Configuration part.

This article is base on Thwack Post



  • NPM 12


  • Change the following Orion services to run as a service account. I just created one called 'orionservice' and then restarted those 3 services once that change was made. The service account needs to be a local admin to the Orion server.


  • Install putty on your Orion server. Make sure you download the Windows Installer version. Once installed, log into your Orion server with the service account that you created. Open putty and connect to the linux server in question. You have to manually accept the SSH key to the host since those accepted keys are stored on a per user basis (In this case, the service account). Putty does not allow a SSH key to be automatically accepted via the command line. You only have to do this once per linux server. There are other ssh utilities that do allow SSH keys to be accepted automagically via the CLI, but this article will focus on Putty.




  • Optional - Add the install location for Putty into your environment variables. This help when creating the alert action since it can call just putty.exe instead of using the full Windows path to it.



  • In the Alert Trigger Condition you'll add the action: Execute an External Program.


Here is the full line in the 'Network path to external program'. I'm using an Orion variable, ${N=SwisEntity;M=Application.Node.IP_Address}, which allows the action to be dynamic.

     putty.exe -l <username> -pw <password> -m C:\SolarWindsScripts\Linux\ ${N=SwisEntity;M=Application.Node.IP_Address}


          ***Security Note: Putty also allows you to specify a key file with -i instead of using a password which is more secure.***


  • You'll replace the <username> and <password> with the actual linux account that you use.
  • On your Orion server create a folder in a location that your service account has access too. I created mine at C:\SolarWindsScripts\Linux\. In that folder you can place your scripts, this example just has a basic sh script called

         Example of file

         /etc/init.d/httpd restart

         exit 0

  • Save Changes to that action and test. You can also test this by running the full command in step 1 in command prompt or powershell. Just replace the Orion variable at the end of the actual IP of the linux server


    From here you can write scripts to accomplish just about anything and improve any automation rolls. This gives SAM the ability to 'self heal' an application before anyone has to be involved in troubleshooting.






Last modified


This page has no custom tags.


(not set)