S
S
slden2020-08-17 18:20:46
Monitoring
slden, 2020-08-17 18:20:46

How to monitor MS SQL through odbc requests in Zabbix?

There is Zabbix version 4.4.7

. It is planned to monitor MS SQL database through odbc requests without installing Zabbix agent on the host.
Zabbix 5.0 has a ready-made mssql_odbc template.
Planned to "pull out" from it all triggers with priority High, and items corresponding to them (odbc requests).
I started to study the template, and did not understand how to actually pull out and adapt the triggers for the old zabbix.

I give an example:

<item>
               <name>MSSQL: Buffer cache hit ratio</name>
               <type>DEPENDENT</type>
               <key>mssql.buffer_cache_hit_ratio</key>
               <delay>0</delay>
               <history>7d</history>
               <value_type>FLOAT</value_type>
               <units>%</units>
               <description>Indicates the percentage of pages found in the buffer cache without having to read from disk. The ratio is the total number of cache hits divided by the total number of cache lookups over the last few thousand page accesses. After a long period of time, the ratio moves very little. Because reading from the cache is much less expensive than reading from disk, you want this ratio to be high. Generally, you can increase the buffer cache hit ratio by increasing the amount of memory available to SQL Server or by using the buffer pool extension feature.</description>
               <applications>
                  <application>
                     <name>MSSQL</name>
                  </application>
               </applications>
               <preprocessing>
                  <step>
                     <type>JSONPATH</type>
                     <params>$[?(@.object_name=='{$MSSQL.INSTANCE}:Buffer Manager' &amp;&amp; @.counter_name=='BufferCacheHitRatio')].cntr_value.first()</params>
                  </step>
               </preprocessing>
               <master_item>
                  <key>db.odbc.get[get_status_variables,"{$MSSQL.DSN}"]</key>
               </master_item>
               <triggers>
                  <trigger>
                     <expression>{max(5m)}&lt;{$MSSQL.BUFFER_CACHE_RATIO.MIN.CRIT}</expression>
                     <name>MSSQL: Percentage of the buffer cache efficiency is low (below {$MSSQL.BUFFER_CACHE_RATIO.MIN.CRIT}% for 5m)</name>
                     <priority>HIGH</priority>
                     <description>Too low buffer cache hit ratio.</description>
                  </trigger>
                  <trigger>
                     <expression>{max(5m)}&lt;{$MSSQL.BUFFER_CACHE_RATIO.MIN.WARN}</expression>
                     <name>MSSQL: Percentage of the buffer cache efficiency is low (below {$MSSQL.BUFFER_CACHE_RATIO.MIN.WARN}% for 5m)</name>
                     <priority>WARNING</priority>
                     <description>Low buffer cache hit ratio.</description>
                     <dependencies>
                        <dependency>
                           <name>MSSQL: Percentage of the buffer cache efficiency is low (below {$MSSQL.BUFFER_CACHE_RATIO.MIN.CRIT}% for 5m)</name>
                           <expression>{Template DB MSSQL by ODBC:mssql.buffer_cache_hit_ratio.max(5m)}&lt;{$MSSQL.BUFFER_CACHE_RATIO.MIN.CRIT}</expression>
                        </dependency>
                     </dependencies>
                  </trigger>
               </triggers>
            </item>


Can you tell me how to get an item out of this with a request, make a trigger.
Well, or maybe there are thoughts about what ODBC queries can be used to monitor MS SQL database?
Thank you all in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
slden, 2021-03-16
@slden

Specifically, my problem was solved using the MS SQL ODBC template for Zabbix 5.0, just for this I had to manually specify the old Zabbix version in the template .xml file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question