1717* This program is free software; you can redistribute it and/or
1818* modify it under the terms of the GNU General Public License
1919* as published by the Free Software Foundation in version 2
20- *
20+ *
2121* This program is distributed in the hope that it will be useful,
2222* but WITHOUT ANY WARRANTY; without even the implied warranty of
2323* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2424* GNU General Public License for more details.
25- *
25+ *
2626* You should have received a copy of the GNU General Public License
2727* along with this program; if not, write to the Free Software
2828* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
5555*
5656* Compile with the following command for Nagios 4
5757* LANG=C gcc -shared -DNAGIOS -o statusengine.o -fPIC -Wall -Werror statusengine.c -luuid -levent -lgearman -ljson-c
58- *
58+ *
5959* Compile on Debian 7
6060* apt-get install libgearman-dev gearman-tools uuid-dev php5 php5-cli php5-dev libjson0-dev manpages-dev build-essential
6161* LANG=C gcc -shared -DNAEMON -o statusengine.o -fPIC -Wall -Werror statusengine.c -luuid -levent -lgearman -ljson -DDEBIAN7
7272* NEBCALLBACK_AGGREGATED_STATUS_DATA
7373* NEBCALLBACK_RETENTION_DATA
7474* NEBCALLBACK_TIMED_EVENT_DATA
75- *
75+ *
7676*
7777* Have fun :-)
7878*
@@ -270,7 +270,7 @@ int nebmodule_init(int flags, char *args, nebmodule *handle){
270270 neb_set_module_info (statusengine_module_handle , NEBMODULE_MODINFO_TITLE , "Statusengine - the missing event broker" );
271271 neb_set_module_info (statusengine_module_handle , NEBMODULE_MODINFO_AUTHOR , "Daniel Ziegler" );
272272 neb_set_module_info (statusengine_module_handle , NEBMODULE_MODINFO_TITLE , "Copyright (c) 2014 - present Daniel Ziegler" );
273- neb_set_module_info (statusengine_module_handle , NEBMODULE_MODINFO_VERSION , "2 .0.4 " );
273+ neb_set_module_info (statusengine_module_handle , NEBMODULE_MODINFO_VERSION , "3 .0.0 " );
274274 neb_set_module_info (statusengine_module_handle , NEBMODULE_MODINFO_LICENSE , "GPL v2" );
275275 neb_set_module_info (statusengine_module_handle , NEBMODULE_MODINFO_DESC , "A powerful and flexible event broker" );
276276
@@ -308,7 +308,7 @@ int nebmodule_init(int flags, char *args, nebmodule *handle){
308308 neb_register_callback (NEBCALLBACK_CONTACT_NOTIFICATION_DATA , statusengine_module_handle , 0 , statusengine_handle_data );
309309 neb_register_callback (NEBCALLBACK_CONTACT_NOTIFICATION_METHOD_DATA , statusengine_module_handle , 0 , statusengine_handle_data );
310310 neb_register_callback (NEBCALLBACK_EVENT_HANDLER_DATA , statusengine_module_handle , 0 , statusengine_handle_data );
311-
311+
312312
313313 //Create gearman client
314314 if (gearman_client_create (& gman_client ) == NULL ){
@@ -319,7 +319,7 @@ int nebmodule_init(int flags, char *args, nebmodule *handle){
319319 if (ret != GEARMAN_SUCCESS ){
320320 logswitch (NSLOG_INFO_MESSAGE , (char * )gearman_client_error (& gman_client ));
321321 }
322-
322+
323323 if (enable_ochp || enable_ocsp ){
324324 //Create gearman client for ochp/ocsp
325325 if (gearman_client_create (& gman_client_ochp ) == NULL ){
@@ -365,7 +365,7 @@ int nebmodule_deinit(int flags, int reason){
365365
366366 //Delete gearman client
367367 gearman_client_free (& gman_client );
368-
368+
369369 if (enable_ochp || enable_ocsp ){
370370 gearman_client_free (& gman_client_ochp );
371371 }
@@ -425,7 +425,7 @@ int statusengine_process_config_var(char *arg) {
425425 } else if (!strcmp (var , "use_log_data" )) {
426426 use_log_data = atoi (val );
427427 logswitch (NSLOG_INFO_MESSAGE , "[Statusengine] start with disabled log_data" );
428- } else if (!strcmp (var , "use_system_command_data" )) {
428+ } else if (!strcmp (var , "use_system_command_data" )) {
429429 use_system_command_data = atoi (val );
430430 logswitch (NSLOG_INFO_MESSAGE , "[Statusengine] start with disabled system_command_data" );
431431 } else if (!strcmp (var , "use_comment_data" )) {
@@ -437,7 +437,7 @@ int statusengine_process_config_var(char *arg) {
437437 } else if (!strcmp (var , "use_acknowledgement_data" )) {
438438 use_acknowledgement_data = atoi (val );
439439 logswitch (NSLOG_INFO_MESSAGE , "[Statusengine] start with disabled acknowledgement_data" );
440- } else if (!strcmp (var , "use_flapping_data" )) {
440+ } else if (!strcmp (var , "use_flapping_data" )) {
441441 use_flapping_data = atoi (val );
442442 logswitch (NSLOG_INFO_MESSAGE , "[Statusengine] start with disabled flapping_data" );
443443 } else if (!strcmp (var , "use_downtime_data" )) {
@@ -449,10 +449,10 @@ int statusengine_process_config_var(char *arg) {
449449 } else if (!strcmp (var , "use_program_status_data" )) {
450450 use_program_status_data = atoi (val );
451451 logswitch (NSLOG_INFO_MESSAGE , "[Statusengine] start with disabled program_status_data" );
452- } else if (!strcmp (var , "use_contact_status_data" )) {
452+ } else if (!strcmp (var , "use_contact_status_data" )) {
453453 use_contact_status_data = atoi (val );
454454 logswitch (NSLOG_INFO_MESSAGE , "[Statusengine] start with disabled contact_status_data" );
455- } else if (!strcmp (var , "use_contact_notification_data" )) {
455+ } else if (!strcmp (var , "use_contact_notification_data" )) {
456456 use_contact_notification_data = atoi (val );
457457 logswitch (NSLOG_INFO_MESSAGE , "[Statusengine] start with disabled contact_notification_data" );
458458 } else if (!strcmp (var , "use_contact_notification_method_data" )) {
@@ -564,7 +564,7 @@ int statusengine_handle_data(int event_type, void *data){
564564 switch (event_type ){
565565
566566 case NEBCALLBACK_PROCESS_DATA :
567-
567+
568568 programmdata = (nebstruct_process_data * )data ;
569569 if (programmdata == NULL ){
570570 return 0 ;
@@ -592,7 +592,7 @@ int statusengine_handle_data(int event_type, void *data){
592592 dump_object_data ();
593593 }
594594 }
595-
595+
596596 if (!use_process_data ){
597597 return 0 ;
598598 }
@@ -849,13 +849,13 @@ int statusengine_handle_data(int event_type, void *data){
849849
850850 json_object_object_add (my_object , "servicecheck" , servicecheck_object );
851851 const char * json_string = json_object_to_json_string (my_object );
852-
852+
853853 if (use_service_check_data ){
854854 ret = gearman_client_do_background (& gman_client , "statusngin_servicechecks" , NULL , (void * )json_string , (size_t )strlen (json_string ), NULL );
855855 if (ret != GEARMAN_SUCCESS )
856856 logswitch (NSLOG_INFO_MESSAGE , (char * )gearman_client_error (& gman_client ));
857857 }
858-
858+
859859 if (enable_ocsp ){
860860 ret = gearman_client_do_background (& gman_client_ochp , "statusngin_ocsp" , NULL , (void * )json_string , (size_t )strlen (json_string ), NULL );
861861 if (ret != GEARMAN_SUCCESS )
@@ -945,13 +945,13 @@ int statusengine_handle_data(int event_type, void *data){
945945
946946 json_object_object_add (my_object , "hostcheck" , hostcheck_object );
947947 const char * json_string = json_object_to_json_string (my_object );
948-
948+
949949 if (use_host_check_data ){
950950 ret = gearman_client_do_background (& gman_client , "statusngin_hostchecks" , NULL , (void * )json_string , (size_t )strlen (json_string ), NULL );
951951 if (ret != GEARMAN_SUCCESS )
952952 logswitch (NSLOG_INFO_MESSAGE , (char * )gearman_client_error (& gman_client ));
953953 }
954-
954+
955955 if (enable_ochp ){
956956 ret = gearman_client_do_background (& gman_client_ochp , "statusngin_ochp" , NULL , (void * )json_string , (size_t )strlen (json_string ), NULL );
957957 if (ret != GEARMAN_SUCCESS )
@@ -2185,4 +2185,3 @@ void dump_object_data(){
21852185 json_object_put (my_object );
21862186
21872187}
2188-
0 commit comments