[omd-commits] OMD Git: omd: shinken: update to 0.6.3

git version control git at mathias-kettner.de
Thu May 19 21:03:18 CEST 2011


Module:   omd
Branch:   master
Commit:   611b07af60e9545fffb45e4a952eb5c009bce924
URL:      http://omdistro.org/projects/omd/repository/revisions/611b07af60e9545fffb45e4a952eb5c009bce924

Author:   Gerhard Lausser <gerhard.lausser at consol.de>
Date:     Thu May 19 20:59:42 2011 +0200
Commiter: Gerhard Lausser <gerhard.lausser at consol.de>
Date:     Thu May 19 20:59:42 2011 +0200

shinken: update to 0.6.3

---

 packages/shinken/Makefile                          |   10 +-
 .../patches/0001-reuse-livestatus-socket.dif       |   11 --
 ...tatus-with-multiple-instance-now-clean-in.patch |  109 ++++++++++++++++++++
 ...-a-sys.exit-more-cleanly-affects-python-2.patch |   27 +++++
 packages/shinken/shinken-0.6.2.tar.gz              |  Bin 5142997 -> 0 bytes
 packages/shinken/shinken-0.6.3.tar.gz              |  Bin 0 -> 5143569 bytes
 6 files changed, 141 insertions(+), 16 deletions(-)

diff --git a/packages/shinken/Makefile b/packages/shinken/Makefile
index 93f000a..fe64699 100644
--- a/packages/shinken/Makefile
+++ b/packages/shinken/Makefile
@@ -1,7 +1,7 @@
 include ../../Makefile.omd
 
 
-SHINKEN=shinken-0.6.2
+SHINKEN=shinken-0.6.3
 SHINKEN_FILE=$(SHINKEN).tar.gz
 SHINKEN_URL=http://shinken-monitoring.org/pub/$(SHINKEN).tar.gz
 #
@@ -51,10 +51,10 @@ export PYTHONPATH
 build:
 	test -f ${SHINKEN_FILE} || wget $(SHINKEN_URL)
 	tar xzf $(SHINKEN_FILE)
