cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

Custom Monitor of Metrics Derived from an Application Database

Jump to solution

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.















Labels (1)
0 Kudos
1 Solution
Level 15

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.

View solution in original post

5 Replies
Level 15

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.

View solution in original post

Level 8

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?


0 Kudos
Level 15
  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?  It would be a brand new template.  For the component it would be one of the various scripting methods we support.  Powershell may be the easiest method but if you are more familiar with VBscript or Perl for example those could be leveraged as well.
  2. Are these scripts run on a target node or can I run them from the solarwinds instance to connect directly to the database?  For Powershell we support either.  You could execute on the SW server and have it call the target or if you setup appropriate WINRM (Windows Remote Management) you could do a remote execution and it can run from the target.
  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?  If you used method one this would use our built in mechanism.  Using method 2 you are going to have to "call" the database.  This is where we are now outside of my wheelhouse but I do know for certain these things can be done.  I just don't know how to script it.
Level 8

Thanks Mike this was extremely helpful.

0 Kudos
Product Manager
Product Manager

jredifer  wrote:

Thanks Mike this was extremely helpful.

These resources can also get you started with additional information on using components and powershell

Use application monitor templates and component monitors

SAM component monitors

0 Kudos