70 lines
1.7 KiB
Markdown
70 lines
1.7 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`
|
|
```
|
|
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
|
|
...
|
|
```
|
|
* check for new versions and download known templates: `./main.py --check`
|
|
```
|
|
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` |