Forum Discussion

autarch's avatar
autarch
Icon for Neophyte rankNeophyte
27 days ago

SQL Stored Procedure Monitoring

Hello,

I have a SQL stored procedure that I need to monitor.  The stored procedure is scheduled to run evey hour and I need to monitor and alert on any results that do not have 'Success' in the EventStatusDesc column.

What is the best approach for monitoring this?

2 Replies

  • What specific steps would you do to check this by hand? Like can you check the state via a SQL statement you run on a regular basis? You mentioned a "EventStatusDesc column" so I assume this is in a database table you can query?

    I see there is a "Custom SQL Queries" community module that sounds like it will run any SQL statement and store a numeral result in LM. If you can write a statement that say returns 0 for Success and 1+ for failures (and scheduled missed), that may meet your needs.

  • Following up on this for anyone else.  If you monitor a stored procedure via SQL Agent, you're only seeing the result after it's scheduled to run and the results only persist at runtime, whereas if you have LogicMonitor run the stored procedure, you can schedule the frequency in the DataSource and the results persist in LogicMonitor.  I found this gives you more reliable alerting and monitoring.

    To accomplish this I leveraged the JBDC data source; constructed the JBDC URL, ensured the LogicMonitor service account has sufficient permissions (it is used by default) and then modified the SQL query to output a number.  Then configured the Datapoint to guage the resulting number and alert when it that value (corresponding to a column in the query) equalled X.