ses-monitor/zabbix/zbx_ses_template_5.0.xml
Maksim Totmin fd45734a74 fix Zabbix 6.0 template triggers: avg(#3) on scenario.failed, remove duplicate ok trigger
- Change ses.scenario.failed triggers: last() -> avg(#3) for reliable detection
- Remove ses.scenario.ok trigger (duplicates scenario.failed > 0)
- Fix preprocessing: parameters with parameter child elements for Zabbix 6.0
- Remove UUID dashes (32 hex chars) for Zabbix 6.0 compatibility
- Fix template_groups -> groups format for Zabbix 6.0
- Fix strlen() -> length() for Zabbix 6.0 trigger compatibility
- All templates now have 6 triggers each
2026-06-23 19:24:03 +07:00

224 lines
10 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version='1.0' encoding='utf-8'?>
<zabbix_export>
<version>5.0</version>
<date>2026-06-19T12:00:00Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>SES Monitor</template>
<name>SES Monitor — Service Engine Server</name>
<description>Шаблон для мониторинга диалоговой сценарной машины SES.
Метрики отправляются watchdog-демоном ses-monitor через zabbix_sender (trapper).
Проверяет: доступность API, лицензию, выполнение сценариев.
Сценарии задаются в YAML-файлах (config/scenarios/). Все сценарии
агрегируются в фиксированные метрики — шаблон универсален и не зависит
от количества или состава сценариев.</description>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<macros>
<macro>
<macro>{$SES_API_TIMEOUT_MS}</macro>
<value>5000</value>
<description>Порог медленного ответа API (миллисекунды)</description>
</macro>
</macros>
<items>
<!-- Liveness -->
<item>
<name>SES: API доступность</name>
<type>TRAP</type>
<key>ses.api.liveness</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>UNSIGNED</value_type>
<description>0 — API недоступен, 1 — работает. Проверяется GET /ses/hostname.</description>
<triggers>
<trigger>
<expression>{SES Monitor:ses.api.liveness.last()}=0</expression>
<name>SES API недоступен на {HOST.NAME}</name>
<priority>HIGH</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item>
<item>
<name>SES: время ответа API</name>
<type>TRAP</type>
<key>ses.api.response_time</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>FLOAT</value_type>
<units>ms</units>
<description>Время ответа GET /ses/hostname в миллисекундах.</description>
<triggers>
<trigger>
<expression>{SES Monitor:ses.api.response_time.last()}&gt;{$SES_API_TIMEOUT_MS}</expression>
<name>SES: медленный ответ API (&gt;{$SES_API_TIMEOUT_MS} мс)</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item>
<!-- License -->
<item>
<name>SES: статус лицензии</name>
<type>TRAP</type>
<key>ses.license.ok</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>UNSIGNED</value_type>
<description>0 — проблема с лицензией, 1 — в порядке.</description>
<triggers>
<trigger>
<expression>{SES Monitor:ses.license.ok.last()}=0</expression>
<name>SES: проблема с лицензией на {HOST.NAME}</name>
<priority>HIGH</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item>
<item>
<name>SES: дней до окончания лицензии</name>
<type>TRAP</type>
<key>ses.license.days_remaining</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>FLOAT</value_type>
<units>d</units>
<description>Количество дней до окончания лицензии SES. -1 = бессрочная.</description>
<triggers>
<trigger>
<expression>{SES Monitor:ses.license.days_remaining.last()}&gt;0 and {SES Monitor:ses.license.days_remaining.last()}&lt;30</expression>
<name>SES: лицензия истекает через (&lt;30 дней) на {HOST.NAME}</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item>
<item>
<name>SES: количество сценариев (роботов)</name>
<type>TRAP</type>
<key>ses.robots.count</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>UNSIGNED</value_type>
<description>Общее количество зарегистрированных сценариев (роботов).
Изменение значения может сигнализировать о проблемах конфигурации.</description>
</item>
<!-- Сценарии -->
<item>
<name>SES: тестовые сценарии — все успешны</name>
<type>TRAP</type>
<key>ses.scenario.ok</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>UNSIGNED</value_type>
<description>1 — все сценарии прошли, 0 — есть упавшие.</description>
</item>
<item>
<name>SES: тестовые сценарии — всего</name>
<type>TRAP</type>
<key>ses.scenario.total</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>UNSIGNED</value_type>
<description>Количество активных сценариев мониторинга.</description>
</item>
<item>
<name>SES: тестовые сценарии — упало</name>
<type>TRAP</type>
<key>ses.scenario.failed</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>UNSIGNED</value_type>
<description>Количество упавших сценариев за последний цикл.</description>
<triggers>
<trigger>
<expression>{SES Monitor:ses.scenario.failed.avg(#3)}&gt;0</expression>
<name>SES: тестовые сценарии мониторинга падают на {HOST.NAME}</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item>
<item>
<name>SES: тестовые сценарии — среднее время</name>
<type>TRAP</type>
<key>ses.scenario.avg_time</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>FLOAT</value_type>
<units>ms</units>
<description>Среднее время выполнения сценария (миллисекунды).</description>
</item>
<item>
<name>SES: тестовые сценарии — макс. время</name>
<type>TRAP</type>
<key>ses.scenario.max_time</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>FLOAT</value_type>
<units>ms</units>
<description>Максимальное время выполнения сценария (миллисекунды).</description>
</item>
<item>
<name>SES: тестовые сценарии — ошибка</name>
<type>TRAP</type>
<key>ses.scenario.error</key>
<delay>0</delay>
<history>7d</history>
<trends>31536000</trends>
<value_type>TEXT</value_type>
<description>Текст ошибки: "N сценариев упали". Пустая строка если всё хорошо.</description>
<triggers>
<trigger>
<expression>{SES Monitor:ses.scenario.error.last()} &lt;&gt; ''</expression>
<name>SES: критическая ошибка выполнения сценариев на {HOST.NAME}</name>
<priority>5</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item>
</items>
</template>
</templates>
</zabbix_export>