[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, master, updated. debian/1.0.3-1-28-ga8ba0c2
Sven Nierlein
sven at nierlein.de
Fri May 20 10:21:18 UTC 2011
The following commit has been merged in the master branch:
commit 726bf0d7d724ff72d01fcc62df2c8a4d8d915aec
Author: Sven Nierlein <sven at nierlein.de>
Date: Tue May 17 17:47:18 2011 +0200
added dupserver option to send_gearman and send_multi too
diff --git a/Changes b/Changes
index ec1fbe1..d485d5c 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
This file documents the revision history for mod_gearman.
+1.0.5 Tue May 17 17:46:36 CEST 2011
+ - added dupserver option to send_gearman and send_multi too
+
1.0.4 Sun Apr 17 17:58:47 CEST 2011
- added generic logger
- enables logging to stdout, file, syslog or nagios
diff --git a/configure.ac b/configure.ac
index 12fa65f..47290fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
##############################################
AC_PREREQ([2.59])
-AC_INIT([mod_gearman], [1.0.4], [sven.nierlein at consol.de])
+AC_INIT([mod_gearman], [1.0.5], [sven.nierlein at consol.de])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
AC_CONFIG_SRCDIR([neb_module/mod_gearman.c],[worker/worker.c],[tools/send_gearman.c],[tools/check_gearman.c],[tools/gearman_top.c])
AC_CONFIG_HEADER([config.h])
diff --git a/include/common.h b/include/common.h
index 3072bf2..f20fce5 100644
--- a/include/common.h
+++ b/include/common.h
@@ -52,7 +52,7 @@
#define MOD_GM_COMMON_H
/* constants */
-#define GM_VERSION "1.0.4"
+#define GM_VERSION "1.0.5"
#define GM_ENABLED 1
#define GM_DISABLED 0
#define GM_BUFFERSIZE 98304
diff --git a/tools/send_gearman.c b/tools/send_gearman.c
index 45a3b83..6e96985 100644
--- a/tools/send_gearman.c
+++ b/tools/send_gearman.c
@@ -27,6 +27,7 @@
#include "gearman.h"
gearman_client_st client;
+gearman_client_st client_dup;
/* work starts here */
int main (int argc, char **argv) {
@@ -58,11 +59,19 @@ int main (int argc, char **argv) {
exit( EXIT_FAILURE );
}
+ /* create duplicate client */
+ if ( create_client_dup( mod_gm_opt->dupserver_list, &client_dup ) != GM_OK ) {
+ gm_log( GM_LOG_ERROR, "cannot start client for duplicate server\n" );
+ exit( EXIT_FAILURE );
+ }
+
/* send result message */
signal(SIGALRM, alarm_sighandler);
rc = send_result();
gearman_client_free( &client );
+ if( mod_gm_opt->dupserver_num )
+ gearman_client_free( &client_dup );
mod_gm_free_opt(mod_gm_opt);
exit( rc );
}
@@ -260,6 +269,24 @@ int send_result() {
TRUE
) == GM_OK) {
gm_log( GM_LOG_TRACE, "send_result_back() finished successfully\n" );
+
+ if( mod_gm_opt->dupserver_num ) {
+ if(add_job_to_queue( &client,
+ mod_gm_opt->dupserver_list,
+ mod_gm_opt->result_queue,
+ NULL,
+ temp_buffer1,
+ GM_JOB_PRIO_NORMAL,
+ GM_DEFAULT_JOB_RETRIES,
+ mod_gm_opt->transportmode,
+ TRUE
+ ) == GM_OK) {
+ gm_log( GM_LOG_TRACE, "send_result_back() finished successfully for duplicate server.\n" );
+ }
+ else {
+ gm_log( GM_LOG_TRACE, "send_result_back() finished unsuccessfully for duplicate server\n" );
+ }
+ }
}
else {
gm_log( GM_LOG_TRACE, "send_result_back() finished unsuccessfully\n" );
diff --git a/tools/send_multi.c b/tools/send_multi.c
index 09b1df4..2f05127 100644
--- a/tools/send_multi.c
+++ b/tools/send_multi.c
@@ -28,6 +28,7 @@
#include "gearman.h"
gearman_client_st client;
+gearman_client_st client_dup;
/* work starts here */
int main (int argc, char **argv) {
@@ -59,6 +60,12 @@ int main (int argc, char **argv) {
exit(2);
}
+ /* create duplicate client */
+ if ( create_client_dup( mod_gm_opt->dupserver_list, &client_dup ) != GM_OK ) {
+ gm_log( GM_LOG_ERROR, "cannot start client for duplicate server\n" );
+ exit( EXIT_FAILURE );
+ }
+
/* send result message */
signal(SIGALRM, alarm_sighandler);
rc = read_multi_stream(stdin);
@@ -76,6 +83,8 @@ int main (int argc, char **argv) {
}
gearman_client_free( &client );
+ if( mod_gm_opt->dupserver_num )
+ gearman_client_free( &client_dup );
mod_gm_free_opt(mod_gm_opt);
exit( rc );
}
@@ -249,6 +258,24 @@ int send_result() {
TRUE
) == GM_OK) {
gm_log( GM_LOG_TRACE, "send_result_back() finished successfully\n" );
+
+ if( mod_gm_opt->dupserver_num ) {
+ if(add_job_to_queue( &client,
+ mod_gm_opt->dupserver_list,
+ mod_gm_opt->result_queue,
+ NULL,
+ temp_buffer1,
+ GM_JOB_PRIO_NORMAL,
+ GM_DEFAULT_JOB_RETRIES,
+ mod_gm_opt->transportmode,
+ TRUE
+ ) == GM_OK) {
+ gm_log( GM_LOG_TRACE, "send_result_back() finished successfully for duplicate server.\n" );
+ }
+ else {
+ gm_log( GM_LOG_TRACE, "send_result_back() finished unsuccessfully for duplicate server\n" );
+ }
+ }
}
else {
gm_log( GM_LOG_TRACE, "send_result_back() finished unsuccessfully\n" );
--
Debian packaging for mod gearman.
More information about the Pkg-nagios-changes
mailing list