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.

Slack Alert Integration - Overview

Overview

I've created some Powershell scripts that call into Slack's API and pass the necessary info from Orion. This works great to receive alerts to a specific Slack channel.

Prerequisites:

  • Need to install Powershell v3 or greater on your Solarwinds Orion server. We specifically use the Invoke-RestMethod cmdlet. You can download that here.
  • Need to create a team with Slack if you have not already done so.
    • Need to setup an incoming Web Hook. Here is a link that talks about how that can be set up.
  • Download the scripts at links right below this section
    • Place them in a directory on your Orion server
    • Edit each script and fill out the necessary sections in the beginning. That information is most likely going to be exactly the same for each script.

Configuration

Below are links that outline different alert types in Orion, each with it's own instructions and custom Powershell script.

Slack - Alert Integration - Node

Slack - Alert Integration - Node CPU

Slack - Alert Integration - Node Memory

Slack - Alert Integration - Node Disk

Slack - Alert Integration - Node Response Time

Slack - Alert Integration - Node Packet Loss

Slack - Alert Integration - Interface

Slack - Alert Integration - Application

Slack - Alert Integration - Component

Screenshot of how this is formatted in Slack.

2016-05-05 14_30_05-Slack - LehiSalesEngineering.png

Please check back often to see if there have been any improvements or bug fixes to this script.

**Change Log**

  • 2016-03-01 : Initial release
  • 2016-03-18 : Added new scripts and refreshed already existing ones.
  • 2016-05-06 : Major overhaul. revamped message to Slack attachments for better formatting. Please also update your 'Network path to external program' in the alert action as some variables have been changed/added.

If you find this useful feel free to rate this article.

  • Thanks for posting these chad.every​. I don't see a version for volume capacity alerts; if I were to adapt one of these scripts to provide a volume capacity alert, will it work for Windows volumes that contain backslashes (and thus need "escaping")? There's probably a way to do that in PS - I am just unaware of it. Thanks again!

  • Yeah, you should be able to adapt any of these scripts to your liking. Does the Node Disk script not cover what you're looking for for volume alerts?

  • It does, and successfully passes backslashes through - yay! (I just missed it - either not enough coffee - or too much of it - 40+ years of drinking it - still can't get it right)

  • haha, nice! glad to hear it works!

  • FormerMember
    0 FormerMember

    Hi,

    I was trying to implement the host and interface checks via the PS scripts. If I open them in the powershell editor adopt the variables and test it I see the test post in Slack but if I create an Alert in Solarwinds and test it inside the Alert I don't get anything in my Slack channel. Any idea what I'm doing wrong or what I'm missing?

    Thanks for any help,

    Chris

  • Try changing the following Windows services to not run as 'Local System' and to run as either a local or domain account. Restart services once changed.

    • Orion Module Engine
    • Alerting Engine
    • Alerting Service v2

    I've seen similar issues of the script working outside of Orion but not inside. Changing these services seem to have fixed that for me.

  • FormerMember
    0 FormerMember

    Thanks I tried changing it and it didn't work, so I ended up double-checking the path to the script and saw that I had a typo in there. At the beginning of the path I didn't delete the < sign. After that I tested with a domain account on the services as well as the local account and both options are working now.

    Thanks for your help!! emoticons_happy.png

  • Hello guys,

    I have the same issue. The script works outside Orion, but inside there is some problem. I tried create a bat file to execute the command, even so, it seems something internal in the Orion Server, as if it doesn't got call the command/procedure.

    I made all the changes that you suggested but no way. Anything else do you think?

    Tks for the reply and for the great job.

  • Thanks for posting these chad.every.  Every click in THWACK gets me a little further, I do appreciate you sharing the scrips! 

  • If i execute the file manually in powershell am getting the message in SLACK if i run via solarwinds alert external program am not getting any message. Kindly help me in tis issue.