2 Replies Latest reply on Apr 23, 2018 3:44 PM by ajiwanand

    Multiple Statistic Data with unique alert variables?

    ajiwanand

      I know its possible to use the script monitor to retrieve multiple statistic data and monitor those (a limit of 10). I also know you can name these statistic data like this "Message.Item" and "Statistic.Item". If we do this Item will be its own field within the Solarwinds component page. However what variables do i need to use these values uniquely.

       

      For example, I am monitoring a linux service and want to return three things, the status (rather normal nothing fancy), the path of the service, and the name of a service. Then I want to use the path and name in the trigger actions to automatically triage some incidents.

       

      The following variables all return the following:

       

      ${N=SwisEntity;M=ComponentAlert.MultiValueMessages} - returns all three values in one line

      ${N=SwisEntity;M=MultipleStatisticData.StringData} - returns only the last value

       

      Is there any way i can return these three statistic messages uniquely? Or can I manipulate the variable with some sort of python like formatting to remove what i need??

       

       

        • Re: Multiple Statistic Data with unique alert variables?
          jrouviere

          I'm not sure if there's an easier way to do it, but I just created a custom SWQL variable to return what you're after:

           

          Statistics1:  ${N=SWQL;M=SELECT c.MultipleStatisticData.NumericData

          FROM Orion.APM.Component c

          where componentid = (${N=SwisEntity;M=ComponentAlert.ComponentID})

          and c.MultipleStatisticData.Name like '%name1%'}

           

           

          Message1:  ${N=SWQL;M=SELECT c.MultipleStatisticData.StringData

          FROM Orion.APM.Component c

          where componentid = (${N=SwisEntity;M=ComponentAlert.ComponentID})

          and c.MultipleStatisticData.Name like '%name1%'}

           

          In order to get statistic 2, 3, etc you would need to change the line and c.MultipleStatisticData.Name like '%name1%'} to the next number (e.g. name2, name3).

           

          From my testing, you will need your alert to alert on a Component, not an application, or it won't correctly resolve ${N=SwisEntity;M=ComponentAlert.ComponentID}.

           

          You will of course need to add the query for each statistic and message you would like to return (up to 10 pairs), but that should get you started anyway.  If anyone has a simpler way to add it I would be interested, I just went in with the SWQL hammer this time.

           

          I did find ${N=SwisEntity;M=MultipleStatisticData.NumericData}, but it seems to only return one value.

          2 of 2 people found this helpful