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 integration not working

We are trying to implement alerting via a Slack channel and are running into problems.  After following the Solarwinds guide, everything works from the command line of the Orion server but we never get a message when it is triggered from an actual alert.  We see the "Send Slack Message" event task run in Orion but the message never shows up in Slack.  What could we be missing?  My guess is that it is a permissions issue when calling the curl.exe.  Is there a certain permission that should be allowed for this to work?

Thanks,

Jon

  • If the curl works when you run it, it may be permissions. Try to define a user to run the command:

    pastedImage_0.png

  • Tried that and it didn't work.  We got this message Check 'Replace a process level token' account privilege of user which runs Solarwinds Orion Module Engine service.

    We did the following to the user account we are trying to use:

    - made local admin on Orion box

    - gave Full Control to curl script directory

    - made user the Log On account for the SolarWinds Orion Module Engine service

    - added user to "Replace a process level token" in Local Security Policy on Orion server

    - restarted all Orion services

    After adding the user to the Alert and running the Test Credentials, we get the same error as above.  I have used domain\username and username@domain with no success.  Solarwinds Support pretty much gave up and pointed me to Thwack.

    Thanks for the help.

  • Can you run anything from the executable action? Something like:

    "C:\Windows\System32\ipconfig.exe" > %temp%\ipconfig.txt

    Don't specify a user first.

    Also, did you clear the downloaded form the internet flag on curl and its resources?

    Unblock-File

  • Just writing to the txt file did not work either.

  • If I edit the Notify Slack Action I created to define a user, then press the Test Credentials button, it fails with the same message: Check 'Replace a process level token' account privilege of user which runs Solarwinds Orion Module Engine service.

    I have done all the steps (as detailed above) to give the user the proper access and still no go.

  • Am trying to integrate the solarwinds with slack everything running fine but not receiving the message in slack channel in solarwinds server am getting error like WARNING - The underlying connection was closed: An unexpected error occurred on a send kindly share the steps to resolve this issue.

  • So I can make a guess, but let start with simple and work our way up.

    I am basing this on adatole​'s  guide to slack integration, its likely that is how you got started.

    The Incomplete Guide to Integrating SolarWinds Orion and Slack

    On page 14 of the pdf when you run the command in a local shell, not an alert via curl does it work or do you get an error?

    C:\sw _ tools\curl\bin\curl.exe -X POST --data-urlencode “payload={\”text\”:\”This is a line of text.\nAnd this is another one.\”}” https://YOUR _ SLACK _WEBHOOK _ GOES _ HERE!

    If that works, and its erring in Powershell, screenshot the whole window you are testing in. If the Powershell sample script works (either or both the samples) but it errors when you use it in an alert, let me know.

  • Am using the path C:\windows\system32\windowspowershell\v1.0\powershell.exe -ExecutionPolicy unrestricted -command "D:\Slack\Slack_Alert_Trigger_Action_Node.ps1 '${N=SwisEntity;M=DisplayName}' '${N=SwisEntity;M=Status;F=Status}' '${N=Alerting;M=AlertDetailsUrl}' '${N=SwisEntity;M=DetailsUrl}' '${N=Alerting;M=AcknowledgeUrl}' '${N=Generic;M=DateTime;F=OriginalValue}'"

    in the alert and in the script am using the hookurl

  • So you didn't say it, but the curl command worked?

    And I didn't see any screenshots, but if you could for the next part it will help me. The code below is mostly not mine I just trimmed it up to make it simple.

    Open Powershell console window.

    After updating the webhook, copy the code into the console window:

    $webhook = '<YOURWEBHOOK>'
    $slackJSON = @{ }
    $slackJSON.channel = '#general'
    $slackJSON.username = 'OrionAlert'
    $slackJSON.text = 'Text message here to test the send'
    $webReq = @{
    Uri      = $webhook
    ContentType  = 'application/json'
    Method      = 'Post'
    body = ConvertTo-Json $slackJSON
    }

    if there are no errors then send the command

    Invoke-WebRequest @webReq

    If it works let me know or screenshot the error. You can also try these two lines:

    $tempbody = ConvertTo-Json $slackJSON
    Invoke-WebRequest -Uri $webhook -ContentType 'application/json' -Method 'Post' -body $tempbody
  • Hi,

    once i run

    1. $webhook = '<YOURWEBHOOK>'
    2. $slackJSON = @{ } 
    3. $slackJSON.channel = '#general'
    4. $slackJSON.username = 'OrionAlert'
    5. $slackJSON.text = 'Text message here to test the send'
    6. $webReq = @{ 
    7. Uri      = $webhook 
    8. ContentType  = 'application/json'
    9. Method      = 'Post'
    10. body = ConvertTo-Json $slackJSON 

    Am not getting any output but after running the Invoke-WebRequest @webReq am getting the output in SLACK.

    pastedImage_1.png