Skip to content

Commit

Permalink
Added support for Zabbix 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfb committed Mar 20, 2023
1 parent 40c52d7 commit 12a6b13
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- '5.4'
- '6.0'
- '6.2'
- '6.4'
flavour:
- name: Redis Server
slug: redis-server
Expand Down Expand Up @@ -70,6 +71,7 @@ jobs:
-D version=${{ matrix.version }} \
-D name='${{ matrix.flavour.name }}' \
-D description="Template App ${{ matrix.flavour.name }} $TAG_NAME" \
-D release="${TAG_NAME:1}" \
--extension=extensions.zabbix.ZabbixExtension --strict -o template.xml template-app-${{ matrix.flavour.slug }}.j2
- name: Upload template
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- ?:
- Added support for Zabbix 6.4.

- 10.0 (2022-07-05):
- Added support for Zabbix 6.2.

Expand Down
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@

$ pip install jinja2-cli
$ PYTHONPATH=. jinja2 \
-D version={5.0,5.2,5.4,6.0,6.2} \
-D version={5.0,5.2,5.4,6.0,6.2,6.4} \
[-D name='Redis Server'] \
[-D description=''] \
[-D release='trunk'] \
--extension=extensions.zabbix.ZabbixExtension --strict -o template.xml template-app-redis-server.j2
$ PYTHONPATH=. jinja2 \
-D version={5.0,5.2,5.4,6.0,6.2} \
-D version={5.0,5.2,5.4,6.0,6.2,6.4} \
[-D name='Redis Sentinel'] \
[-D description=''] \
[-D release='trunk'] \
--extension=extensions.zabbix.ZabbixExtension --strict -o template.xml template-app-redis-sentinel.j2

4. Link hosts to the templates. Beware depending on the used template you must set a value for the ``{$REDIS_SERVER.LOCATIONS}`` or ``{$REDIS_SENTINEL.LOCATIONS}`` macro (comma-delimited list of Redis instances; ``port``, ``host:port`` and ``unix:///path/to/socket`` formats are allowed). Additional macros and contexts are available for further customizations.
13 changes: 12 additions & 1 deletion template-app-redis-sentinel.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{%- set description = description|default('') -%}

{%- set release = release|default('trunk') -%}

{%- set seed = ['Allenta', 'Redis Sentinel']|join('/') -%}

{%- set master = 'redis_sentinel.stats["{$REDIS_SENTINEL.LOCATIONS}"]' -%}
Expand Down Expand Up @@ -134,7 +136,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>{{ version }}</version>
<date>2018-10-30T08:22:30Z</date>
{% if version in ('5.0', '5.2', '5.4', '6.0', '6.2') %}
<date>2018-10-30T08:22:30Z</date>
{% endif %}
{% if version not in ('5.0', '5.2', '5.4', '6.0') %}
<template_groups>
<template_group>
Expand Down Expand Up @@ -163,6 +167,12 @@
{% if description %}
<description>{{ description|e }}</description>
{% endif %}
{% if version not in ('5.0', '5.2', '5.4', '6.0', '6.2') %}
<vendor>
<name>Allenta Consulting S.L.</name>
<version>{{ version }}-{{ release|e }}</version>
</vendor>
{% endif %}
<groups>
<group>
<name>Templates</name>
Expand Down Expand Up @@ -455,6 +465,7 @@
'name': 'masters:{#SUBJECT}:status',
'type': 'DEPENDENT',
'key': 'redis_sentinel.info["{#LOCATION_ID}","masters:{#SUBJECT_ID}:status"]',
'trends': false,
'value_type': 'TEXT',
'master_item_key': master,
'preprocessing': [
Expand Down
12 changes: 11 additions & 1 deletion template-app-redis-server.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{%- set description = description|default('') -%}

{%- set release = release|default('trunk') -%}

{%- set seed = ['Allenta', 'Redis Server']|join('/') -%}

{%- set master = 'redis_server.stats["{$REDIS_SERVER.LOCATIONS}"]' -%}
Expand Down Expand Up @@ -134,7 +136,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>{{ version }}</version>
<date>2018-10-29T09:52:03Z</date>
{% if version in ('5.0', '5.2', '5.4', '6.0', '6.2') %}
<date>2018-10-29T09:52:03Z</date>
{% endif %}
{% if version not in ('5.0', '5.2', '5.4', '6.0') %}
<template_groups>
<template_group>
Expand Down Expand Up @@ -163,6 +167,12 @@
{% if description %}
<description>{{ description|e }}</description>
{% endif %}
{% if version not in ('5.0', '5.2', '5.4', '6.0', '6.2') %}
<vendor>
<name>Allenta Consulting S.L.</name>
<version>{{ version }}-{{ release|e }}</version>
</vendor>
{% endif %}
<groups>
<group>
<name>Templates</name>
Expand Down

0 comments on commit 12a6b13

Please sign in to comment.