Cleanup config.nodes_of
[check_mk.git] / checks / check_mkevents
blobf391056cdcdccb6c6d9b201c95577925e44dd97c
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
5 def check_mkevents_arguments(params):
6 args = ""
7 if "remote" in params:
8 remote = params["remote"]
9 if isinstance(remote, tuple):
10 args += "-H %s:%d " % (quote_shell_string(remote[0]), remote[1])
11 elif remote:
12 args += "-s %s " % quote_shell_string(remote)
14 if params.get("ignore_acknowledged"):
15 args += "-a "
17 hostspec = params.get("hostspec", "$HOSTADDRESS$")
18 if isinstance(hostspec, list):
19 hostspec = "/".join(hostspec)
20 args += hostspec
22 if "application" in params:
23 args += " " + quote_shell_string(params["application"])
24 return args
27 def check_mkevents_description(params):
28 item = params.get('item', params.get('application'))
29 if item:
30 return "Events %s" % item
31 return "Events"
34 active_check_info['mkevents'] = {
35 "command_line": '$USER1$/check_mkevents $ARG1$',
36 "argument_function": check_mkevents_arguments,
37 "service_description": check_mkevents_description,