mirror of
https://github.com/bashclub/check-unifi-controller.git
synced 2025-07-03 22:59:09 +02:00
Initial Version 0.75
This commit is contained in:
26
share/check_mk/checks/agent_unifi_controller
Normal file
26
share/check_mk/checks/agent_unifi_controller
Normal file
@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
|
||||
|
Reference in New Issue
Block a user