From 9e6f933485374edc9ce3cf2408e10492c3429479 Mon Sep 17 00:00:00 2001 From: Frogg Date: Fri, 15 May 2026 17:55:33 +0200 Subject: [PATCH] Ajout des template zabbix --- zabbix_template_v4.4.xml | 119 +++++++++++++++++++++++++++ zabbix_template_v6.json | 166 ++++++++++++++++++++++++++++++++++++++ zabbix_template_v7.json | 168 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 453 insertions(+) create mode 100644 zabbix_template_v4.4.xml create mode 100644 zabbix_template_v6.json create mode 100644 zabbix_template_v7.json diff --git a/zabbix_template_v4.4.xml b/zabbix_template_v4.4.xml new file mode 100644 index 0000000..d90be36 --- /dev/null +++ b/zabbix_template_v4.4.xml @@ -0,0 +1,119 @@ + + + 4.4 + 2020-03-15T17:33:38Z + + + Templates + + + Templates/Modules + + + + + + + + {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}].last()}<={$SSL.AVG} and {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}].last()}>0 and {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}].last()}=1 + {$SSL.DNS} expire in {ITEM.LASTVALUE} + AVERAGE + + + {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}].last()}<={$SSL.INFO} and {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}].last()}>{$SSL.WARN} and {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}].last()}=1 + {$SSL.DNS} expire in {ITEM.LASTVALUE} + INFO + + + {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}].last()}<={$SSL.WARN} and {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}].last()}>{$SSL.AVG} and {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}].last()}=1 + {$SSL.DNS} expire in {ITEM.LASTVALUE} + WARNING + + + {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}].last()}=1 and {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}].last()}<=0 + {$SSL.DNS} is expired + HIGH + + + {Template Module SSL:frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}].last()}=9999999999 + {HOST.NAME} $SSL.DNS macro is missing + WARNING + + + \ No newline at end of file diff --git a/zabbix_template_v6.json b/zabbix_template_v6.json new file mode 100644 index 0000000..4b41366 --- /dev/null +++ b/zabbix_template_v6.json @@ -0,0 +1,166 @@ +{ + "zabbix_export": { + "version": "6.0", + "date": "2026-05-15T15:31:59Z", + "groups": [ + { + "uuid": "7df96b18c230490a9a0a9e2307226338", + "name": "Templates" + }, + { + "uuid": "57b7ae836ca64446ba2c296389c009b7", + "name": "Templates/Modules" + } + ], + "templates": [ + { + "uuid": "ea52c36203c5499cbce2442d531b1a22", + "template": "Template Module SSL", + "name": "Template Module SSL", + "description": "Check the number of days left on certificate validity", + "groups": [ + { + "name": "Templates" + }, + { + "name": "Templates/Modules" + } + ], + "items": [ + { + "uuid": "f4b17a79409f49128da060d6ae51b222", + "name": "SSL content", + "type": "EXTERNAL", + "key": "frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}]", + "delay": "3h", + "history": "30d", + "trends": "0", + "tags": [ + { + "tag": "Application", + "value": "SSL" + } + ], + "triggers": [ + { + "uuid": "20afab053524490fbe1879f7eac60c99", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}])=2", + "name": "SSL error on {$SSL.DNS}", + "priority": "WARNING" + }, + { + "uuid": "c5cd25cae966488a83fbf065f6852a7a", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}])=3", + "name": "{$SSL.DNS} content is empty", + "priority": "WARNING" + }, + { + "uuid": "51ac332de7b84ce4b384a4661d1ebac3", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} did not respond in 3s", + "priority": "WARNING" + } + ] + }, + { + "uuid": "8c8730cbc3ed44f89e6f0d4864e4d34f", + "name": "SSL certificate exist", + "type": "EXTERNAL", + "key": "frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}]", + "delay": "3h", + "history": "30d", + "trends": "0", + "tags": [ + { + "tag": "Application", + "value": "SSL" + } + ], + "triggers": [ + { + "uuid": "8f11d1905bd14931a782ef2ad0994d2b", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=0", + "name": "SLL certificate unavailable for {$SSL.DNS}", + "priority": "HIGH" + }, + { + "uuid": "52068710e0d1473cb8e86ffeb7a2ec45", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=9999999999", + "name": "{HOST.NAME} $SSL.DNS macro is missing", + "priority": "WARNING" + } + ] + }, + { + "uuid": "1f3b8e2ee8884465ad019c981e9a46f3", + "name": "SSL expiration", + "type": "EXTERNAL", + "key": "frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}]", + "delay": "6h", + "history": "30d", + "trends": "0", + "units": "days", + "tags": [ + { + "tag": "Application", + "value": "SSL" + } + ] + } + ], + "macros": [ + { + "macro": "{$SSL.AVG}", + "value": "5", + "description": "number of days left before triggering average" + }, + { + "macro": "{$SSL.DNS}", + "description": "web server DNS name" + }, + { + "macro": "{$SSL.INFO}", + "value": "30", + "description": "number of days left before triggering information" + }, + { + "macro": "{$SSL.PORT}", + "value": "443", + "description": "server web ssl port" + }, + { + "macro": "{$SSL.WARN}", + "value": "15", + "description": "number of days left before triggering warning" + } + ] + } + ], + "triggers": [ + { + "uuid": "65f1ffaa4a094dc792a977113af67c38", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<={$SSL.AVG} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])>0 and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} expire in {ITEM.LASTVALUE}", + "priority": "AVERAGE" + }, + { + "uuid": "8121f55bfb354866a50fd6672e846a07", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<={$SSL.INFO} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])>{$SSL.WARN} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} expire in {ITEM.LASTVALUE}", + "priority": "INFO" + }, + { + "uuid": "b604a8e1c3b84ae281b6dd3ff6c3aa6f", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<={$SSL.WARN} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])>{$SSL.AVG} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} expire in {ITEM.LASTVALUE}", + "priority": "WARNING" + }, + { + "uuid": "2948aec076d54f34b3338256f671c29a", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1 and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<=0", + "name": "{$SSL.DNS} is expired", + "priority": "HIGH" + } + ] + } +} \ No newline at end of file diff --git a/zabbix_template_v7.json b/zabbix_template_v7.json new file mode 100644 index 0000000..616ac2e --- /dev/null +++ b/zabbix_template_v7.json @@ -0,0 +1,168 @@ +{ + "zabbix_export": { + "version": "7.0", + "template_groups": [ + { + "uuid": "7df96b18c230490a9a0a9e2307226338", + "name": "Templates" + }, + { + "uuid": "57b7ae836ca64446ba2c296389c009b7", + "name": "Templates/Modules" + } + ], + "templates": [ + { + "uuid": "ea52c36203c5499cbce2442d531b1a22", + "template": "Template Module SSL", + "name": "Template Module SSL", + "description": "Check the number of days left on certificate validity", + "groups": [ + { + "name": "Templates" + }, + { + "name": "Templates/Modules" + } + ], + "items": [ + { + "uuid": "f4b17a79409f49128da060d6ae51b222", + "name": "SSL content", + "type": "EXTERNAL", + "key": "frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}]", + "delay": "3h", + "history": "720h", + "trends": "0", + "value_type": "TEXT", + "tags": [ + { + "tag": "Application", + "value": "SSL" + } + ], + "triggers": [ + { + "uuid": "20afab053524490fbe1879f7eac60c99", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}])=2", + "name": "SSL error on {$SSL.DNS}", + "priority": "WARNING" + }, + { + "uuid": "c5cd25cae966488a83fbf065f6852a7a", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}])=3", + "name": "{$SSL.DNS} content is empty", + "priority": "WARNING" + }, + { + "uuid": "51ac332de7b84ce4b384a4661d1ebac3", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=content,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} did not respond in 3s", + "priority": "WARNING" + } + ] + }, + { + "uuid": "8c8730cbc3ed44f89e6f0d4864e4d34f", + "name": "SSL certificate exist", + "type": "EXTERNAL", + "key": "frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}]", + "delay": "3h", + "history": "720h", + "trends": "0", + "value_type": "TEXT", + "tags": [ + { + "tag": "Application", + "value": "SSL" + } + ], + "triggers": [ + { + "uuid": "8f11d1905bd14931a782ef2ad0994d2b", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=0", + "name": "SLL certificate unavailable for {$SSL.DNS}", + "priority": "HIGH" + }, + { + "uuid": "52068710e0d1473cb8e86ffeb7a2ec45", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=9999999999", + "name": "{HOST.NAME} $SSL.DNS macro is missing", + "priority": "WARNING" + } + ] + }, + { + "uuid": "1f3b8e2ee8884465ad019c981e9a46f3", + "name": "SSL expiration", + "type": "EXTERNAL", + "key": "frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}]", + "delay": "6h", + "history": "720h", + "trends": "365d", + "value_type": "FLOAT", + "units": "days", + "tags": [ + { + "tag": "Application", + "value": "SSL" + } + ] + } + ], + "macros": [ + { + "macro": "{$SSL.AVG}", + "value": "5", + "description": "number of days left before triggering average" + }, + { + "macro": "{$SSL.DNS}", + "description": "web server DNS name" + }, + { + "macro": "{$SSL.INFO}", + "value": "30", + "description": "number of days left before triggering information" + }, + { + "macro": "{$SSL.PORT}", + "value": "443", + "description": "server web ssl port" + }, + { + "macro": "{$SSL.WARN}", + "value": "15", + "description": "number of days left before triggering warning" + } + ] + } + ], + "triggers": [ + { + "uuid": "65f1ffaa4a094dc792a977113af67c38", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<={$SSL.AVG} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])>0 and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} expire in {ITEM.LASTVALUE}", + "priority": "AVERAGE" + }, + { + "uuid": "8121f55bfb354866a50fd6672e846a07", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<={$SSL.INFO} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])>{$SSL.WARN} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} expire in {ITEM.LASTVALUE}", + "priority": "INFO" + }, + { + "uuid": "b604a8e1c3b84ae281b6dd3ff6c3aa6f", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<={$SSL.WARN} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])>{$SSL.AVG} and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1", + "name": "{$SSL.DNS} expire in {ITEM.LASTVALUE}", + "priority": "WARNING" + }, + { + "uuid": "2948aec076d54f34b3338256f671c29a", + "expression": "last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=exist,-s={$SSL.DNS},-p={$SSL.PORT}])=1 and last(/Template Module SSL/frogg_ssl_check/frogg_ssl_check.sh[-a=expire,-s={$SSL.DNS},-p={$SSL.PORT}])<=0", + "name": "{$SSL.DNS} is expired", + "priority": "HIGH" + } + ] + } +} \ No newline at end of file