7 Replies Latest reply on Oct 31, 2019 12:14 PM by amjannah

    Collect all emails used in Alerting

    amjannah

      Is there a way to report on, or gather all the individual emails and/or distribution lists associated with the alerts we have active in solarwinds?

        • Re: Collect all emails used in Alerting
          wluther

          amjannah I believe this SWQL query should show you the email addresses listed for the various email to/cc/bcc/from actions.

           

          SELECT
          ap.ActionID
          ,ap.PropertyName -- Shows which action properties. (email to, cc, from, message, etc.)
          ,ap.PropertyValue -- Shows the email address(es) linked to the action
          ,ap.Action.Enabled -- Shows if this is enabled/disabled
          ,ap.Action.Assignments.CategoryType -- Shows if this is a trigger, reset, etc.
          ,ap.Action.Assignments.EnvironmentType -- Shows if this is for an alert, report, etc.
          FROM Orion.ActionsProperties AS ap
          WHERE ap.PropertyName IN ('EmailTo','EmailCC','EmailBCC','EmailFrom') -- Limits the results to only show the various email to/from fields

           

           

          You should be able to put that SWQL query into a custom query widget, custom table widget, or into a report. Just make sure to select SWQL if you are putting it into the table widget or report.

           

           

          Please let us know if you need any further assistance.

           

          Thank you,

           

          -Will

            • Re: Collect all emails used in Alerting
              wluther

              Ah, I just noticed the OP was in the Alert Central forum. My initial reply was more towards general alerting in Orion. I do not actually have much experience with Alert Central. Sorry for any confusion.

                • Re: Collect all emails used in Alerting
                  amjannah

                  the actually script works, it just gives generic info and doesn't produce the alert the emails are associated with:

                   

                  Custom Table for Datasource 1

                   

                  ACTIONIDCATEGORYTYPEENABLEDENVIRONMENTTYPEPROPERTYNAMEPROPERTYVALUE
                  11TriggerTrueAlertingEmailBCC
                  11TriggerTrueAlertingEmailCC
                  11TriggerTrueAlertingEmailFromnobody@nobody.com
                  11TriggerTrueAlertingEmailToexample@html
                  13TriggerTrueAlertingEmailBCC
                  13TriggerTrueAlertingEmailCC
                  13TriggerTrueAlertingEmailFromnobody@nobody.com
                  13TriggerTrueAlertingEmailToexample@text
                  14TriggerTrueAlertingEmailBCC
                  14TriggerTrueAlertingEmailCC${DefaultEmailCC}
                  14TriggerTrueAlertingEmailFrom${DefaultEmailFrom}
                  14TriggerTrueAlertingEmailTo${DefaultEmailTo}
                    • Re: Collect all emails used in Alerting
                      wluther

                      amjannah Okay, here is an updated version. I joined the previous one to the Alerts table, which should now show you the alert name too.

                       

                      SELECT
                      ap.ActionID
                      ,ac.Name AS [Alert Name] -- Shows the alert name
                      ,ap.PropertyName -- Shows which action properties. (email to, cc, from, message, etc.)
                      ,ap.PropertyValue -- Shows the email address(es) linked to the action
                      ,ap.Action.Enabled -- Shows if this is enabled/disabled
                      ,ap.Action.Assignments.CategoryType -- Shows if this is a trigger, reset, etc.
                      ,ap.Action.Assignments.EnvironmentType -- Shows if this is for an alert, report, etc.
                      FROM Orion.ActionsProperties AS ap
                      JOIN Orion.AlertConfigurations AS ac ON ap.Action.Assignments.ParentID=ac.AlertID -- Joins to an alert table so we can pull the alert name
                      WHERE ap.PropertyName IN ('EmailTo','EmailCC','EmailBCC','EmailFrom') -- Limits the results to only show the various email to/from fields

                       

                       

                       

                       

                      See if that works better for you.

                       

                      -Will

                      1 of 1 people found this helpful