[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, upstream, updated. e9a5a6997d9dd8b31b433b5bcbad495448db0131

Sven Nierlein sven at nierlein.org
Thu Apr 7 08:06:41 UTC 2011


The following commit has been merged in the upstream branch:
commit 6a3ac3378ee49772838696b7cd3e2c152d3fadc1
Author: Sven Nierlein <sven at nierlein.org>
Date:   Sun Mar 13 21:19:45 2011 +0100

    added export data for process_data and timed_event_data

diff --git a/neb_module/mod_gearman.c b/neb_module/mod_gearman.c
index c1a1d9b..1444b12 100644
--- a/neb_module/mod_gearman.c
+++ b/neb_module/mod_gearman.c
@@ -970,11 +970,13 @@ int handle_export(int event_type, void *data) {
     int i;
     char * buffer;
     char * type;
-    nebstruct_log_data * nld;
     temp_buffer[0]          = '\x0';
     int debug_level_orig    = mod_gm_opt->debug_level;
     mod_gm_opt->debug_level = -1;
     int return_code         = 0;
+    nebstruct_log_data          * nld;
+    nebstruct_process_data      * npd;
+    nebstruct_timed_event_data  * nted;
 
     /* what type of event/data do we have? */
     switch (event_type) {
@@ -993,8 +995,26 @@ int handle_export(int event_type, void *data) {
         case NEBCALLBACK_NEB_DATA:                          /*  6 */
             break;
         case NEBCALLBACK_PROCESS_DATA:                      /*  7 */
+            npd = (nebstruct_process_data *)data;
+            snprintf( temp_buffer,sizeof( temp_buffer )-1, "{\"event_type\":\"%s\",\"type\":\"%d\",\"flags\":%d,\"attr\":%d,\"timestamp\":%d.%d}",
+                    "NEBCALLBACK_PROCESS_DATA",
+                    npd->type,
+                    npd->flags,
+                    npd->attr,
+                    (int)npd->timestamp.tv_sec, (int)npd->timestamp.tv_usec
+                    );
             break;
         case NEBCALLBACK_TIMED_EVENT_DATA:                  /*  8 */
+            nted = (nebstruct_timed_event_data *)data;
+            snprintf( temp_buffer,sizeof( temp_buffer )-1, "{\"event_type\":\"%s\",\"type\":\"%d\",\"flags\":%d,\"attr\":%d,\"timestamp\":%d.%d,\"recurring\":%d,\"run_time\":%d}",
+                    "NEBCALLBACK_TIMED_EVENT_DATA",
+                    nted->type,
+                    nted->flags,
+                    nted->attr,
+                    (int)nted->timestamp.tv_sec, (int)nted->timestamp.tv_usec,
+                    nted->recurring,
+                    (int)nted->run_time
+                    );
             break;
         case NEBCALLBACK_LOG_DATA:                          /*  9 */
             nld    = (nebstruct_log_data *)data;

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list