Как мониторить MS SQL через odbc-запросы в Zabbix?

Есть Zabbix версии 4.4.7

Планируется мониторить БД MS SQL через odbc запросы, без установки заббикс-агента на хост.
В Zabbix 5.0 есть готовый шаблон mssql_odbc.
Планировал "вытащить" из него все триггеры с priority High, и соответствующие им айтемы (odbc-запросы).
Начал изучать шаблон, и не понял как собственно вытащить и адаптировать триггеры под страый заббикс.

Кидаю пример:

<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>


Может подскажите как мне из этого вытащить айтем с запросом, сделать триггер.
Ну или может есть мысли какими ODBC-запросами можно мониторить MS SQL базу?
Заранее всем спасибо!
  • Вопрос задан
  • 1027 просмотров
Пригласить эксперта
Ответы на вопрос 1
slden
@slden Автор вопроса
Конкретно моя проблема решилась использованием шаблона MS SQL ODBC для Zabbix 5.0, просто для этого пришлось руками указать старую Zabbix-версию в .xml файле шаблона
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы