Module: check_mk
Branch: master
Commit: 5ef979e277401035557e34ccbe6175beaaf704a6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5ef979e2774010…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 3 11:16:09 2013 +0200
check_mkevents now allows specification of a UNIX socket
---
ChangeLog | 2 +
mkeventd/checks/check_mkevents | 6 ++++-
mkeventd/web/plugins/wato/mkeventd.py | 42 ++++++++++++++++++++++-----------
3 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f6b6826..7ae071e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -124,6 +124,8 @@
Event Console:
* FIX: check_mkevents: fix usage help if called with illegal options
+ * check_mkevents now allows specification of a UNIX socket
+ This is needed in non-OMD environments
* setup.py now tries to setup Event Console even in non-OMD world
1.2.2b5:
diff --git a/mkeventd/checks/check_mkevents b/mkeventd/checks/check_mkevents
index 3f54b74..1f322ca 100644
--- a/mkeventd/checks/check_mkevents
+++ b/mkeventd/checks/check_mkevents
@@ -4,7 +4,11 @@
def check_mkevents_arguments(params):
args = ""
if "remote" in params:
- args += "-H %s:%d " % (params["remote"])
+ remote = params["remote"]
+ if type(remote) == tuple:
+ args += "-H %s:%d " % (quote_shell_string(remote[0]), remote[1])
+ else:
+ args += "-H %s " % quote_shell_string(remote)
if params.get("ignore_acknowledged"):
args += "-a "
args += params.get("hostspec", "$HOSTADDRESS$")
diff --git a/mkeventd/web/plugins/wato/mkeventd.py
b/mkeventd/web/plugins/wato/mkeventd.py
index cd7fb7c..f3ec445 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -1732,24 +1732,38 @@ register_rule(
)
),
( "remote",
- Tuple(
+ Alternative(
+ title = _("Access to the Event Console"),
elements = [
+ Tuple(
+ elements = [
+ TextAscii(
+ title = _("Hostname/IP address of Event
Console:"),
+ allow_empty = False,
+ ),
+ Integer(
+ title = _("TCP Port number:"),
+ minvalue = 1,
+ maxvalue = 65535,
+ default_value = 6558,
+ ),
+ ],
+ title = _("Access via TCP"),
+ help = _("In a distributed setup where the Event Console
is not running in the same "
+ "site as the host is monitored you need to access
the remote Event Console "
+ "via TCP. Please make sure that this is activated
in the global settings of "
+ "the event console. The default port number is
6558."),
+ ),
TextAscii(
- title = _("Hostname/IP address of Event Console:"),
+ title = _("Access via UNIX socket"),
allow_empty = False,
+ size = 64,
),
- Integer(
- title = _("TCP Port number:"),
- minvalue = 1,
- maxvalue = 65535,
- default_value = 6558,
- ),
- ],
- title = _("Access Event Console via TCP"),
- help = _("In a distributed setup where the Event Console is not
running in the same "
- "site as the host is monitored you need to access the
remote Event Console "
- "via TCP. Please make sure that this is activated in the
global settings of "
- "the event console. The default port number is
6558."),
+
+ ],
+ default_value = defaults.omd_root
+ and defaults.omd_root + "/tmp/run/mkeventd/status"
+ or defaults.livestatus_unix_socket.split("/",1)[0] +
"/mkeventd/status"
)
),
],