-	#set -e ; for p in patches/*.dif ; do \
-	#    echo "applying $$p..." ; \
-	#    ( cd $(SHINKEN) ; patch -p1 -b ) < $$p ; \
-	#done
+	set -e ; for p in patches/*.patch ; do \
+	    echo "applying $$p..." ; \
+	    ( cd $(SHINKEN) ; patch -p1 -b ) < $$p ; \
+	done
 	test -f $(PYRO_FILE) || wget $(PYRO_URL)
 	tar xzf $(PYRO_FILE)
 	test -f $(MP_FILE) || wget $(MP_URL)
diff --git a/packages/shinken/patches/0001-reuse-livestatus-socket.dif b/packages/shinken/patches/0001-reuse-livestatus-socket.dif
deleted file mode 100644
index fdfbed7..0000000
--- a/packages/shinken/patches/0001-reuse-livestatus-socket.dif
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur shinken-0.6.orig/shinken/modules/livestatus_broker/livestatus_broker.py shinken-0.6/shinken/modules/livestatus_broker/livestatus_broker.py
---- shinken-0.6.orig/shinken/modules/livestatus_broker/livestatus_broker.py	2011-05-03 10:07:33.000000000 +0200
-+++ shinken-0.6/shinken/modules/livestatus_broker/livestatus_broker.py	2011-05-11 17:05:51.000000000 +0200
-@@ -750,6 +750,7 @@
-         if self.port:
-             server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-             server.setblocking(0)
-+            server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-             server.bind((self.host, self.port))
-             server.listen(backlog)
-             self.listeners.append(server)
diff --git a/packages/shinken/patches/1779-Fix-livestatus-with-multiple-instance-now-clean-in.patch b/packages/shinken/patches/1779-Fix-livestatus-with-multiple-instance-now-clean-in.patch
new file mode 100644
index 0000000..eaa1530
--- /dev/null
+++ b/packages/shinken/patches/1779-Fix-livestatus-with-multiple-instance-now-clean-in.patch
@@ -0,0 +1,109 @@
+From f62d263532c98ef7f22e54c30842bce72dafb3ba Mon Sep 17 00:00:00 2001
+From: naparuba <naparuba at users.sourceforge.net>
+Date: Thu, 19 May 2011 15:58:38 +0200
+Subject: [PATCH] Fix: livestatus with multiple instance now clean in a good way services.
+
+---
+ .../modules/livestatus_broker/livestatus_broker.py |   60 +++++++++++++++-----
+ 1 files changed, 45 insertions(+), 15 deletions(-)
+
+diff --git a/shinken/modules/livestatus_broker/livestatus_broker.py b/shinken/modules/livestatus_broker/livestatus_broker.py
+index 166b5ad..5a5cd8c 100644
+--- a/shinken/modules/livestatus_broker/livestatus_broker.py
++++ b/shinken/modules/livestatus_broker/livestatus_broker.py
+@@ -142,24 +142,40 @@ class Livestatus_broker(BaseModule):
+         # We should clean all previously added hosts and services
+         inst_id = data['instance_id']
+         to_del = []
++        to_del_srv = []
+         for h in self.hosts.values():
+             # If the host was in this instance, del it
+             if h.instance_id == inst_id:
+-                for s in h.services:
+-                    s_id = s.id
+-                    try:
+-                        del self.servicename_lookup_table[s.host_name + s.service_description]
+-                    except: # not found? not a crime
+-                        pass
+-                    try:
+-                        del self.services[s_id]
+-                    except: #maybe the hsot is deleted before we got it's service?
+-                        print "Debug warning : host service deleted but not found!"
+-                    try:
+-                        del self.hostname_lookup_table[h.host_name]
+-                    except KeyError: # maybe it was not inserted in a good way, pass it
+-                        pass
+-                    to_del.append(h.id)
++                try:
++                    del self.hostname_lookup_table[h.host_name]
++                except KeyError: # maybe it was not inserted in a good way, pass it
++                    pass
++                to_del.append(h.id)
++
++                
++        for s in self.services.values():
++            if s.instance_id == inst_id:
++                s_id = s.id
++                try:
++                    del self.servicename_lookup_table[s.host_name + s.service_description]
++                except: # not found? not a crime
++                    pass
++                try:
++                    del self.services[s_id]
++                except: #maybe the hsot is deleted before we got it's service?
++                    print "Debug warning : host service deleted but not found!"
++                to_del_srv.append(s_id)
++
++        # Now clean hostgroups too
++        for hg in self.hostgroups.values():
++            print "Len before exclude", len(hg.members)
++            # Exclude from members the hosts with this inst_id
++            hg.members = [h for h in hg.members if h.instance_id != inst_id]
++            print "Len after", len(hg.members)
++
++        # Now clean service groups
++        for sg in self.servicegroups.values():
++            sg.members = [s for s in sg.members if s.instance_id != inst_id]
+ 
+         # Ok, really clean the hosts
+         for i in to_del:
+@@ -168,6 +184,14 @@ class Livestatus_broker(BaseModule):
+             except KeyError: # maybe it was not inserted in a good way, pass it
+                 pass
+ 
++        # And services
++        for i in to_del_srv:
++            try:
++                del self.services[i]
++            except KeyError: # maybe it was not inserted in a good way, pass it
++                pass
++
++
+ 
+     def manage_update_program_status_brok(self, b):
+         data = b.data
+@@ -266,8 +290,13 @@ class Livestatus_broker(BaseModule):
+     def manage_initial_service_status_brok(self, b):
+         data = b.data
+         s_id = data['id']
++
++        inst_id = data['instance_id']
++        
+         #print "Creating Service:", s_id, data
+         s = Service({})
++        s.instance_id = inst_id
++
+         self.update_element(s, data)
+         self.set_schedulingitem_values(s)
+         
+@@ -285,6 +314,7 @@ class Livestatus_broker(BaseModule):
+         self.servicename_lookup_table[s.host_name + s.service_description] = s_id
+         self.number_of_objects += 1
+ 
++
+     #In fact, an update of a service is like a check return
+     def manage_update_service_status_brok(self, b):
+         self.manage_service_check_result_brok(b)
+-- 
+1.5.5.6
+
diff --git a/packages/shinken/patches/1780--handle-a-sys.exit-more-cleanly-affects-python-2.patch b/packages/shinken/patches/1780--handle-a-sys.exit-more-cleanly-affects-python-2.patch
new file mode 100644
index 0000000..c5ac726
--- /dev/null
+++ b/packages/shinken/patches/1780--handle-a-sys.exit-more-cleanly-affects-python-2.patch
@@ -0,0 +1,27 @@
+From 00bc226eddde3fdcb4e5be756531b133fba35f80 Mon Sep 17 00:00:00 2001
+From: Gerhard Lausser <gerhard.lausser at consol.de>
+Date: Thu, 19 May 2011 16:01:33 +0200
+Subject: [PATCH] *handle a sys.exit() more cleanly (affects python 2.4) when calling the arbiter with -v
+
+---
+ shinken/daemons/arbiterdaemon.py |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/shinken/daemons/arbiterdaemon.py b/shinken/daemons/arbiterdaemon.py
+index 2806eb7..710e739 100644
+--- a/shinken/daemons/arbiterdaemon.py
++++ b/shinken/daemons/arbiterdaemon.py
+@@ -418,6 +418,10 @@ class Arbiter(Daemon):
+ 
+             ## And go for the main loop
+             self.do_mainloop()
++        except SystemExit, exp:
++            # With a 2.4 interpreter the sys.exit() in load_config_file
++            # ends up here and must be handled.
++            sys.exit(exp.code)
+         except Exception, exp:
+             logger.log("CRITICAL ERROR : I got an non recovarable error. I must exit")
+             logger.log("You can log a bug ticket at https://sourceforge.net/apps/trac/shinken/newticket for geting help")
+-- 
+1.5.5.6
+
diff --git a/packages/shinken/shinken-0.6.2.tar.gz b/packages/shinken/shinken-0.6.2.tar.gz
deleted file mode 100644
index 1a53d1b..0000000
Binary files a/packages/shinken/shinken-0.6.2.tar.gz and /dev/null differ
diff --git a/packages/shinken/shinken-0.6.3.tar.gz b/packages/shinken/shinken-0.6.3.tar.gz
new file mode 100644
index 0000000..170eb52
Binary files /dev/null and b/packages/shinken/shinken-0.6.3.tar.gz differ



More information about the omd-commits mailing list