mirror of
https://github.com/bashclub/check-unifi-controller.git
synced 2024-11-08 12:32:00 +01:00
27 lines
946 B
Plaintext
27 lines
946 B
Plaintext
|
#!/usr/bin/env python3
|
||
|
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
||
|
|
||
|
#Function get params (in this case is port, passed via WATO agent rule cunfiguration, hostname and ip addres of host,
|
||
|
#for which agent will be invoked
|
||
|
def agent_unifi_controller_arguments(params, hostname, ipaddress):
|
||
|
args = [
|
||
|
'--user', params['user'],
|
||
|
'--password', passwordstore_get_cmdline('%s', params['password']),
|
||
|
'--port', params['port'],
|
||
|
'--piggyback',params['piggyback'],
|
||
|
]
|
||
|
_site = params.get("site")
|
||
|
if _site:
|
||
|
args += ["--site",_site]
|
||
|
if 'ignore_cert' in params and params['ignore_cert'] != '':
|
||
|
args += ['--ignore-cert']
|
||
|
args += [ipaddress]
|
||
|
return args
|
||
|
|
||
|
|
||
|
#register invoke function for our agent
|
||
|
#key value for this dictionary is name part from register datasource of our agent (name="special_agents:myspecial")
|
||
|
special_agent_info['unifi_controller'] = agent_unifi_controller_arguments
|
||
|
|
||
|
|