We've arrived at the final installment of my technical deep-dive into advanced Orion® web-based report techniques, which all started when a customer asked if I knew anyone who could help build an "impossible" feature for them.
Spoiler: it was neither impossible nor was it even a feature.
In my first post I introduced the whole concept (Advanced Reporting Part 1: Re-Creating the "All Alerts" Resource With Extras ). In the second (Advanced Reporting part 2: Making Web-Based Reports Do Your Bidding ), I showed how to add custom fields, such as "importance," to an existing report using the SolarWinds Query Language (SWQL). And in the third post (Advanced Alert Reporting part 3: Hyperlinks in Data Output ) I dug into ways to make data elements clickable by combining HTML with the SWQL output.
And here, in this last post, I'm going to show how to use those two techniques to add an Acknowledge option, so that a report showing the current active alerts can be used by NOC staff to also manage those alerts, in addition to simply listing them out.
As a reminder, I've already built this report and posted it to the Content Exchange (Report: All Active Alerts with Acknowledge action ), in case you'd like to use it as a starting point for your own custom reporting adventure.
Be Alert. The World Needs More Lerts.
When you look at the original "All Active Alerts" page in a standard Orion installation (here's an example from our live demo: https://oriondemo.solarwinds.com/Orion/NetPerfMon/Alerts.aspx ), there's a few things that you may notice about the "Acknowledge" item:
...and, if you look at the underlying code on the Alerts.aspx page, you'll note that
What? You've never set up an email alert with an embedded "acknowledge" link? Well let's rectify that situation right now.
First, create a new alert.
It doesn't really matter what we call it, and it doesn't even really matter what the alert triggers on, as long as it triggers at least once. The most important step is to set up an email alert and embed the acknowledge alert link variable.
<IMG email trigger action with acknowledge link>
Once it's done, I'll kick off that alert, receive the email, and see what that link looks like.
Let's SWQL One More Time
Now that I know what the link looks like, I have to go back to SWQL studio and see if I can find that link or at least a portion of it embedded SOMEWHERE. After just a bit of searching, I found it in the AlertObjects table, where there's an AlertDefID field that matches up with the tail-end of the standard alert URL "/Orion/Netperfmon/AckAlert.aspx?AlertDefID=".
By concatenating the AlertDefID onto the end of that URL, I'm in busine...
Hang on, it threw an error.
The issue here is that the URL is a word-based object (a "string" or "varchar" in in more technical parlance) but the AlertDefID is a numeric value. So, we need to convert them to match. Since you can't make words into numbers, we'll have to convert the AlertDefID number so that it's treated as a string:
The final field description would look like this:
'<A HREF="/Orion/Netperfmon/AckAlert.aspx?AlertDefID='+tostring(AlertObjects.AlertObjectID)+'" target="_blank">ClickToAck</a>' AS AcknowledgeIt
I'll add that to my SWQL statement, update it in the report definition, add the "AcknowledgeIt field to the report, and I have something that looks like this:
The Mostly Un-Necessary Summary
Throughout this series, I hope I've shown that seemingly challenging, "advanced" tasks are nothing more than the combining of relatively simple, common skills or bits of knowledge in new and creative ways. While every IT practitioner cannot be expected to have every combination of these techniques and concepts, what IS true is that you can take what you have now and think about how it can be re-used; and as you grow in your skills, knowledge, and experience, that base of creativity only grows.
But that's not all!
In my next post (which will appear over on GeekSpeak), I'll take an introspective turn, and talk about what I learned in all of this from a philosophical, rather than technical, point of view.
THAT'S the best feedback I could possibly hope for - that this someone helped or just inspired folks to make something you have and use even better.
Good golly adatole... Take a break for a minute, man! Breathe... Relax... Stop being so helpful already, it's only 7am!
I really like the series you're doing here. Very informative, as well as useful. Thank you!
Your fourth post didn't disappoint, Cheers adatole.
I would caution the readers to ensure that their processes include a check of each alert before they are acknowledged via the magic link. Receipt of a notification and clicking the helpful link is not the same as taking ownership. You have to understand what you're taking responsibility for, as that's what acknowledging an alert does. This is especially important if your alerts have escalation rules applied!
As always, interesting, useful, and informative. Leon, you never fail at your communication tasks. One day, let the winds of change blow to help make us more like you.
Thanks for the article. Looking to use this in a slightly modified way. As we have multiple customers looking to reduce the alerts down to an individual customer so we can present just the relevant alerts to the customer's help desk.
I'm trying to make a similar dashboard, not to acknowledge the alert but to perform an alert action to make a ticket to our ticketing system after the NOC has reviewed the alert.
My thought is if I can add another resource to the Active Alert Details page that lists the current alerts and lets you click it to make a ticket.
There are a couple ways I can automagically make tickets today, one is a VBScript, the other is through email to what we call Mail Eater. Both work equally good.
The page you created is very close to doing what I need, If I could change it from Acknowledge Alert to Create Email or Run Script.
In your example I see you used the AckAlert.aspx in this line:
'<A HREF="/Orion/Netperfmon/AckAlert.aspx?AlertDefID='+tostring(AlertObjects.AlertObjectID)+'" target="_blank">ClickToAck</a>' AS AcknowledgeIt,
Any ideas on how I could change that line to run a script or send an email? I already have the code I need to execute or email to send as a custom property.
Any help would be greatly appreciated!
I've managed to create the basis of the report I was trying to generate but I'm struggling to get this onto the NOC view. A quick search around the website suggests that there isn't an easy way to get the web based report onto the view. Given the deprecation of report writer this seems a bit of an oversight. I'm hoping I've just missed something long the way and there is an easy way of getting web based reports into a NOC view.
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.