Fix api calls

This commit is contained in:
outscale-kfe 2023-02-08 11:32:19 +01:00
parent 579ba0370d
commit 209d3fba7e
3 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ ZABBIX_URL = 'https://zabbix.internal' # URL of your Zabbix frontend used to cre
ZABBIX_LOGIN = 'Admin' # Login used to call Zabbix API ZABBIX_LOGIN = 'Admin' # Login used to call Zabbix API
ZABBIX_PASS = 'admin' # Password used to call Zabbix API ZABBIX_PASS = 'admin' # Password used to call Zabbix API
LIMIT = 3000 # Number of alerts to retrieve for all host groups mentioned below LIMIT = 3000 # Number of alerts to retrieve for all host groups mentioned below
HOSTGROUP = "Zabbix*" # Host groups related to your alerts (e.g: "Zabbix servers","Zabbix proxy","Zabbix Frontend"). You can use a wildcard. HOSTGROUP = ["Zabbix*"] # Host groups related to your alerts (e.g: "Zabbix servers","Zabbix proxy","Zabbix Frontend"). You can use a wildcard.
SEVERITY = 3 # Minimum severity to retrieve SEVERITY = 3 # Minimum severity to retrieve
TIMEOUT = 20 # API Timeout TIMEOUT = 20 # API Timeout
PORT = 8080 # Listen port for the super-server PORT = 8080 # Listen port for the super-server

View File

@ -126,7 +126,7 @@ def get_hostgroups():
request['output'] = 'extend' request['output'] = 'extend'
request['search'] = dict() request['search'] = dict()
request['search']['name'] = hg request['search']['name'] = hg
request['searchWildcardsEnabled'] = 1 request['searchWildcardsEnabled'] = True
resp = zabbix_call(request, 'hostgroup') resp = zabbix_call(request, 'hostgroup')
for x in range(len(resp)): for x in range(len(resp)):
groups.append(resp[x]['name']) groups.append(resp[x]['name'])
@ -164,7 +164,7 @@ def get_problems(ttl_hash = None):
req['limit'] = limit req['limit'] = limit
req['groupids'] = groupids req['groupids'] = groupids
req['monitored'] = 1 req['monitored'] = 1
req['maintenance'] = 0 req['maintenance'] = False
req['active'] = 1 req['active'] = 1
req['min_severity'] = settings.SEVERITY req['min_severity'] = settings.SEVERITY
req['output'] = "extend" req['output'] = "extend"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 226 KiB