[omd-commits] OMD Git: omd: shinken: add two patches, so thruk can send external commands

git version control git at mathias-kettner.de
Thu Dec 23 21:51:07 CET 2010


Module: omd
Branch: master
Commit: 5789baf0f334fc6da8d6dfb845aa0747225db482
URL:    http://omdistro.org/projects/omd/repository/revisions/5789baf0f334fc6da8d6dfb845aa0747225db482

Author: Gerhard Lausser <gerhard.lausser at consol.de>
Date:   Thu Dec 23 20:50:27 2010 +0000

shinken: add two patches, so thruk can send external commands

---

 ...ix-a-bug-in-livestatus-get-hosts-with-limit.dif |   25 ++++++++++++++++
 ...in-livestatus.-Catch-the-exception-if-a-p.patch |   30 ++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/packages/shinken/patches/0001--Fix-a-bug-in-livestatus-get-hosts-with-limit.dif b/packages/shinken/patches/0001--Fix-a-bug-in-livestatus-get-hosts-with-limit.dif
new file mode 100644
index 0000000..e5522e7
--- /dev/null
+++ b/packages/shinken/patches/0001--Fix-a-bug-in-livestatus-get-hosts-with-limit.dif
@@ -0,0 +1,25 @@
+From b34dd5540c042a191e64d6b19d3c711148d1fac6 Mon Sep 17 00:00:00 2001
+From: Gerhard Lausser <gerhard.lausser at consol.de>
+Date: Thu, 23 Dec 2010 21:45:52 +0100
+Subject: [PATCH] *Fix a bug in livestatus (get hosts with limit)
+
+---
+ shinken/modules/livestatus_broker/livestatus.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/shinken/modules/livestatus_broker/livestatus.py b/shinken/modules/livestatus_broker/livestatus.py
+index 2645791..5f06d6b 100644
+--- a/shinken/modules/livestatus_broker/livestatus.py
++++ b/shinken/modules/livestatus_broker/livestatus.py
+@@ -5310,7 +5310,7 @@ class LiveStatus:
+                         filtresult = [y for y in [self.create_output(type_map, x, columns, filtercolumns) for x in hosts] if filter_stack(y)]
+                     else:
+                         prefiltresult = (x for x in hosts if filter_stack(self.create_output(type_map, x, [], filtercolumns)))
+-                        filtresult = [self.create_output(x, columns, filtercolumns) for x in prefiltresult]
++                        filtresult = [self.create_output(type_map, x, columns, filtercolumns) for x in prefiltresult]
+                     filtresult = filtresult[:limit]
+             elif table == 'hostsbygroup':
+                 type_map = LiveStatus.out_map['Hostsbygroup']
+-- 
+1.5.5.6
+
diff --git a/packages/shinken/patches/0001--Fix-a-bug-in-livestatus.-Catch-the-exception-if-a-p.patch b/packages/shinken/patches/0001--Fix-a-bug-in-livestatus.-Catch-the-exception-if-a-p.patch
new file mode 100644
index 0000000..b830b85
--- /dev/null
+++ b/packages/shinken/patches/0001--Fix-a-bug-in-livestatus.-Catch-the-exception-if-a-p.patch
@@ -0,0 +1,30 @@
+From 2df646b228f960984a6726598aa2cbe2f9a9745c Mon Sep 17 00:00:00 2001
+From: Gerhard Lausser <gerhard.lausser at consol.de>
+Date: Thu, 23 Dec 2010 21:31:10 +0100
+Subject: [PATCH] *Fix a bug in livestatus. Catch the exception if a peer is not listening for the response
+
+---
+ .../modules/livestatus_broker/livestatus_broker.py |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/shinken/modules/livestatus_broker/livestatus_broker.py b/shinken/modules/livestatus_broker/livestatus_broker.py
+index 8a5f821..4448463 100644
+--- a/shinken/modules/livestatus_broker/livestatus_broker.py
++++ b/shinken/modules/livestatus_broker/livestatus_broker.py
+@@ -857,7 +857,12 @@ class Livestatus_broker:
+     
+                         if handle_it:
+                             response, keepalive = self.livestatus.handle_request(open_connections[socketid]['buffer'].rstrip())
+-                            s.send(response)
++                            try:
++                                s.send(response)
++                            except:
++                                # Maybe the request was an external command and
++                                # the peer is not interested in a response at all
++                                pass
+ 
+                             # Write request/response in a tracefile
+ #                            if os.path.exists('/tmp/shinken.modules.livestatus.trace'):
+-- 
+1.5.5.6
+



More information about the omd-commits mailing list