78 lines
2.1 KiB
Markdown
78 lines
2.1 KiB
Markdown
# zuplates
|
|
|
|
help updating zabbix templates
|
|
|
|
## install
|
|
* consider using venv
|
|
* install depdencies
|
|
```bash
|
|
pip install pyyaml
|
|
pip install requests
|
|
pip install zabbix_utils
|
|
```
|
|
* configure Zabbix access in `config.yml`
|
|
```
|
|
zabbix:
|
|
servers:
|
|
foo:
|
|
url: https://your.zabbix.example.com
|
|
token: abc123
|
|
bar:
|
|
url: https://other.zabbix.example.com
|
|
token: cba321
|
|
```
|
|
* user must have access to API `template.get`
|
|
|
|
## usage
|
|
* get an overview of *used* templates: `./main.py --overview --server foo`
|
|
```
|
|
Borg Backup Passive
|
|
Vendor:
|
|
Version:
|
|
UUID: 3077e7298167465b96d30503bcff4769
|
|
used by hosts:
|
|
devloop.de
|
|
!!! not found in templates.yml
|
|
FreeBSD by Zabbix agent
|
|
Vendor: Zabbix
|
|
Version: 7.0-2
|
|
UUID: a3dc630729e443139f4e608954fa6e19
|
|
used by hosts:
|
|
router.exmaple.com
|
|
...
|
|
```
|
|
* get an overview of *used* templates in machine readable format: `./main.py --overview --server foo --format machine`
|
|
* copy&paste'able into libre calc
|
|
```
|
|
name vendor version uuid hosts known
|
|
Borg Backup Passive 3077e7298167465b96d30503bcff4769 devloop.de,blah.example.com,moep.example.com no
|
|
FreeBSD by Zabbix agent Zabbix 7.0-2 a3dc630729e443139f4e608954fa6e19 router.exmaple.com yes
|
|
...
|
|
```
|
|
* check for new versions and download known templates: `./main.py --check --server foo`
|
|
```
|
|
found update for Template Module Generic SNMPv2
|
|
found update for Template OS FreeBSD
|
|
found update for Ubiquiti AirOS by SNMP
|
|
found update for Website certificate by Zabbix agent 2
|
|
found update for Zabbix proxy health
|
|
found update for Zabbix server health
|
|
```
|
|
* new template versions saved in `downloads`
|
|
* manually import into zabbix
|
|
|
|
## known templates
|
|
* templates are looked up in `templates.yml`
|
|
* structure is like:
|
|
```yml
|
|
templates:
|
|
<uuid of template>:
|
|
vendor: <reference to vendors/vendor name>
|
|
path: <added to raw from vendor>
|
|
...
|
|
vendors:
|
|
<vendor name>:
|
|
raw: <generic part of vendor url for downloading yml template>
|
|
qry: <query to add to url>
|
|
```
|
|
* template download URL will be the concatination of `raw`, `path` and `qry` |