Skip to content

Commit

Permalink
added zabbix api_version()
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriWahl committed Mar 26, 2024
1 parent 0a7a358 commit e505097
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Nagstamon/Servers/ZabbixProblemBased.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def do_request(self, method, params={}, no_auth=False):

return response_json['result']

def api_version(self, **options):
obj = self.do_request('apiinfo.version', options, no_auth=True)
return obj['result']

def logged_in(self):
if self.zbx_auth is None:
return False
Expand Down
3 changes: 1 addition & 2 deletions Nagstamon/thirdparty/zabbix_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ def logged_in(self):
return False

def api_version(self, **options):
# kicked out check auth to be able to check vesion before being logged in to use the correct username keyword
#self.__checkauth__()
# kicked out check auth to be able to check version before being logged in to use the correct username keyword
obj = self.do_request(self.json_obj('apiinfo.version', options, auth=False))
return obj['result']

Expand Down

0 comments on commit e505097

Please sign in to comment.