We're using the Slack integration and PowerShell script, like so many others are doing. It's really fantastic. One thing we want to do is iterate through the Alert Message (which is passed to the script), and do things. One element of our Alert Message is severity:
so I'd like to have an if loop that looks at Severity, and uses different emoji's, dependent on what the value of Severity is. Once the script is running and has that alert message, I'm assuming it is then some sort of PowerShell object, and we can access all the elements inside. Typically when figuring out what's available in a PS object that my scripts are ingesting, I run Visual Studio in debug mode, then I can see everything available in the left pane. For this SolarWinds alert, I'm having trouble just figuring out how I'll be accessing the value of Severity, which should be in Var1
Today a colleague gave me an idea to keep this simpler. Instead of looping through the Alert Message, we'll just pass an additional Param in the SolarWinds alert. So in addition to passing AlertMessage, we'll also pass Severity. Then it should be fairly simple to evaluate that Param, and do different emojis based on the value.
So instead of this:
...we would do something like this?
Then I would have an If statement that evaluates Var2
I'm not proficient enough yet to know what to do with those Params, (and I'll play around with it over the weekend. But if anyone knows just what to do, please chime in. I appreciate the help!!
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process. Learn more today by joining now.