5 Replies Latest reply on Oct 18, 2019 5:20 PM by serena

    Custom Monitor of Metrics Derived from an Application Database

    jredifer

      I'm new to Solarwinds and having a hard time finding the options and best approach to achieve my goal.

      I have an application that has a process which converts rows in a table from one state to another. I want to track the rate at which that conversion is ocurring and also set alerts based on it exceeding healthy limits for that rate.

      I can query the totals of each row for each state or I can query the total for each row within a time interval. I want to run these queries often without putting undo load on the database. Because of how it's indexed querying totals for each state in one query (group by) takes about as long as querying the totals for one state.

      I've only found documentation on using the ODBC Server User Experience monitor to capture the output of this query but it looks like I wouldn't be able to capture separate metrics for each state because it only grabs one field. I'd have to create separate monitors for each state which means separate query executions which means increasing the load from this about 5x.

      Is there a way to run one query but capture metrics used for several custom monitors? Am I looking in the right place? I'm a developer so scripting, writing a custom plugin, etc. aren't out of the question but I'd like to know what you would recommend as the best way to accomplish my task.















        • Re: Custom Monitor of Metrics Derived from an Application Database
          mdriskell

          The built in SQL monitors that can run a query will only capture one value or metric per monitor.  That being said I think that you have two potential options.

           

          #1 Write a more advanced query that gathers both metrics and then performs whatever math function you require and send that as the output.

           

          #2  Using powershell or another scripting method.  Call the DB and execute each query (powershell scripts we can capture up to 10 metrics).  Or you could also do like suggested in the previous and have PS grab both metrics and then run a function to calculate the value as a 3rd output metric.

          1 of 1 people found this helpful
            • Re: Custom Monitor of Metrics Derived from an Application Database
              jredifer

              Thanks Mike that definitely helps me focus on which approaches to research. A couple follow up questions on #2 if you don't mind:

              1. What is this type of metric/template/monitor called or where could I find documentation on writing a script to generate several new, custom metrics?
              2. Are these scripts run on a target node or can I run them from the solarwinds instance to connect directly to the database?
              3. Is there any sort of built in database client or connection I can get from Solarwinds via a command or function or do I just need to make sure a suitable client is installed on the system the script runs from?