Is there any way to export a large number of custom alerts and import them into another instance?
Just from the comment about a large number of alerts, I trust that the web console alert export/import process will be slow if not painful. Check these out:
(+) Import Multiple Alert Rules into Alert Manager - Forum - Network Performance Monitor (NPM) - THWACK (solarwinds.com) Vinay.By and MesVerrum have suggestions/links in this thread.
(+) 05_ImportAlert.ps1 - Scripts - The Orion Platform - THWACK (solarwinds.com) Walk through of using the API by KMSIGMA.SWI.
Building off what @marcrobinson said, you can export via the API. Well - sort of.
There are a few caveats:
In PowerShell, you would query for the alerts you want to export in the Orion.AlertConfigurations entity.
Orion.AlertConfigurations
Then you would pass that information to the Export verb on the same entity.
Export
The resultant output would contain the alert's XML. Then you'd need to just export it to the current file system.
After which, you could import them via the WebUI or via the API.
I've included a very simplified export script in the Content Exchange (Export Alerts from SolarWinds Platform [Quick and Dirty Edition] - Scripts - The Orion Platform)
Hey @KMSigma.SWI is the alert trigger/reset logic decipherable when exporting this way?I have a need to tweak logic on many alerts that is missing a piece of logic.
i.e.
a component check is triggering (based on old last status) even though the node is unmanaged.
I have a few scenarios like this and adding custom properties logic to a bunch of alerts and would like to do programatically.
there are over 700 enabled alerts
Eh - within reason. It's "readable" but it's not "plain language."
The trigger conditions begin at the XPath: /AlertDefinition/Trigger/Conditions
/AlertDefinition/Trigger/Conditions
Are you looking to edit something or add something?
I've thought about putting in something to convert the XML to something a little more PowerShell friendly, so you could edit it "inline" and then save it back to an XML. It's not a trivial task, so I haven't devoted the time.
Thanks for responding!
I'm looking to edit.
Definitely not trivial, I get that.
I'll work on pulling in this fashion and see what I can do/make of it for this effort.
Thanks!