[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

Sebastien Coavoux s.coavoux at free.fr
Tue Feb 28 22:05:44 UTC 2012


The following commit has been merged in the debian/master branch:
commit fd04aa96d47ab00c62e852d995fcf0a841c388ff
Author: Sebastien Coavoux <s.coavoux at free.fr>
Date:   Sat Nov 5 18:28:28 2011 +0100

    Updating file to fit to the actual version of Shinken

diff --git a/shinken/modules/ndodb_mysql_broker/ndodb_mysql_broker.py b/shinken/modules/ndodb_mysql_broker/ndodb_mysql_broker.py
index 0706d73..e90e005 100644
--- a/shinken/modules/ndodb_mysql_broker/ndodb_mysql_broker.py
+++ b/shinken/modules/ndodb_mysql_broker/ndodb_mysql_broker.py
@@ -809,6 +809,20 @@ class Ndodb_Mysql_broker(BaseModule):
 
 
     #A notification have just be created, we INSERT it
-    #def manage_notification_raise_brok(self, b):
-    #    query = self.db.create_insert_query('notification', b.data)
-    #    return [query]
+    def manage_notification_raise_brok(self, b):
+
+        data = b.data
+        print "CREATING A NOTIFICATION", data
+        if data['service_description'] != '':
+            object_id = self.get_service_object_id_by_name(data['host_name'], data['service_description'])
+        else:
+            object_id = self.get_host_object_id_by_name(data['host_name'])
+
+        notification_data = {'notification_id' : data['id'], 'instance_id' :  data['instance_id'],
+                             'start_time' : de_unixify(data['start_time']),
+                             'end_time' : de_unixify(data['end_time']),
+                             'state' : data['state']                             
+                             }
+        
+        query = self.db.create_insert_query('notifications', notification_data)
+        return [query]

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list