Ad Widget

Collapse

using SQL Server User Settable Object for custom counters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • unity
    Junior Member
    • Mar 2013
    • 3

    #1

    using SQL Server User Settable Object for custom counters

    Just food for thought on making your own custom (integer) counters that come from MS SQL. After doing forum searches I hadn't seen anyone using the process. MS SQL 2005+ allows you to have up to 10 custom counters that you can control.

    Basically in SQL you can run the following:
    EXECUTE sp_user_counter1 100

    and it will set the value of the performance counter \SQLServer:User Settable(User counter 1)\Query to 100.

    What can you do with it. Plenty. If you have a database trigger that runs you can always keep track of row counts in a table. You could keep track of the count of databases on a server and therefore you could have Zabbix notify you of databases being added or removed from a server.

    Here is Microsoft's documentation on the counters:
Working...