[-]
[+]
|
Changed |
nagios-mod_gearman.changes
|
|
[-]
[+]
|
Changed |
nagios-mod_gearman.spec
^
|
|
[-]
[+]
|
Deleted |
mod_gearman-1.0.3.tar.bz2/include/gm_log.h
^
|
@@ -1,29 +0,0 @@
-/******************************************************************************
- *
- * mod_gearman - distribute checks with gearman
- *
- * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de
- *
- * This file is part of mod_gearman.
- *
- * mod_gearman is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mod_gearman is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with mod_gearman. If not, see <http://www.gnu.org/licenses/>.
- *
- *****************************************************************************/
-
-/** @file
- * @brief header for the log module
- */
-
-#include "nagios/nagios.h"
-
|
[-]
[+]
|
Deleted |
mod_gearman-1.0.3.tar.bz2/include/tools_logger.h
^
|
@@ -1,33 +0,0 @@
-/******************************************************************************
- *
- * mod_gearman - distribute checks with gearman
- *
- * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de
- *
- * This file is part of mod_gearman.
- *
- * mod_gearman is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mod_gearman is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with mod_gearman. If not, see <http://www.gnu.org/licenses/>.
- *
- *****************************************************************************/
-
-/** @file
- * @brief header for the tools logger component
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdarg.h>
-#include <unistd.h>
-
|
[-]
[+]
|
Deleted |
mod_gearman-1.0.3.tar.bz2/include/worker_logger.h
^
|
@@ -1,33 +0,0 @@
-/******************************************************************************
- *
- * mod_gearman - distribute checks with gearman
- *
- * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de
- *
- * This file is part of mod_gearman.
- *
- * mod_gearman is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mod_gearman is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with mod_gearman. If not, see <http://www.gnu.org/licenses/>.
- *
- *****************************************************************************/
-
-/** @file
- * @brief header for mod-gearman worker logger
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdarg.h>
-#include <unistd.h>
-
|
[-]
[+]
|
Deleted |
mod_gearman-1.0.3.tar.bz2/neb_module/gm_log.c
^
|
@@ -1,55 +0,0 @@
-/******************************************************************************
- *
- * mod_gearman - distribute checks with gearman
- *
- * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de
- *
- * This file is part of mod_gearman.
- *
- * mod_gearman is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mod_gearman is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with mod_gearman. If not, see <http://www.gnu.org/licenses/>.
- *
- *****************************************************************************/
-
-#include "common.h"
-#include "mod_gearman.h"
-#include "gm_log.h"
-
-void gm_log( int lvl, const char *text, ... ) {
- char buffer[GM_BUFFERSIZE];
- va_list ap;
-
- /* check log level */
- if ( mod_gm_opt->debug_level < 0 )
- return;
- if ( lvl != GM_LOG_ERROR && lvl > mod_gm_opt->debug_level )
- return;
-
- if ( lvl == GM_LOG_ERROR ) {
- snprintf( buffer, 22, "mod_gearman: ERROR - " );
- } else {
- snprintf( buffer, 14, "mod_gearman: " );
- }
- va_start( ap, text );
- vsnprintf( buffer + strlen( buffer ), sizeof( buffer ) - strlen( buffer ), text, ap );
- va_end( ap );
-
- /* in case of stdout logging just print and return */
- if ( mod_gm_opt->debug_level >= GM_LOG_STDOUT ) {
- printf( "%s", buffer );
- return;
- }
-
- /* send everything as info message to the core */
- write_to_all_logs( buffer, NSLOG_INFO_MESSAGE );
-}
|
[-]
[+]
|
Deleted |
mod_gearman-1.0.3.tar.bz2/tools/tools_logger.c
^
|
@@ -1,79 +0,0 @@
-/******************************************************************************
- *
- * mod_gearman - distribute checks with gearman
- *
- * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de
- *
- * This file is part of mod_gearman.
- *
- * mod_gearman is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mod_gearman is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with mod_gearman. If not, see <http://www.gnu.org/licenses/>.
- *
- *****************************************************************************/
-
-#include "common.h"
-#include "worker.h"
-#include "tools_logger.h"
-
-struct tm now;
-
-void gm_log( int lvl, const char *text, ... ) {
- FILE * fp = NULL;
- int debug_level = GM_LOG_ERROR;
- char buffer[GM_BUFFERSIZE];
- time_t t;
- char * level;
- va_list ap;
- char buffer2[GM_BUFFERSIZE];
-
- if(mod_gm_opt != NULL) {
- debug_level = mod_gm_opt->debug_level;
- fp = mod_gm_opt->logfile_fp;
- }
-
- /* check log level */
- if ( lvl != GM_LOG_ERROR && lvl > debug_level ) {
- return;
- }
-
- if ( lvl == GM_LOG_ERROR )
- level = "ERROR";
- else if ( lvl == GM_LOG_INFO )
- level = "INFO ";
- else if ( lvl == GM_LOG_DEBUG )
- level = "DEBUG";
- else if ( lvl == GM_LOG_TRACE )
- level = "TRACE";
- else
- level = "UNKNO";
-
- t = time(NULL);
- now = *(localtime(&t));
-
- strftime(buffer, sizeof(buffer), "[%Y-%m-%d %H:%M:%S]", &now );
-
- snprintf(buffer2, sizeof(buffer2), "[%i][%s] ", getpid(), level );
- strncat(buffer, buffer2, (sizeof(buffer)-1));
-
- va_start( ap, text );
- vsnprintf( buffer + strlen( buffer ), sizeof( buffer ) - strlen( buffer ), text, ap );
- va_end( ap );
-
- if(fp != NULL) {
- fprintf( fp, "%s", buffer );
- fflush( fp );
- } else {
- printf( "%s", buffer );
- }
- return;
-}
|
[-]
[+]
|
Deleted |
mod_gearman-1.0.3.tar.bz2/worker/worker_logger.c
^
|
@@ -1,79 +0,0 @@
-/******************************************************************************
- *
- * mod_gearman - distribute checks with gearman
- *
- * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de
- *
- * This file is part of mod_gearman.
- *
- * mod_gearman is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * mod_gearman is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with mod_gearman. If not, see <http://www.gnu.org/licenses/>.
- *
- *****************************************************************************/
-
-#include "common.h"
-#include "worker.h"
-#include "worker_logger.h"
-
-void gm_log( int lvl, const char *text, ... ) {
- FILE * fp = NULL;
- int debug_level = GM_LOG_ERROR;
- char buffer[GM_BUFFERSIZE];
- char * level;
- char buffer2[GM_BUFFERSIZE];
- time_t t;
- va_list ap;
- struct tm now;
-
- if(mod_gm_opt != NULL) {
- debug_level = mod_gm_opt->debug_level;
- fp = mod_gm_opt->logfile_fp;
- }
-
- /* check log level */
- if ( lvl != GM_LOG_ERROR && lvl > debug_level ) {
- return;
- }
-
- t = time(NULL);
-
- if ( lvl == GM_LOG_ERROR )
- level = "ERROR";
- else if ( lvl == GM_LOG_INFO )
- level = "INFO ";
- else if ( lvl == GM_LOG_DEBUG )
- level = "DEBUG";
- else if ( lvl == GM_LOG_TRACE )
- level = "TRACE";
- else
- level = "UNKNO";
-
- localtime_r(&t, &now);
-
- strftime(buffer, sizeof(buffer), "[%Y-%m-%d %H:%M:%S]", &now );
-
- snprintf(buffer2, sizeof(buffer2), "[%i][%s] ", getpid(), level );
- strncat(buffer, buffer2, (sizeof(buffer)-1));
-
- va_start( ap, text );
- vsnprintf( buffer + strlen( buffer ), sizeof( buffer ) - strlen( buffer ), text, ap );
- va_end( ap );
-
- if(fp != NULL) {
- fprintf( fp, "%s", buffer );
- fflush( fp );
- } else {
- printf( "%s", buffer );
- }
- return;
-}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/Changes
^
|
@@ -1,5 +1,22 @@
This file documents the revision history for mod_gearman.
+1.0.6 Sat Jun 4 11:47:02 CEST 2011
+ - expand server definitions from :4730 to localhost:4730
+ - fixed latency calculation (was below zero sometimes)
+
+1.0.5 Tue May 17 17:46:36 CEST 2011
+ - added dupserver option to send_gearman and send_multi too
+ - removed warning for the passive only mode
+
+1.0.4 Sun Apr 17 17:58:47 CEST 2011
+ - added generic logger
+ - enables logging to stdout, file, syslog or nagios
+ - changed latency calculation (use time of next_check instead of time of job submission)
+ - added nsca replacements docs
+
+1.0.3 Wed Mar 23 21:53:09 CET 2011
+ - fixed worker handling exit codes > 127
+
1.0.2 Fri Mar 11 10:30:21 CET 2011
- added new option do_hostchecks to completly disable hostchecks
- fixed reading keyfiles
@@ -12,7 +29,7 @@
- fixed "make rpm" for SLES11
1.0 Mon Feb 7 11:05:29 CET 2011
- - added dup_server option (Mark Clarkson)
+ - added dupserver option (Mark Clarkson)
- added stderr to send_multi
- added missing performance data to send_multi
- added error message when using unknown option
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/Makefile.am
^
|
@@ -29,7 +29,6 @@
pkglib_LIBRARIES = mod_gearman.so
mod_gearman_so_SOURCES = $(common_SOURCES) \
- neb_module/gm_log.c \
neb_module/result_thread.c \
neb_module/mod_gearman.c
@@ -40,32 +39,28 @@
gearman_top
mod_gearman_worker_SOURCES = $(common_SOURCES) \
- worker/worker_logger.c \
worker/worker_client.c \
worker/worker.c
send_gearman_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/send_gearman.c
send_multi_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/send_multi.c
check_gearman_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/check_gearman.c
gearman_top_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/gearman_top.c
gearman_top_LDFLAGS = -lncurses
# tests
-check_PROGRAMS = 01_utils 02_full 03_exec
-01_utils_SOURCES = $(common_SOURCES) t/tap.h t/tap.c worker/worker_logger.c t/01-utils.c
-02_full_SOURCES = $(common_SOURCES) t/tap.h t/tap.c worker/worker_logger.c t/02-full.c
-03_exec_SOURCES = $(common_SOURCES) t/tap.h t/tap.c worker/worker_logger.c t/03-exec_checks.c
+check_PROGRAMS = 01_utils 02_full 03_exec 04_log
+01_utils_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/01-utils.c
+02_full_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/02-full.c
+03_exec_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/03-exec_checks.c
+04_log_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/04-log.c
TESTS = $(check_PROGRAMS)
@@ -228,3 +223,6 @@
deb:
dpkg-buildpackage -us -uc
+
+mrproper:
+ git clean -xfd
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/Makefile.in
^
|
@@ -45,7 +45,8 @@
bin_PROGRAMS = mod_gearman_worker$(EXEEXT) send_gearman$(EXEEXT) \
send_multi$(EXEEXT) check_gearman$(EXEEXT) \
gearman_top$(EXEEXT)
-check_PROGRAMS = 01_utils$(EXEEXT) 02_full$(EXEEXT) 03_exec$(EXEEXT)
+check_PROGRAMS = 01_utils$(EXEEXT) 02_full$(EXEEXT) 03_exec$(EXEEXT) \
+ 04_log$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
@@ -93,43 +94,44 @@
common/rijndael.$(OBJEXT) common/gearman.$(OBJEXT) \
common/gearman_utils.$(OBJEXT) common/utils.$(OBJEXT)
am_mod_gearman_so_OBJECTS = $(am__objects_1) \
- neb_module/gm_log.$(OBJEXT) neb_module/result_thread.$(OBJEXT) \
+ neb_module/result_thread.$(OBJEXT) \
neb_module/mod_gearman.$(OBJEXT)
mod_gearman_so_OBJECTS = $(am_mod_gearman_so_OBJECTS)
PROGRAMS = $(bin_PROGRAMS)
am_01_utils_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \
- worker/worker_logger.$(OBJEXT) t/01-utils.$(OBJEXT)
+ t/01-utils.$(OBJEXT)
01_utils_OBJECTS = $(am_01_utils_OBJECTS)
01_utils_LDADD = $(LDADD)
am_02_full_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \
- worker/worker_logger.$(OBJEXT) t/02-full.$(OBJEXT)
+ t/02-full.$(OBJEXT)
02_full_OBJECTS = $(am_02_full_OBJECTS)
02_full_LDADD = $(LDADD)
am_03_exec_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \
- worker/worker_logger.$(OBJEXT) t/03-exec_checks.$(OBJEXT)
+ t/03-exec_checks.$(OBJEXT)
03_exec_OBJECTS = $(am_03_exec_OBJECTS)
03_exec_LDADD = $(LDADD)
+am_04_log_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \
+ t/04-log.$(OBJEXT)
+04_log_OBJECTS = $(am_04_log_OBJECTS)
+04_log_LDADD = $(LDADD)
am_check_gearman_OBJECTS = $(am__objects_1) \
- tools/tools_logger.$(OBJEXT) tools/check_gearman.$(OBJEXT)
+ tools/check_gearman.$(OBJEXT)
check_gearman_OBJECTS = $(am_check_gearman_OBJECTS)
check_gearman_LDADD = $(LDADD)
-am_gearman_top_OBJECTS = $(am__objects_1) tools/tools_logger.$(OBJEXT) \
- tools/gearman_top.$(OBJEXT)
+am_gearman_top_OBJECTS = $(am__objects_1) tools/gearman_top.$(OBJEXT)
gearman_top_OBJECTS = $(am_gearman_top_OBJECTS)
gearman_top_LDADD = $(LDADD)
gearman_top_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(gearman_top_LDFLAGS) $(LDFLAGS) -o $@
am_mod_gearman_worker_OBJECTS = $(am__objects_1) \
- worker/worker_logger.$(OBJEXT) worker/worker_client.$(OBJEXT) \
- worker/worker.$(OBJEXT)
+ worker/worker_client.$(OBJEXT) worker/worker.$(OBJEXT)
mod_gearman_worker_OBJECTS = $(am_mod_gearman_worker_OBJECTS)
mod_gearman_worker_LDADD = $(LDADD)
am_send_gearman_OBJECTS = $(am__objects_1) \
- tools/tools_logger.$(OBJEXT) tools/send_gearman.$(OBJEXT)
+ tools/send_gearman.$(OBJEXT)
send_gearman_OBJECTS = $(am_send_gearman_OBJECTS)
send_gearman_LDADD = $(LDADD)
-am_send_multi_OBJECTS = $(am__objects_1) tools/tools_logger.$(OBJEXT) \
- tools/send_multi.$(OBJEXT)
+am_send_multi_OBJECTS = $(am__objects_1) tools/send_multi.$(OBJEXT)
send_multi_OBJECTS = $(am_send_multi_OBJECTS)
send_multi_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@
@@ -141,13 +143,15 @@
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mod_gearman_so_SOURCES) $(01_utils_SOURCES) \
- $(02_full_SOURCES) $(03_exec_SOURCES) $(check_gearman_SOURCES) \
- $(gearman_top_SOURCES) $(mod_gearman_worker_SOURCES) \
- $(send_gearman_SOURCES) $(send_multi_SOURCES)
+ $(02_full_SOURCES) $(03_exec_SOURCES) $(04_log_SOURCES) \
+ $(check_gearman_SOURCES) $(gearman_top_SOURCES) \
+ $(mod_gearman_worker_SOURCES) $(send_gearman_SOURCES) \
+ $(send_multi_SOURCES)
DIST_SOURCES = $(mod_gearman_so_SOURCES) $(01_utils_SOURCES) \
- $(02_full_SOURCES) $(03_exec_SOURCES) $(check_gearman_SOURCES) \
- $(gearman_top_SOURCES) $(mod_gearman_worker_SOURCES) \
- $(send_gearman_SOURCES) $(send_multi_SOURCES)
+ $(02_full_SOURCES) $(03_exec_SOURCES) $(04_log_SOURCES) \
+ $(check_gearman_SOURCES) $(gearman_top_SOURCES) \
+ $(mod_gearman_worker_SOURCES) $(send_gearman_SOURCES) \
+ $(send_multi_SOURCES)
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
@@ -276,35 +280,30 @@
pkglib_LIBRARIES = mod_gearman.so
mod_gearman_so_SOURCES = $(common_SOURCES) \
- neb_module/gm_log.c \
neb_module/result_thread.c \
neb_module/mod_gearman.c
mod_gearman_worker_SOURCES = $(common_SOURCES) \
- worker/worker_logger.c \
worker/worker_client.c \
worker/worker.c
send_gearman_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/send_gearman.c
send_multi_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/send_multi.c
check_gearman_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/check_gearman.c
gearman_top_SOURCES = $(common_SOURCES) \
- tools/tools_logger.c \
tools/gearman_top.c
gearman_top_LDFLAGS = -lncurses
-01_utils_SOURCES = $(common_SOURCES) t/tap.h t/tap.c worker/worker_logger.c t/01-utils.c
-02_full_SOURCES = $(common_SOURCES) t/tap.h t/tap.c worker/worker_logger.c t/02-full.c
-03_exec_SOURCES = $(common_SOURCES) t/tap.h t/tap.c worker/worker_logger.c t/03-exec_checks.c
+01_utils_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/01-utils.c
+02_full_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/02-full.c
+03_exec_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/03-exec_checks.c
+04_log_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/04-log.c
TESTS = $(check_PROGRAMS)
GEARMANDS = /usr/sbin/gearmand /opt/sbin/gearmand
replace_vars = sed -e 's:%CONFIG%:$(sysconfdir)/mod_gearman.conf:g' \
@@ -431,8 +430,6 @@
neb_module/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) neb_module/$(DEPDIR)
@: > neb_module/$(DEPDIR)/$(am__dirstamp)
-neb_module/gm_log.$(OBJEXT): neb_module/$(am__dirstamp) \
- neb_module/$(DEPDIR)/$(am__dirstamp)
neb_module/result_thread.$(OBJEXT): neb_module/$(am__dirstamp) \
neb_module/$(DEPDIR)/$(am__dirstamp)
neb_module/mod_gearman.$(OBJEXT): neb_module/$(am__dirstamp) \
@@ -488,14 +485,6 @@
@$(MKDIR_P) t/$(DEPDIR)
@: > t/$(DEPDIR)/$(am__dirstamp)
t/tap.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp)
-worker/$(am__dirstamp):
- @$(MKDIR_P) worker
- @: > worker/$(am__dirstamp)
-worker/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) worker/$(DEPDIR)
- @: > worker/$(DEPDIR)/$(am__dirstamp)
-worker/worker_logger.$(OBJEXT): worker/$(am__dirstamp) \
- worker/$(DEPDIR)/$(am__dirstamp)
t/01-utils.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp)
01_utils$(EXEEXT): $(01_utils_OBJECTS) $(01_utils_DEPENDENCIES)
@rm -f 01_utils$(EXEEXT)
@@ -509,14 +498,16 @@
03_exec$(EXEEXT): $(03_exec_OBJECTS) $(03_exec_DEPENDENCIES)
@rm -f 03_exec$(EXEEXT)
$(LINK) $(03_exec_OBJECTS) $(03_exec_LDADD) $(LIBS)
+t/04-log.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp)
+04_log$(EXEEXT): $(04_log_OBJECTS) $(04_log_DEPENDENCIES)
+ @rm -f 04_log$(EXEEXT)
+ $(LINK) $(04_log_OBJECTS) $(04_log_LDADD) $(LIBS)
tools/$(am__dirstamp):
@$(MKDIR_P) tools
@: > tools/$(am__dirstamp)
tools/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) tools/$(DEPDIR)
@: > tools/$(DEPDIR)/$(am__dirstamp)
-tools/tools_logger.$(OBJEXT): tools/$(am__dirstamp) \
- tools/$(DEPDIR)/$(am__dirstamp)
tools/check_gearman.$(OBJEXT): tools/$(am__dirstamp) \
tools/$(DEPDIR)/$(am__dirstamp)
check_gearman$(EXEEXT): $(check_gearman_OBJECTS) $(check_gearman_DEPENDENCIES)
@@ -527,6 +518,12 @@
gearman_top$(EXEEXT): $(gearman_top_OBJECTS) $(gearman_top_DEPENDENCIES)
@rm -f gearman_top$(EXEEXT)
$(gearman_top_LINK) $(gearman_top_OBJECTS) $(gearman_top_LDADD) $(LIBS)
+worker/$(am__dirstamp):
+ @$(MKDIR_P) worker
+ @: > worker/$(am__dirstamp)
+worker/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) worker/$(DEPDIR)
+ @: > worker/$(DEPDIR)/$(am__dirstamp)
worker/worker_client.$(OBJEXT): worker/$(am__dirstamp) \
worker/$(DEPDIR)/$(am__dirstamp)
worker/worker.$(OBJEXT): worker/$(am__dirstamp) \
@@ -553,21 +550,19 @@
-rm -f common/gearman_utils.$(OBJEXT)
-rm -f common/rijndael.$(OBJEXT)
-rm -f common/utils.$(OBJEXT)
- -rm -f neb_module/gm_log.$(OBJEXT)
-rm -f neb_module/mod_gearman.$(OBJEXT)
-rm -f neb_module/result_thread.$(OBJEXT)
-rm -f t/01-utils.$(OBJEXT)
-rm -f t/02-full.$(OBJEXT)
-rm -f t/03-exec_checks.$(OBJEXT)
+ -rm -f t/04-log.$(OBJEXT)
-rm -f t/tap.$(OBJEXT)
-rm -f tools/check_gearman.$(OBJEXT)
-rm -f tools/gearman_top.$(OBJEXT)
-rm -f tools/send_gearman.$(OBJEXT)
-rm -f tools/send_multi.$(OBJEXT)
- -rm -f tools/tools_logger.$(OBJEXT)
-rm -f worker/worker.$(OBJEXT)
-rm -f worker/worker_client.$(OBJEXT)
- -rm -f worker/worker_logger.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@@ -578,21 +573,19 @@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/gearman_utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/rijndael.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@neb_module/$(DEPDIR)/gm_log.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@neb_module/$(DEPDIR)/mod_gearman.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@neb_module/$(DEPDIR)/result_thread.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@t/$(DEPDIR)/01-utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@t/$(DEPDIR)/02-full.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@t/$(DEPDIR)/03-exec_checks.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@t/$(DEPDIR)/04-log.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@t/$(DEPDIR)/tap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/check_gearman.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/gearman_top.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/send_gearman.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/send_multi.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/tools_logger.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@worker/$(DEPDIR)/worker.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@worker/$(DEPDIR)/worker_client.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@worker/$(DEPDIR)/worker_logger.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -1188,6 +1181,9 @@
deb:
dpkg-buildpackage -us -uc
+mrproper:
+ git clean -xfd
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/README
^
|
@@ -18,12 +18,17 @@
* You need at least one http://gearman.org[Gearman Job Server] running
+http://labs.consol.de/wp-content/uploads/2010/09/Mod-Gearman.pdf[Have a look at the slides from the Nagios Workshop 2011 in Hannover]
+
+
Support & Questions
-------------------
-* Mod-Gearman has been succesfully tested with Nagios 3.2.3 and Icinga 1.2.0 and there are no known bugs at the moment.
+* Mod-Gearman has been succesfully tested with Nagios 3.2.3 and Icinga
+ 1.2.0 running on Lib-Gearman 0.14. There are no known bugs at the moment.
Let me know if you find one.
-* Please use the Mod-Gearman https://groups.google.com/group/mod_gearman[google groups mailinglist] for support, questions and bug reports.
+* https://groups.google.com/group/mod_gearman[google groups mailinglist]
+* http://labs.consol.de/lang/de/forum/#/categories/mod-gearman[support forum]
* Debian users may be interested in the http://labs.consol.de/nagios/mod-gearman/mod-gearman-quickstart-guide/[quickstart guide].
@@ -154,6 +159,22 @@
setup with just adding more worker of the same config.
+NSCA Replacement
+~~~~~~~~~~~~~~~~
+
+++++
+<a title="NSCA Replacement" rel="lightbox[mod_gm]" href="http://labs.consol.de/wp-content/uploads/2010/09/nsca_replacement.png"><img src="http://labs.consol.de/wp-content/uploads/2010/09/nsca_replacement.png" alt="NSCA Replacement" width="300" height="220" style="float:none" /></a>
+++++
+
+If you just want to replace a current NSCA solution, you could load
+the Mod-Gearman NEB module and disable all distribution features. You
+still can receive passive results by the core send via
+send_gearman / send_multi. Make sure you use the same encryption
+settings like the neb module or your core won't be able to process the
+results.
+
+
+
Installation
@@ -281,6 +302,37 @@
debug=1
====
+
+logmode::
+ set way of logging.
+ Possible values are:
++
+--
+ * `automatic` - logfile when a logfile is specified. stdout when
+ no logfile is given.
+ stdout for tools.
+ * `stdout` - just print all messages to stdout
+ * `syslog` - use syslog for all log events
+ * `file` - use logfile
+ * `core` - use nagios internal loging (not thread safe! Use
+ with care)
+--
++
+Default is automatic.
++
+====
+ debug=1
+====
+
+
+logfile::
+Path to the logfile.
++
+====
+ logfile=/path/to/log.file
+====
+
+
server::
sets the address of your gearman job server. Can be specified
more than once to add more server. Mod-Gearman uses
@@ -471,14 +523,6 @@
====
-logfile::
-Path to the logfile.
-+
-====
- logfile=/path/to/log.file
-====
-
-
min-worker::
Minimum number of worker processes which should run at any time. Default: 1
+
@@ -534,13 +578,13 @@
fork_on_exec=no
====
-dup_server::
+dupserver::
sets the address of gearman job server where duplicated result will be sent to.
Can be specified more than once to add more server. Useful for duplicating
results for a reporting installation or remote gui.
+
====
- dup_server=logserver:4730,logserver2:4730
+ dupserver=logserver:4730,logserver2:4730
====
@@ -729,7 +773,7 @@
Download
--------
-* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz[version 1.0.3 - March 23 2011]
+* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.6.tar.gz[version 1.0.6 - June 04 2011]
* Mod Gearman is available for download at: http://labs.consol.de/nagios/mod-gearman
* The source is available at GitHub: http://github.com/sni/mod_gearman
@@ -737,6 +781,9 @@
Archive
~~~~~~~
+* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.6.tar.gz[version 1.0.6 - June 04 2011]
+* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.5.tar.gz[version 1.0.5 - May 17 2011]
+* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.4.tar.gz[version 1.0.4 - April 17 2011]
* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz[version 1.0.3 - March 23 2011]
* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.2.tar.gz[version 1.0.2 - March 13 2011]
* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.1.tar.gz[version 1.0.1 - March 05 2011]
@@ -748,5 +795,3 @@
* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-0.5.tar.gz[version 0.5 - October 01 2010]
* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-0.4.tar.gz[version 0.4 - September 25 2010]
-
-
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/aclocal.m4
^
|
@@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
-[m4_warning([this file was generated for autoconf 2.67.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/common/utils.c
^
|
@@ -22,7 +22,6 @@
*****************************************************************************/
#include "utils.h"
-#include "gm_log.h"
#include "crypt.h"
#include "base64.h"
@@ -198,6 +197,7 @@
opt->result_queue = NULL;
opt->keyfile = NULL;
opt->logfile = NULL;
+ opt->logmode = GM_LOG_MODE_AUTO;
opt->logfile_fp = NULL;
opt->message = NULL;
opt->return_code = 0;
@@ -288,6 +288,7 @@
int parse_args_line(mod_gm_opt_t *opt, char * arg, int recursion_level) {
char *key;
char *value;
+ char temp_buffer[GM_BUFFERSIZE];
gm_log( GM_LOG_TRACE, "parse_args_line(%s, %d)\n", arg, recursion_level);
@@ -384,6 +385,29 @@
if(opt->debug_level < 0) { opt->debug_level = 0; }
}
+ /* logmode */
+ else if ( !strcmp( key, "logmode" ) ) {
+ opt->logmode = GM_LOG_MODE_AUTO;
+ if ( !strcmp( value, "automatic" ) ) {
+ opt->logmode = GM_LOG_MODE_AUTO;
+ }
+ else if ( !strcmp( value, "file" ) ) {
+ opt->logmode = GM_LOG_MODE_FILE;
+ }
+ else if ( !strcmp( value, "stdout" ) ) {
+ opt->logmode = GM_LOG_MODE_STDOUT;
+ }
+ else if ( !strcmp( value, "syslog" ) ) {
+ opt->logmode = GM_LOG_MODE_SYSLOG;
+ }
+ else if ( !strcmp( value, "core" ) ) {
+ opt->logmode = GM_LOG_MODE_CORE;
+ }
+ else {
+ gm_log( GM_LOG_ERROR, "unknown log mode '%s', use one of 'automatic', 'file', 'stdout', 'syslog' and 'core'\n", value );
+ }
+ }
+
/* result worker */
else if ( !strcmp( key, "result_workers" ) ) {
opt->result_workers = atoi( value );
@@ -539,7 +563,14 @@
while ( (servername = strsep( &value, "," )) != NULL ) {
servername = trim(servername);
if ( strcmp( servername, "" ) ) {
- opt->server_list[opt->server_num] = strdup(servername);
+ if(strcspn(servername, ":") == 0) {
+ temp_buffer[0]='\x0';
+ snprintf( temp_buffer,sizeof( temp_buffer )-1, "localhost%s", servername);
+ temp_buffer[sizeof( temp_buffer )-1]='\x0';
+ opt->server_list[opt->server_num] = strdup(temp_buffer);
+ } else {
+ opt->server_list[opt->server_num] = strdup(servername);
+ }
opt->server_num++;
}
}
@@ -710,6 +741,20 @@
gm_log( GM_LOG_DEBUG, "--------------------------------\n" );
gm_log( GM_LOG_DEBUG, "configuration:\n" );
gm_log( GM_LOG_DEBUG, "log level: %d\n", opt->debug_level);
+
+ if(opt->logmode == GM_LOG_MODE_AUTO)
+ gm_log( GM_LOG_DEBUG, "log mode: auto (%d)\n", opt->logmode);
+ if(opt->logmode == GM_LOG_MODE_FILE)
+ gm_log( GM_LOG_DEBUG, "log mode: file (%d)\n", opt->logmode);
+ if(opt->logmode == GM_LOG_MODE_STDOUT)
+ gm_log( GM_LOG_DEBUG, "log mode: stdout (%d)\n", opt->logmode);
+ if(opt->logmode == GM_LOG_MODE_CORE)
+ gm_log( GM_LOG_DEBUG, "log mode: core (%d)\n", opt->logmode);
+ if(opt->logmode == GM_LOG_MODE_SYSLOG)
+ gm_log( GM_LOG_DEBUG, "log mode: syslog (%d)\n", opt->logmode);
+ if(opt->logmode == GM_LOG_MODE_TOOLS)
+ gm_log( GM_LOG_DEBUG, "log mode: tools (%d)\n", opt->logmode);
+
if(mode == GM_WORKER_MODE) {
gm_log( GM_LOG_DEBUG, "identifier: %s\n", opt->identifier);
gm_log( GM_LOG_DEBUG, "pidfile: %s\n", opt->pidfile == NULL ? "no" : opt->pidfile);
@@ -835,7 +880,8 @@
free(opt->crypt_key);
opt->crypt_key = malloc(GM_BUFFERSIZE);
- fgets(opt->crypt_key, 33, fp);
+ if(!fgets(opt->crypt_key, 33, fp))
+ return(GM_ERROR);
fclose(fp);
rtrim(opt->crypt_key);
@@ -1218,7 +1264,7 @@
/* set empty default job */
-int set_default_job(gm_job_t *job, mod_gm_opt_t *mod_gm_opt) {
+int set_default_job(gm_job_t *job, mod_gm_opt_t *opt) {
job->type = NULL;
job->host_name = NULL;
@@ -1231,7 +1277,7 @@
job->reschedule_check = TRUE;
job->return_code = STATE_OK;
job->latency = 0.0;
- job->timeout = mod_gm_opt->job_timeout;
+ job->timeout = opt->job_timeout;
job->start_time.tv_sec = 0L;
job->start_time.tv_usec = 0L;
@@ -1645,3 +1691,103 @@
}
return strdup("UNKNOWN");
}
+
+/* generic logger function */
+void gm_log( int lvl, const char *text, ... ) {
+ FILE * fp = NULL;
+ int debug_level = GM_LOG_ERROR;
+ int logmode = GM_LOG_MODE_STDOUT;
+ int slevel;
+ char * level;
+ char buffer1[GM_BUFFERSIZE];
+ char buffer2[GM_BUFFERSIZE];
+ char buffer3[GM_BUFFERSIZE];
+ time_t t;
+ va_list ap;
+ struct tm now;
+
+ if(mod_gm_opt != NULL) {
+ debug_level = mod_gm_opt->debug_level;
+ logmode = mod_gm_opt->logmode;
+ fp = mod_gm_opt->logfile_fp;
+ }
+
+ if(logmode == GM_LOG_MODE_CORE) {
+ if ( debug_level < 0 )
+ return;
+ if ( lvl != GM_LOG_ERROR && lvl > debug_level )
+ return;
+
+ if ( lvl == GM_LOG_ERROR ) {
+ snprintf( buffer1, 22, "mod_gearman: ERROR - " );
+ } else {
+ snprintf( buffer1, 14, "mod_gearman: " );
+ }
+ va_start( ap, text );
+ vsnprintf( buffer1 + strlen( buffer1 ), sizeof( buffer1 ) - strlen( buffer1 ), text, ap );
+ va_end( ap );
+
+ if ( debug_level >= GM_LOG_STDOUT ) {
+ printf( "%s", buffer1 );
+ return;
+ }
+ write_core_log( buffer1 );
+ return;
+ }
+
+ /* check log level */
+ if ( lvl != GM_LOG_ERROR && lvl > debug_level ) {
+ return;
+ }
+ if ( lvl == GM_LOG_ERROR ) {
+ level = "ERROR";
+ slevel = LOG_ERR;
+ }
+ else if ( lvl == GM_LOG_INFO ) {
+ level = "INFO ";
+ slevel = LOG_INFO;
+ }
+ else if ( lvl == GM_LOG_DEBUG ) {
+ level = "DEBUG";
+ slevel = LOG_DEBUG;
+ }
+ else if ( lvl == GM_LOG_TRACE ) {
+ level = "TRACE";
+ slevel = LOG_DEBUG;
+ }
+ else {
+ level = "UNKNOWN";
+ slevel = LOG_DEBUG;
+ }
+
+ /* set timestring */
+ t = time(NULL);
+ localtime_r(&t, &now);
+ strftime(buffer1, sizeof(buffer1), "[%Y-%m-%d %H:%M:%S]", &now );
+
+ /* set timestring */
+ snprintf(buffer2, sizeof(buffer2), "[%i][%s]", getpid(), level );
+
+ va_start( ap, text );
+ vsnprintf( buffer3, GM_BUFFERSIZE, text, ap );
+ va_end( ap );
+
+ if ( debug_level >= GM_LOG_STDOUT || logmode == GM_LOG_MODE_TOOLS ) {
+ printf( "%s", buffer3 );
+ return;
+ }
+
+ if(logmode == GM_LOG_MODE_FILE && fp != NULL) {
+ fprintf( fp, "%s%s %s", buffer1, buffer2, buffer3 );
+ fflush( fp );
+ }
+ else if(logmode == GM_LOG_MODE_SYSLOG) {
+ syslog(slevel , "%s %s", buffer2, buffer3 );
+ }
+ else {
+ /* stdout logging */
+ printf( "%s%s %s", buffer1, buffer2, buffer3 );
+ }
+
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/config.h.in
^
|
@@ -12,6 +12,9 @@
/* Define to 1 if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
+/* Define to 1 if you have the `dup2' function. */
+#undef HAVE_DUP2
+
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@@ -39,6 +42,9 @@
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
/* Define to 1 if you have the <ltdl.h> header file. */
#undef HAVE_LTDL_H
@@ -46,6 +52,9 @@
to 0 otherwise. */
#undef HAVE_MALLOC
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@@ -94,9 +103,18 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strpbrk' function. */
+#undef HAVE_STRPBRK
+
+/* Define to 1 if you have the `strsep' function. */
+#undef HAVE_STRSEP
+
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
+/* Define to 1 if you have the `strtok' function. */
+#undef HAVE_STRTOK
+
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/configure
^
|
@@ -1,13 +1,13 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for mod_gearman 1.0.3.
+# Generated by GNU Autoconf 2.65 for mod_gearman 1.0.6.
#
# Report bugs to <sven.nierlein@consol.de>.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -319,7 +319,7 @@
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -359,19 +359,19 @@
fi # as_fn_arith
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
+# script with status $?, using 1 if that was 0.
as_fn_error ()
{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
fi
- $as_echo "$as_me: error: $2" >&2
+ $as_echo "$as_me: error: $1" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -533,7 +533,7 @@
exec 6>&1
# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -552,8 +552,8 @@
# Identity of this package.
PACKAGE_NAME='mod_gearman'
PACKAGE_TARNAME='mod_gearman'
-PACKAGE_VERSION='1.0.3'
-PACKAGE_STRING='mod_gearman 1.0.3'
+PACKAGE_VERSION='1.0.6'
+PACKAGE_STRING='mod_gearman 1.0.6'
PACKAGE_BUGREPORT='sven.nierlein@consol.de'
PACKAGE_URL=''
@@ -770,9 +770,8 @@
fi
case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
@@ -817,7 +816,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -843,7 +842,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1047,7 +1046,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1063,7 +1062,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1093,8 +1092,8 @@
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
+ -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
;;
*=*)
@@ -1102,7 +1101,7 @@
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ as_fn_error "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
@@ -1120,13 +1119,13 @@
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
+ as_fn_error "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1149,7 +1148,7 @@
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1163,8 +1162,8 @@
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1179,9 +1178,9 @@
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
+ as_fn_error "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
+ as_fn_error "pwd does not report name of working directory"
# Find the source files, if location was not specified.
@@ -1220,11 +1219,11 @@
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1250,7 +1249,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mod_gearman 1.0.3 to adapt to many kinds of systems.
+\`configure' configures mod_gearman 1.0.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1264,7 +1263,7 @@
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
+ -q, --quiet, --silent do not print \`checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
@@ -1316,7 +1315,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mod_gearman 1.0.3:";;
+ short | recursive ) echo "Configuration of mod_gearman 1.0.6:";;
esac
cat <<\_ACEOF
@@ -1413,10 +1412,10 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mod_gearman configure 1.0.3
-generated by GNU Autoconf 2.67
+mod_gearman configure 1.0.6
+generated by GNU Autoconf 2.65
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1524,7 +1523,7 @@
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
+ test $ac_status = 0; } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
@@ -1590,10 +1589,10 @@
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval "test \"\${$3+set}\"" = set; then :
+ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
@@ -1629,7 +1628,7 @@
else
ac_header_preproc=no
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
@@ -1652,15 +1651,17 @@
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## -------------------------------------- ##
+( cat <<\_ASBOX
+## -------------------------------------- ##
## Report this to sven.nierlein@consol.de ##
-## -------------------------------------- ##"
+## -------------------------------------- ##
+_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
@@ -1682,7 +1683,7 @@
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1713,7 +1714,7 @@
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
@@ -1812,7 +1813,7 @@
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1874,8 +1875,8 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mod_gearman $as_me 1.0.3, which was
-generated by GNU Autoconf 2.67. Invocation command line was
+It was created by mod_gearman $as_me 1.0.6, which was
+generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -1985,9 +1986,11 @@
{
echo
- $as_echo "## ---------------- ##
+ cat <<\_ASBOX
+## ---------------- ##
## Cache variables. ##
-## ---------------- ##"
+## ---------------- ##
+_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
(
@@ -2021,9 +2024,11 @@
)
echo
- $as_echo "## ----------------- ##
+ cat <<\_ASBOX
+## ----------------- ##
## Output variables. ##
-## ----------------- ##"
+## ----------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_vars
do
@@ -2036,9 +2041,11 @@
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
+ cat <<\_ASBOX
+## ------------------- ##
## File substitutions. ##
-## ------------------- ##"
+## ------------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_files
do
@@ -2052,9 +2059,11 @@
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ cat <<\_ASBOX
+## ----------- ##
## confdefs.h. ##
-## ----------- ##"
+## ----------- ##
+_ASBOX
echo
cat confdefs.h
echo
@@ -2109,12 +2118,7 @@
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
+ ac_site_file1=$CONFIG_SITE
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
@@ -2129,11 +2133,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+ . "$ac_site_file"
fi
done
@@ -2209,7 +2209,7 @@
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -2226,22 +2226,16 @@
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
+ for ac_t in install-sh install.sh shtool; do
+ if test -f "$ac_dir/$ac_t"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/$ac_t -c"
+ break 2
+ fi
+ done
done
if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
@@ -2357,11 +2351,11 @@
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
+ as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
+ as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
esac
# Do `set' in a subshell so we don't clobber the current shell's
@@ -2383,7 +2377,7 @@
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ as_fn_error "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
fi
@@ -2393,7 +2387,7 @@
# Ok.
:
else
- as_fn_error $? "newly created file is older than distributed files!
+ as_fn_error "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -2631,7 +2625,7 @@
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
@@ -2639,7 +2633,7 @@
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -2673,7 +2667,7 @@
am__isrc=' -I$(srcdir)'
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
fi
fi
@@ -2689,7 +2683,7 @@
# Define the identity of the package.
PACKAGE='mod_gearman'
- VERSION='1.0.3'
+ VERSION='1.0.6'
cat >>confdefs.h <<_ACEOF
@@ -2958,8 +2952,9 @@
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C++ compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+{ as_fn_set_status 77
+as_fn_error "C++ compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -3001,8 +2996,8 @@
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3059,9 +3054,9 @@
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C++ compiled programs.
+as_fn_error "cannot run C++ compiled programs.
If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details." "$LINENO" 5; }
fi
fi
fi
@@ -3112,8 +3107,8 @@
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@@ -3731,8 +3726,8 @@
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4107,7 +4102,7 @@
fi
set dummy $CC; ac_cc=`$as_echo "$2" |
sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then :
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4404,7 +4399,7 @@
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -4420,11 +4415,11 @@
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
break
fi
@@ -4463,7 +4458,7 @@
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -4479,18 +4474,18 @@
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
fi
ac_ext=c
@@ -4551,7 +4546,7 @@
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
@@ -4617,7 +4612,7 @@
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
@@ -4749,7 +4744,8 @@
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -4853,7 +4849,8 @@
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -5215,13 +5212,14 @@
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
else
- as_fn_error $? "Compiling mod_gearman requires standard unix headers files" "$LINENO" 5
+ as_fn_error "Compiling mod_gearman requires standard unix headers files" "$LINENO" 5
fi
done
@@ -5235,7 +5233,7 @@
_ACEOF
else
- as_fn_error $? "Compiling mod_gearman requires ltdl.h" "$LINENO" 5
+ as_fn_error "Compiling mod_gearman requires ltdl.h" "$LINENO" 5
fi
done
@@ -5249,7 +5247,7 @@
_ACEOF
else
- as_fn_error $? "Compiling mod_gearman requires curses.h" "$LINENO" 5
+ as_fn_error "Compiling mod_gearman requires curses.h" "$LINENO" 5
fi
done
@@ -5292,11 +5290,12 @@
##############################################
# Check some functions
-for ac_func in gettimeofday strdup strchr strstr strtoul alarm gethostname memset strcspn strerror atexit gethostbyname socket
+for ac_func in gettimeofday strsep strtok strdup strchr strstr strtoul alarm gethostname memset strcspn strerror atexit gethostbyname socket dup2 localtime_r memmove strpbrk
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -5387,7 +5386,7 @@
LIBS="-lgearman $LIBS"
else
- as_fn_error $? "Compiling mod_gearman requires libgearman. You may specify the path by --with-gearman=path..." "$LINENO" 5
+ as_fn_error "Compiling mod_gearman requires libgearman. You may specify the path by --with-gearman=path..." "$LINENO" 5
fi
@@ -5482,7 +5481,6 @@
ac_libobjs=
ac_ltlibobjs=
-U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -5506,15 +5504,15 @@
fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
+ as_fn_error "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+ as_fn_error "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+ as_fn_error "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
@@ -5664,19 +5662,19 @@
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
+# script with status $?, using 1 if that was 0.
as_fn_error ()
{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
fi
- $as_echo "$as_me: error: $2" >&2
+ $as_echo "$as_me: error: $1" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -5872,7 +5870,7 @@
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -5925,8 +5923,8 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mod_gearman $as_me 1.0.3, which was
-generated by GNU Autoconf 2.67. Invocation command line was
+This file was extended by mod_gearman $as_me 1.0.6, which was
+generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -5991,11 +5989,11 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mod_gearman config.status 1.0.3
-configured by $0, generated by GNU Autoconf 2.67,
+mod_gearman config.status 1.0.6
+configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -6013,16 +6011,11 @@
while test $# != 0
do
case $1 in
- --*=?*)
+ --*=*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
*)
ac_option=$1
ac_optarg=$2
@@ -6044,7 +6037,6 @@
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
@@ -6057,7 +6049,7 @@
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
+ as_fn_error "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
@@ -6066,7 +6058,7 @@
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
+ -*) as_fn_error "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
@@ -6124,7 +6116,7 @@
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -6162,7 +6154,7 @@
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
@@ -6179,7 +6171,7 @@
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
+ ac_cs_awk_cr='\r'
else
ac_cs_awk_cr=$ac_cr
fi
@@ -6193,18 +6185,18 @@
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -6293,28 +6285,20 @@
else
cat
fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+ || as_fn_error "could not setup config files machinery" "$LINENO" 5
_ACEOF
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
s/^[^=]*=[ ]*$//
}'
fi
@@ -6342,7 +6326,7 @@
if test -z "$ac_t"; then
break
elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -6427,7 +6411,7 @@
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+ as_fn_error "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
@@ -6440,7 +6424,7 @@
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+ :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -6468,7 +6452,7 @@
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+ as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -6495,7 +6479,7 @@
case $ac_tag in
*:-:* | *:-) cat >"$tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -6632,22 +6616,22 @@
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
+which seems to be undefined. Please make sure it is defined." >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
+which seems to be undefined. Please make sure it is defined." >&2;}
rm -f "$tmp/stdin"
case $ac_file in
-) cat "$tmp/out" && rm -f "$tmp/out";;
*) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
;;
:H)
#
@@ -6658,19 +6642,19 @@
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
} >"$tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
+ || as_fn_error "could not create -" "$LINENO" 5
fi
# Compute "$ac_file"'s index in $config_headers.
_am_arg="$ac_file"
@@ -6820,7 +6804,7 @@
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
@@ -6841,7 +6825,7 @@
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
+ $ac_cs_success || as_fn_exit $?
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/configure.ac
^
|
@@ -3,7 +3,7 @@
##############################################
AC_PREREQ([2.59])
-AC_INIT([mod_gearman], [1.0.3], [sven.nierlein@consol.de])
+AC_INIT([mod_gearman], [1.0.6], [sven.nierlein@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])
@@ -58,7 +58,7 @@
##############################################
# Check some functions
-AC_CHECK_FUNCS([gettimeofday strdup strchr strstr strtoul alarm gethostname memset strcspn strerror atexit gethostbyname socket])
+AC_CHECK_FUNCS([gettimeofday strsep strtok strdup strchr strstr strtoul alarm gethostname memset strcspn strerror atexit gethostbyname socket dup2 localtime_r memmove strpbrk])
AC_PROG_LN_S
##############################################
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/docs/QUICKSTART
^
|
@@ -52,9 +52,9 @@
--------------------------------------
#> cd /tmp
-#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz"
-#> tar zxf mod_gearman-1.0.3.tar.gz
-#> cd mod_gearman-1.0.3
+#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.6.tar.gz"
+#> tar zxf mod_gearman-1.0.6.tar.gz
+#> cd mod_gearman-1.0.6
#> ./configure --prefix=/opt --with-gearman=/opt --with-user=nagios --with-init-dir=/etc/init.d
#> make
#> make install
@@ -118,7 +118,7 @@
--------------------------------------
#> grep mod_gearman /var/log/nagios3/nagios.log
-[1295003042] mod_gearman: Version 1.0.3
+[1295003042] mod_gearman: Version 1.0.6
[1295003042] Event broker module '/opt/lib/mod_gearman/mod_gearman.o' initialized successfully.
--------------------------------------
@@ -135,18 +135,15 @@
First we have a look at '/opt/bin/gearman_top'. You should have at least one
worker for each queue.
---------------------------------------
-2011-01-07 23:23:24 - localhost:4730 - v0.14
-
-Queue Name | Worker Available | Jobs Waiting | Jobs Running
-------------------------------------------------------------------
-check_results | 1 | 0 | 0
-eventhandler | 1 | 0 | 0
-host | 1 | 0 | 0
-service | 1 | 0 | 0
-worker_debian64 | 1 | 0 | 0
-------------------------------------------------------------------
---------------------------------------
+ 2011-01-07 23:23:24 - localhost:4730 - v0.14
+ Queue Name | Worker Available | Jobs Waiting | Jobs Running
+ ------------------------------------------------------------------
+ check_results | 1 | 0 | 0
+ eventhandler | 1 | 0 | 0
+ host | 1 | 0 | 0
+ service | 1 | 0 | 0
+ worker_debian64 | 1 | 0 | 0
+ ------------------------------------------------------------------
Check-Gearman
~~~~~~~~~~~~~
@@ -155,7 +152,7 @@
--------------------------------------
#> /opt/bin/check_gearman -H localhost -q worker_`hostname` -t 10 -s check
-check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.3|worker=1 jobs=2c
+check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.6|worker=1 jobs=2c
--------------------------------------
The interesting number is the last one, '2c' in our case, which means there
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/docs/QUICKSTART.html
^
|
@@ -606,9 +606,9 @@
<div class="listingblock">
<div class="content">
<pre><tt>#> cd /tmp
-#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz"
-#> tar zxf mod_gearman-1.0.3.tar.gz
-#> cd mod_gearman-1.0.3
+#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.6.tar.gz"
+#> tar zxf mod_gearman-1.0.6.tar.gz
+#> cd mod_gearman-1.0.6
#> ./configure --prefix=/opt --with-gearman=/opt --with-user=nagios --with-init-dir=/etc/init.d
#> make
#> make install
@@ -666,7 +666,7 @@
<div class="listingblock">
<div class="content">
<pre><tt>#> grep mod_gearman /var/log/nagios3/nagios.log
-[1295003042] mod_gearman: Version 1.0.3
+[1295003042] mod_gearman: Version 1.0.6
[1295003042] Event broker module '/opt/lib/mod_gearman/mod_gearman.o' initialized successfully.</tt></pre>
</div></div>
</div>
@@ -676,27 +676,24 @@
<h3 id="_gearman_top">Gearman-Top</h3><div style="clear:left"></div>
<div class="paragraph"><p>First we have a look at <em>/opt/bin/gearman_top</em>. You should have at least one
worker for each queue.</p></div>
-<div class="listingblock">
+<div class="literalblock">
<div class="content">
<pre><tt>2011-01-07 23:23:24 - localhost:4730 - v0.14
-
-Queue Name | Worker Available | Jobs Waiting | Jobs Running</tt></pre>
-</div></div>
-<div class="paragraph"><p>check_results | 1 | 0 | 0
+Queue Name | Worker Available | Jobs Waiting | Jobs Running
+------------------------------------------------------------------
+check_results | 1 | 0 | 0
eventhandler | 1 | 0 | 0
host | 1 | 0 | 0
service | 1 | 0 | 0
-worker_debian64 | 1 | 0 | 0</p></div>
-<div class="listingblock">
-<div class="content">
-<pre><tt></tt></pre>
+worker_debian64 | 1 | 0 | 0
+------------------------------------------------------------------</tt></pre>
</div></div>
<h3 id="_check_gearman">Check-Gearman</h3><div style="clear:left"></div>
<div class="paragraph"><p>Then we have a look at the shiped check plugin:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>#> /opt/bin/check_gearman -H localhost -q worker_`hostname` -t 10 -s check
-check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.3|worker=1 jobs=2c</tt></pre>
+check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.0.6|worker=1 jobs=2c</tt></pre>
</div></div>
<div class="paragraph"><p>The interesting number is the last one, <em>2c</em> in our case, which means there
have been already 2 jobs executed by this worker.</p></div>
@@ -736,7 +733,7 @@
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2011-03-23 21:48:03 CEST
+Last updated 2011-05-25 17:02:58 CEST
</div>
</div>
</body>
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/docs/README.html
^
|
@@ -585,19 +585,26 @@
</p>
</li>
</ul></div>
+<div class="paragraph"><p><a href="http://labs.consol.de/wp-content/uploads/2010/09/Mod-Gearman.pdf">Have a look at the slides from the Nagios Workshop 2011 in Hannover</a></p></div>
</div>
<h2 id="_support_amp_questions">Support & Questions</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
-Mod-Gearman has been succesfully tested with Nagios 3.2.3 and Icinga 1.2.0 and there are no known bugs at the moment.
+Mod-Gearman has been succesfully tested with Nagios 3.2.3 and Icinga
+ 1.2.0 running on Lib-Gearman 0.14. There are no known bugs at the moment.
Let me know if you find one.
</p>
</li>
<li>
<p>
-Please use the Mod-Gearman <a href="https://groups.google.com/group/mod_gearman">google groups mailinglist</a> for support, questions and bug reports.
+<a href="https://groups.google.com/group/mod_gearman">google groups mailinglist</a>
+</p>
+</li>
+<li>
+<p>
+<a href="http://labs.consol.de/lang/de/forum/#/categories/mod-gearman">support forum</a>
</p>
</li>
<li>
@@ -721,6 +728,14 @@
<a title="Distributed Monitoring with Load Balancing" rel="lightbox[mod_gm]" href="http://labs.consol.de/wp-content/uploads/2010/09/sample_distributed_load_balanced.png"><img src="http://labs.consol.de/wp-content/uploads/2010/09/sample_distributed_load_balanced.png" alt="Distributed Monitoring with Load Balancing" width="350" height="225" style="float:none" /></a>
<div class="paragraph"><p>Your distributed setup could easily be extended to a load balanced
setup with just adding more worker of the same config.</p></div>
+<h3 id="_nsca_replacement">NSCA Replacement</h3><div style="clear:left"></div>
+<a title="NSCA Replacement" rel="lightbox[mod_gm]" href="http://labs.consol.de/wp-content/uploads/2010/09/nsca_replacement.png"><img src="http://labs.consol.de/wp-content/uploads/2010/09/nsca_replacement.png" alt="NSCA Replacement" width="300" height="220" style="float:none" /></a>
+<div class="paragraph"><p>If you just want to replace a current NSCA solution, you could load
+the Mod-Gearman NEB module and disable all distribution features. You
+still can receive passive results by the core send via
+send_gearman / send_multi. Make sure you use the same encryption
+settings like the neb module or your core won’t be able to process the
+results.</p></div>
</div>
<h2 id="_installation">Installation</h2>
<div class="sectionbody">
@@ -879,6 +894,68 @@
</div></div>
</dd>
<dt class="hdlist1">
+logmode
+</dt>
+<dd>
+<p>
+ set way of logging.
+ Possible values are:
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+<tt>automatic</tt> - logfile when a logfile is specified. stdout when
+ no logfile is given.
+ stdout for tools.
+</p>
+</li>
+<li>
+<p>
+<tt>stdout</tt> - just print all messages to stdout
+</p>
+</li>
+<li>
+<p>
+<tt>syslog</tt> - use syslog for all log events
+</p>
+</li>
+<li>
+<p>
+<tt>file</tt> - use logfile
+</p>
+</li>
+<li>
+<p>
+<tt>core</tt> - use nagios internal loging (not thread safe! Use
+ with care)
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>Default is automatic.</p></div>
+<div class="exampleblock">
+<div class="exampleblock-content">
+<div class="literalblock">
+<div class="content">
+<pre><tt>debug=1</tt></pre>
+</div></div>
+</div></div>
+</dd>
+<dt class="hdlist1">
+logfile
+</dt>
+<dd>
+<p>
+Path to the logfile.
+</p>
+<div class="exampleblock">
+<div class="exampleblock-content">
+<div class="literalblock">
+<div class="content">
+<pre><tt>logfile=/path/to/log.file</tt></pre>
+</div></div>
+</div></div>
+</dd>
+<dt class="hdlist1">
server
</dt>
<dd>
@@ -1201,21 +1278,6 @@
</div></div>
</dd>
<dt class="hdlist1">
-logfile
-</dt>
-<dd>
-<p>
-Path to the logfile.
-</p>
-<div class="exampleblock">
-<div class="exampleblock-content">
-<div class="literalblock">
-<div class="content">
-<pre><tt>logfile=/path/to/log.file</tt></pre>
-</div></div>
-</div></div>
-</dd>
-<dt class="hdlist1">
min-worker
</dt>
<dd>
@@ -1315,7 +1377,7 @@
</div></div>
</dd>
<dt class="hdlist1">
-dup_server
+dupserver
</dt>
<dd>
<p>
@@ -1327,7 +1389,7 @@
<div class="exampleblock-content">
<div class="literalblock">
<div class="content">
-<pre><tt>dup_server=logserver:4730,logserver2:4730</tt></pre>
+<pre><tt>dupserver=logserver:4730,logserver2:4730</tt></pre>
</div></div>
</div></div>
</dd>
@@ -1559,7 +1621,7 @@
<div class="ulist"><ul>
<li>
<p>
-<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz">version 1.0.3 - March 23 2011</a>
+<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.6.tar.gz">version 1.0.6 - June 04 2011</a>
</p>
</li>
<li>
@@ -1577,6 +1639,21 @@
<div class="ulist"><ul>
<li>
<p>
+<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.6.tar.gz">version 1.0.6 - June 04 2011</a>
+</p>
+</li>
+<li>
+<p>
+<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.5.tar.gz">version 1.0.5 - May 17 2011</a>
+</p>
+</li>
+<li>
+<p>
+<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.4.tar.gz">version 1.0.4 - April 17 2011</a>
+</p>
+</li>
+<li>
+<p>
<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.3.tar.gz">version 1.0.3 - March 23 2011</a>
</p>
</li>
@@ -1631,7 +1708,7 @@
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2011-03-23 21:47:45 CEST
+Last updated 2011-06-04 11:49:21 CEST
</div>
</div>
</body>
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/etc/mod_gearman.conf
^
|
@@ -54,6 +54,15 @@
# queues.
#servicegroups=name1,name2,name3
+# Set this to 'no' if you want Mod-Gearman to only take care about
+# servicechecks. No hostchecks will be processed by Mod-Gearman. Use
+# this option to disable hostchecks and still have the possibility to
+# use hostgroups for easy configuration of your services.
+# If set to yes, you still have to define which hostchecks should be
+# processed by either using 'hosts' or the 'hostgroups' option.
+# Default is Yes.
+do_hostchecks=yes
+
# enables or disables encryption. It is strongly
# advised to not disable encryption. Anybody will be
# able to inject packages to your worker.
@@ -127,10 +136,10 @@
###############################################################################
# Path to the pidfile. Usually set by the init script
-#pidfile=/opt/local/var/mod_gearman/mod_gearman_worker.pid
+#pidfile=/tmp/gm/var/mod_gearman/mod_gearman_worker.pid
# Path to the logfile.
-logfile=/opt/local/var/mod_gearman/mod_gearman_worker.log
+logfile=/tmp/gm/var/mod_gearman/mod_gearman_worker.log
# Minimum number of worker processes which should
# run at any time.
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/etc/mod_gearman.conf.in
^
|
@@ -54,6 +54,15 @@
# queues.
#servicegroups=name1,name2,name3
+# Set this to 'no' if you want Mod-Gearman to only take care about
+# servicechecks. No hostchecks will be processed by Mod-Gearman. Use
+# this option to disable hostchecks and still have the possibility to
+# use hostgroups for easy configuration of your services.
+# If set to yes, you still have to define which hostchecks should be
+# processed by either using 'hosts' or the 'hostgroups' option.
+# Default is Yes.
+do_hostchecks=yes
+
# enables or disables encryption. It is strongly
# advised to not disable encryption. Anybody will be
# able to inject packages to your worker.
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/extras/gearmand-init
^
|
@@ -12,13 +12,13 @@
### END INIT INFO
NAME=gearmand
-DAEMON="/opt/local/sbin/gearmand"
+DAEMON="/usr/sbin/gearmand"
OPTIONS="-d -j 0"
PORT=4730
LISTEN=0.0.0.0
-PIDFILE=/opt/local/var/mod_gearman/gearmand.pid
-LOGFILE=/opt/local/var/mod_gearman/gearmand.log
-USER=nagios
+PIDFILE=/tmp/gm/var/mod_gearman/gearmand.pid
+LOGFILE=/tmp/gm/var/mod_gearman/gearmand.log
+USER=sven
GRACEFUL_SHUTDOWN_TIME=30
LIBEVENTMINVERSION=1.4
for f in $( which netcat nc 2>/dev/null ) ; do
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/extras/standalone_worker.conf
^
|
@@ -1,11 +1,11 @@
###############################################################################
-#
+#
# mod_gearman - distribute checks with gearman
-#
+#
# Copyright (c) 2010 Sven Nierlein
-#
+#
# Sample Standalone Worker Config
-#
+#
###############################################################################
# use debug to increase the verbosity of the module.
@@ -18,6 +18,20 @@
debug=0
+# set the way of logging
+# Possible values are:
+# automatic
+# -> logfile when a logfile is specified
+# -> stdout for tools
+# file
+# -> use logfile
+# stdout
+# -> just print all messages to stdout
+# syslog
+# -> use syslog for all log events
+logmode=automatic
+
+
# sets the addess of your gearman job server. Can be specified
# more than once to add more server.
server=localhost:4730
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/check_gearman.h
^
|
@@ -40,9 +40,6 @@
#include <signal.h>
#include "common.h"
-mod_gm_opt_t *mod_gm_opt; /**< global options structure */
-
-
/** check_gearman
*
* main function of check_gearman
@@ -105,4 +102,3 @@
/**
* @}
*/
-
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/common.h
^
|
@@ -52,7 +52,7 @@
#define MOD_GM_COMMON_H
/* constants */
-#define GM_VERSION "1.0.3"
+#define GM_VERSION "1.0.6"
#define GM_ENABLED 1
#define GM_DISABLED 0
#define GM_BUFFERSIZE 98304
@@ -73,6 +73,14 @@
#define GM_LOG_TRACE 2
#define GM_LOG_STDOUT 3
+/* log modes */
+#define GM_LOG_MODE_AUTO 0
+#define GM_LOG_MODE_FILE 1
+#define GM_LOG_MODE_STDOUT 2
+#define GM_LOG_MODE_CORE 3
+#define GM_LOG_MODE_SYSLOG 4
+#define GM_LOG_MODE_TOOLS 5
+
/* job priorities */
#define GM_JOB_PRIO_LOW 1
#define GM_JOB_PRIO_NORMAL 2
@@ -165,6 +173,9 @@
int job_timeout; /**< override job timeout */
int encryption; /**< flag wheter messages are encrypted */
int transportmode; /**< flag for the transportmode, base64 only or base64 and encrypted */
+ int logmode; /**< logmode: auto, syslog, file or nagios */
+ char * logfile; /**< path for the logfile */
+ FILE * logfile_fp; /**< filedescriptor for the logfile */
/* neb module */
char * result_queue; /**< name of the result queue used by the neb module */
int result_workers; /**< number of result worker threads started */
@@ -180,8 +191,6 @@
/* worker */
char * identifier; /**< identifier for this worker */
char * pidfile; /**< path to a pidfile */
- char * logfile; /**< path for the logfile */
- FILE * logfile_fp; /**< filedescriptor for the logfile */
int daemon_mode; /**< running as daemon ot not? */
int debug_result; /**< flag to write a debug file for each result */
int max_age; /**< max age in seconds for new jobs */
@@ -226,20 +235,8 @@
} gm_job_t;
-/**
- * general logger
- *
- * logger is then defined in worker_logger.c
- * and the neb logger in logger.c
- * tools logger is in the tools_logger.c
- *
- * @param[in] lvl - debug level for this message
- * @param[in] text - text to log
- *
- * @return nothing
- */
-void gm_log( int lvl, const char *text, ... );
-
+/** options structure */
+mod_gm_opt_t *mod_gm_opt;
/*
* @}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/gearman_top.h
^
|
@@ -38,8 +38,6 @@
#include <time.h>
#include "common.h"
-mod_gm_opt_t *mod_gm_opt; /**< global options structure */
-
/** gearman_top
*
* main function of gearman_top
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/mod_gearman.h
^
|
@@ -22,8 +22,10 @@
*****************************************************************************/
#define MOD_GM_NEB /**< set mod_gearman neb features */
+#define NSCORE /**< enable core features */
-#include <common.h>
+#include "utils.h"
+#include "common.h"
#include <stdio.h>
#include <stdlib.h>
@@ -32,7 +34,6 @@
#include <pthread.h>
#define GM_PERFDATA_QUEUE "perfdata" /**< default performance data queue */
-#define NSCORE /**< enable core features */
/** @file
* @brief Mod-Gearman NEB Module
@@ -91,9 +92,6 @@
*/
void mod_gm_add_result_to_list(check_result * newcheckresult);
-/** options structure */
-mod_gm_opt_t *mod_gm_opt;
-
/**
* @}
*/
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/send_gearman.h
^
|
@@ -42,12 +42,9 @@
#include <libgearman/gearman.h>
#include "common.h"
-mod_gm_opt_t *mod_gm_opt; /**< global options structure */
-
-
/** send_gearman
*
- * main function of gearman_top
+ * main function of send_gearman
*
* @param[in] argc - number of arguments
* @param[in] argv - list of arguments
@@ -115,4 +112,3 @@
/**
* @}
*/
-
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/send_multi.h
^
|
@@ -43,8 +43,6 @@
#include <libgearman/gearman.h>
#include "common.h"
-mod_gm_opt_t *mod_gm_opt; /**< options structure */
-
/** send_multi
*
* main function of send_multi
@@ -155,4 +153,3 @@
/**
* @}
*/
-
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/utils.h
^
|
@@ -27,6 +27,19 @@
* @{
*/
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+
#include "common.h"
/**
@@ -431,8 +444,26 @@
*/
char * eventtype2str(int i);
+/**
+ * gm_log
+ *
+ * general logger
+ *
+ * @param[in] lvl - debug level for this message
+ * @param[in] text - text to log
+ *
+ * @return nothing
+ */
+void gm_log( int lvl, const char *text, ... );
+
+/** write log line with core logger
+ *
+ * @param[in] data - log message
+ *
+ * @return nothing
+ */
+void write_core_log(char *data);
/**
* @}
*/
-
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/include/worker.h
^
|
@@ -44,7 +44,6 @@
*/
int mod_gm_shm_key; /**< key for the shared memory segment */
-mod_gm_opt_t *mod_gm_opt; /**< global options structure */
/** Mod-Gearman Worker
*
@@ -193,4 +192,3 @@
/**
* @}
*/
-
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/neb_module/mod_gearman.c
^
|
@@ -22,10 +22,8 @@
*****************************************************************************/
/* include header */
-#include "utils.h"
#include "result_thread.h"
#include "mod_gearman.h"
-#include "gm_log.h"
#include "gearman.h"
/* specify event broker API version (required) */
@@ -79,19 +77,19 @@
gearman_module_handle=handle;
/* set some module info */
- neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_TITLE, "mod_gearman" );
+ neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_TITLE, "Mod-Gearman" );
neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_AUTHOR, "Sven Nierlein" );
- neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_TITLE, "Copyright (c) 2010 Sven Nierlein" );
+ neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_TITLE, "Copyright (c) 2010-2011 Sven Nierlein" );
neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_VERSION, GM_VERSION );
neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_LICENSE, "GPL v3" );
neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_DESC, "distribute host/service checks and eventhandler via gearman" );
mod_gm_opt = malloc(sizeof(mod_gm_opt_t));
set_default_options(mod_gm_opt);
- gm_log( GM_LOG_INFO, "Version %s\n", GM_VERSION );
/* parse arguments */
read_arguments( args );
+ gm_log( GM_LOG_INFO, "Version %s\n", GM_VERSION );
gm_log( GM_LOG_TRACE, "args: %s\n", args );
gm_log( GM_LOG_TRACE, "nebmodule_init(%i, %i)\n", flags );
gm_log( GM_LOG_DEBUG, "running on libgearman %s\n", gearman_version() );
@@ -419,7 +417,6 @@
nebstruct_host_check_data * hostdata;
char *raw_command=NULL;
char *processed_command=NULL;
- struct timeval start_time;
host * hst;
gm_log( GM_LOG_TRACE, "handle_host_check(%i)\n", event_type );
@@ -446,7 +443,10 @@
}
/* get objects and set target function */
- hst = find_host( hostdata->host_name );
+ if((hst=hostdata->object_ptr)==NULL) {
+ gm_log( GM_LOG_ERROR, "Host handler received NULL host object pointer.\n" );
+ return NEBERROR_CALLBACKCANCEL;
+ }
set_target_queue( hst, NULL );
/* local check? */
@@ -486,9 +486,6 @@
return NEBERROR_CALLBACKCANCEL;
}
- /* get the command start time */
- gettimeofday(&start_time,NULL);
-
/* increment number of host checks that are currently running */
currently_running_host_checks++;
@@ -498,11 +495,10 @@
gm_log( GM_LOG_TRACE, "cmd_line: %s\n", processed_command );
temp_buffer[0]='\x0';
- snprintf( temp_buffer,sizeof( temp_buffer )-1,"type=host\nresult_queue=%s\nhost_name=%s\nstart_time=%i.%i\ntimeout=%d\ncommand_line=%s\n\n\n",
+ snprintf( temp_buffer,sizeof( temp_buffer )-1,"type=host\nresult_queue=%s\nhost_name=%s\nstart_time=%i.0\ntimeout=%d\ncommand_line=%s\n\n\n",
mod_gm_opt->result_queue,
hst->name,
- ( int )start_time.tv_sec,
- ( int )start_time.tv_usec,
+ ( int )hst->next_check,
host_check_timeout,
processed_command
);
@@ -549,7 +545,6 @@
service * svc = NULL;
char *raw_command=NULL;
char *processed_command=NULL;
- struct timeval start_time;
nebstruct_service_check_data * svcdata;
int prio = GM_JOB_PRIO_LOW;
@@ -570,11 +565,16 @@
}
/* get objects and set target function */
- svc = find_service( svcdata->host_name, svcdata->service_description );
+ if((svc=svcdata->object_ptr)==NULL) {
+ gm_log( GM_LOG_ERROR, "Service handler received NULL service object pointer.\n" );
+ return NEBERROR_CALLBACKCANCEL;
+ }
/* find the host associated with this service */
- if((hst=svc->host_ptr)==NULL)
+ if((hst=svc->host_ptr)==NULL) {
+ gm_log( GM_LOG_ERROR, "Service handler received NULL host object pointer.\n" );
return NEBERROR_CALLBACKCANCEL;
+ }
set_target_queue( hst, svc );
/* local check? */
@@ -611,9 +611,6 @@
return NEBERROR_CALLBACKCANCEL;
}
- /* get the command start time */
- gettimeofday(&start_time,NULL);
-
/* increment number of service checks that are currently running... */
currently_running_service_checks++;
@@ -624,12 +621,11 @@
gm_log( GM_LOG_TRACE, "cmd_line: %s\n", processed_command );
temp_buffer[0]='\x0';
- snprintf( temp_buffer,sizeof( temp_buffer )-1,"type=service\nresult_queue=%s\nhost_name=%s\nservice_description=%s\nstart_time=%i.%i\ntimeout=%d\ncommand_line=%s\n\n\n",
+ snprintf( temp_buffer,sizeof( temp_buffer )-1,"type=service\nresult_queue=%s\nhost_name=%s\nservice_description=%s\nstart_time=%i.0\ntimeout=%d\ncommand_line=%s\n\n\n",
mod_gm_opt->result_queue,
svcdata->host_name,
svcdata->service_description,
- ( int )start_time.tv_sec,
- ( int )start_time.tv_usec,
+ ( int )svc->next_check,
service_check_timeout,
processed_command
);
@@ -714,14 +710,29 @@
/* verify our option */
static int verify_options(mod_gm_opt_t *opt) {
+
+ /* open new logfile */
+ if ( opt->logmode == GM_LOG_MODE_AUTO && opt->logfile ) {
+ opt->logmode = GM_LOG_MODE_FILE;
+ }
+ if(opt->logmode == GM_LOG_MODE_FILE && opt->logfile && opt->debug_level < GM_LOG_STDOUT) {
+ opt->logfile_fp = fopen(opt->logfile, "a+");
+ if(opt->logfile_fp == NULL) {
+ gm_log( GM_LOG_ERROR, "error opening logfile: %s\n", opt->logfile );
+ }
+ }
+ if ( opt->logmode == GM_LOG_MODE_AUTO ) {
+ opt->logmode = GM_LOG_MODE_CORE;
+ }
+
/* did we get any server? */
if(opt->server_num == 0) {
gm_log( GM_LOG_ERROR, "please specify at least one server\n" );
return(GM_ERROR);
}
- if ( mod_gm_opt->result_queue == NULL )
- mod_gm_opt->result_queue = GM_DEFAULT_RESULT_QUEUE;
+ if ( opt->result_queue == NULL )
+ opt->result_queue = GM_DEFAULT_RESULT_QUEUE;
/* nothing set by hand -> defaults */
if( opt->set_queues_by_hand == 0 ) {
@@ -731,28 +742,6 @@
opt->events = GM_ENABLED;
}
- if( opt->servicegroups_num == 0
- && opt->hostgroups_num == 0
- && opt->exports_count == 0
- && opt->hosts == GM_DISABLED
- && opt->services == GM_DISABLED
- && opt->events == GM_DISABLED
- && opt->perfdata == GM_DISABLED
- ) {
- gm_log( GM_LOG_ERROR, "loading Mod-Gearman NEB module without any queues is useless\n" );
- return(GM_ERROR);
- }
-
- /* do we need a result thread? */
- if( opt->servicegroups_num == 0
- && opt->hostgroups_num == 0
- && opt->hosts == GM_DISABLED
- && opt->services == GM_DISABLED
- ) {
- gm_log( GM_LOG_DEBUG, "disabled unused result threads\n" );
- mod_gm_opt->result_workers = 0;
- }
-
return(GM_OK);
}
@@ -1113,3 +1102,10 @@
mod_gm_opt->debug_level = debug_level_orig;
return return_code;
}
+
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ write_to_all_logs( data, NSLOG_INFO_MESSAGE );
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/neb_module/result_thread.c
^
|
@@ -26,7 +26,6 @@
#include "result_thread.h"
#include "utils.h"
#include "mod_gearman.h"
-#include "gm_log.h"
#include "gearman.h"
/* cleanup and exit this thread */
@@ -233,7 +232,14 @@
finishtime_f = (double)chk_result->finish_time.tv_sec + (double)chk_result->finish_time.tv_usec / 1000000;
exec_time = finishtime_f - starttime_f;
latency = now_f - exec_time - core_starttime_f;
- chk_result->latency += latency;
+
+ if(latency < 0)
+ latency = 0;
+ if(chk_result->latency < 0)
+ chk_result->latency = 0;
+
+ chk_result->latency += latency;
+
#ifdef GM_DEBUG
if(chk_result->latency > 1000)
write_debug_file(&decrypted_orig);
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/support/mod_gearman.spec
^
|
@@ -1,5 +1,5 @@
Name: mod_gearman
-Version: 1.0.3
+Version: 1.0.4
Release: 3
License: GNU Public License version 2
Packager: Olivier Raginel <babar@cern.ch>
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/t/01-utils.c
^
|
@@ -4,7 +4,6 @@
#include <unistd.h>
#include <t/tap.h>
-#include <worker_logger.h>
#include <common.h>
#include <utils.h>
@@ -19,14 +18,14 @@
}
int main(void) {
- plan(42);
+ plan(44);
/* lowercase */
char test[100];
ok(lc(NULL) == NULL, "lc(NULL)");
- strcpy(test, "Yes"); ok(strcmp(lc(test), "yes") == 0, "lc(yes)");
- strcpy(test, "YES"); ok(strcmp(lc(test), "yes") == 0, "lc(YES)");
- strcpy(test, "yeS"); ok(strcmp(lc(test), "yes") == 0, "lc(yeS)");
+ strcpy(test, "Yes"); like(lc(test), "yes", "lc(yes)");
+ strcpy(test, "YES"); like(lc(test), "yes", "lc(YES)");
+ strcpy(test, "yeS"); like(lc(test), "yes", "lc(yeS)");
/* parse_yes_or_no */
@@ -47,7 +46,7 @@
/* trim */
ok(trim(NULL) == NULL, "trim(NULL)");
- strcpy(test, " test "); ok(strcmp(trim(test), "test") == 0, "trim(' test ')");
+ strcpy(test, " test "); like(trim(test), "test", "trim(' test ')");
/* reading keys */
mod_gm_opt_t *mod_gm_opt;
@@ -65,20 +64,17 @@
snprintf(hex, 4, "%02x", mod_gm_opt->crypt_key[i]);
strncat(test, hex, 4);
}
- if(!ok(strcmp(test, "3131313131313131313131313131313131313131313131313131313131310000") == 0, "read keyfile t/data/test1.key"))
- diag("expected: '3131313131313131313131313131313131313131313131313131313131310000'\n but got: '%s'", test );
+ like(test, "3131313131313131313131313131313131313131313131313131313131310000", "read keyfile t/data/test1.key");
mod_gm_opt->keyfile = "t/data/test2.key";
read_keyfile(mod_gm_opt);
- //printf_hex(mod_gm_opt->crypt_key, 32);
- if(!ok(strcmp(mod_gm_opt->crypt_key, "abcdef") == 0, "reading keyfile t/data/test2.key"))
- diag("expected: 'abcdef'\n but got: '%s'", mod_gm_opt->crypt_key );
+
+ like(mod_gm_opt->crypt_key, "abcdef", "reading keyfile t/data/test2.key");
mod_gm_opt->keyfile = "t/data/test3.key";
read_keyfile(mod_gm_opt);
//printf_hex(mod_gm_opt->crypt_key, 32);
- if(!ok(strcmp(mod_gm_opt->crypt_key, "11111111111111111111111111111111") == 0, "reading keyfile t/data/test3.key"))
- diag("expected: '11111111111111111111111111111111'\n but got: '%s'", mod_gm_opt->crypt_key );
+ like(mod_gm_opt->crypt_key, "11111111111111111111111111111111", "reading keyfile t/data/test3.key");
ok(strlen(mod_gm_opt->crypt_key) == 32, "key size for t/data/test3.key");
@@ -91,14 +87,12 @@
int len;
len = mod_gm_encrypt(&encrypted, text, GM_ENCODE_AND_ENCRYPT);
ok(len == 24, "length of encrypted only");
- if(!ok(!strcmp(encrypted, base), "encrypted string"))
- diag("expected: '%s' but got: '%s'", base, encrypted);
+ like(encrypted, base, "encrypted string");
/* decrypt */
char * decrypted = malloc(GM_BUFFERSIZE);
mod_gm_decrypt(&decrypted, encrypted, GM_ENCODE_AND_ENCRYPT);
- if(!ok(!strcmp(decrypted, text), "decrypted text"))
- diag("expected: '%s' but got: '%s'", text, decrypted);
+ like(decrypted, text, "decrypted text");
free(decrypted);
free(encrypted);
@@ -106,13 +100,12 @@
char * base64 = malloc(GM_BUFFERSIZE);
len = mod_gm_encrypt(&base64, text, GM_ENCODE_ONLY);
ok(len == 16, "length of encode only");
- ok(!strcmp(base64, "dGVzdCBtZXNzYWdl"), "base64 only string");
+ like(base64, "dGVzdCBtZXNzYWdl", "base64 only string");
/* debase 64 */
char * debase64 = malloc(GM_BUFFERSIZE);
mod_gm_decrypt(&debase64, base64, GM_ENCODE_ONLY);
- if(!ok(!strcmp(debase64, text), "debase64 text"))
- diag("expected: '%s' but got: '%s'", text, debase64);
+ like(debase64, text, "debase64 text");
free(debase64);
free(base64);
@@ -123,13 +116,11 @@
/* nr2signal */
char * signame1 = nr2signal(9);
- if(!ok(!strcmp(signame1, "SIGKILL"), "get SIGKILL for 9"))
- diag("expected: 'SIGKILL' but got: '%s'", signame1);
+ like(signame1, "SIGKILL", "get SIGKILL for 9");
free(signame1);
char * signame2 = nr2signal(15);
- if(!ok(!strcmp(signame2, "SIGTERM"), "get SIGTERM for 15"))
- diag("expected: 'SIGTERM' but got: '%s'", signame2);
+ like(signame2, "SIGTERM", "get SIGTERM for 15");
free(signame2);
@@ -151,5 +142,20 @@
ok(t.tv_sec == 0, "string2timeval 7");
ok(t.tv_usec == 0, "string2timeval 8");
+ /* command line parsing */
+ strcpy(test, "server=host:4730");
+ parse_args_line(mod_gm_opt, test, 0);
+ like(mod_gm_opt->server_list[0], "host:4730", "server=host:4730");
+
+ strcpy(test, "server=:4730");
+ parse_args_line(mod_gm_opt, test, 0);
+ like(mod_gm_opt->server_list[1], "localhost:4730", "server=:4730");
+
return exit_status();
}
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tests: %s", data);
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/t/02-full.c
^
|
@@ -7,7 +7,6 @@
#include <sys/time.h>
#include <t/tap.h>
-#include <worker_logger.h>
#include <common.h>
#include <utils.h>
#include <gearman.h>
@@ -31,8 +30,8 @@
if(pid == 0) {
sid = setsid();
char port[30];
- snprintf(port, 30, "-p %d", GEARMAND_TEST_PORT);
- execlp("gearmand", "gearmand", "-t 10", "-j 0", port, (char *)NULL);
+ snprintf(port, 30, "--port=%d", GEARMAND_TEST_PORT);
+ execlp("gearmand", "gearmand", "--threads=10", "--job-retries=0", port, "--verbose=5", (char *)NULL);
perror("gearmand");
exit(1);
}
@@ -180,7 +179,7 @@
diag( "waitpid() %d exited with %d\n", chld, status);
}
- if(!ok(gearmand_pid > 0, "'gearmand -t 10 -j 0 -p %d -v -v -v' started with pid: %d", GEARMAND_TEST_PORT, gearmand_pid)) {
+ if(!ok(gearmand_pid > 0, "'gearmand --threads=10 --job-retries=0 --port=%d --verbose=5' started with pid: %d", GEARMAND_TEST_PORT, gearmand_pid)) {
diag("make sure gearmand is in your PATH. Common locations are /usr/sbin or /usr/local/sbin");
exit( EXIT_FAILURE );
}
@@ -249,3 +248,9 @@
endskip;
return exit_status();
}
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tests: %s", data);
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/t/03-exec_checks.c
^
|
@@ -4,7 +4,6 @@
#include <unistd.h>
#include <t/tap.h>
-#include <worker_logger.h>
#include <common.h>
#include <utils.h>
@@ -32,55 +31,44 @@
char *argv[MAX_CMD_ARGS];
strcpy(cmd, "/bin/true");
parse_command_line(cmd, argv);
- if(!ok(argv[0] == cmd, "parsing args cmd 1"))
- diag("expected '%s' but got '%s'", cmd, argv[0]);
+ like(argv[0], cmd, "parsing args cmd 1");
/*****************************************
* arg parsing test 2
*/
strcpy(cmd, "/bin/cmd blah blub foo");
parse_command_line(cmd,argv);
- if(!ok(!strcmp(argv[0], "/bin/cmd"), "parsing args cmd 2"))
- diag("expected '/bin/cmd' but got '%s'", argv[0]);
- if(!ok(!strcmp(argv[1], "blah"), "parsing args cmd 2"))
- diag("expected 'blah' but got '%s'", argv[1]);
- if(!ok(!strcmp(argv[2], "blub"), "parsing args cmd 2"))
- diag("expected 'blub' but got '%s'", argv[2]);
- if(!ok(!strcmp(argv[3], "foo"), "parsing args cmd 2"))
- diag("expected 'foo' but got '%s'", argv[3]);
+ like(argv[0], "/bin/cmd", "parsing args cmd 2");
+ like(argv[1], "blah", "parsing args cmd 2");
+ like(argv[2], "blub", "parsing args cmd 2");
+ like(argv[3], "foo", "parsing args cmd 2");
/*****************************************
* simple test command 1
*/
strcpy(cmd, "/bin/true");
rc = run_check(cmd, &result);
- if(!ok(rc == 0, "pclose for cmd '%s' returned rc %d", cmd, rc))
- diag("cmd: '%s' returned %d", cmd, rc);
+ cmp_ok(rc, "==", 0, "pclose for cmd '%s' returned rc %d", cmd, rc);
rrc = real_exit_code(rc);
- if(!ok(rrc == 0, "cmd '%s' returned rc %d", cmd, rrc))
- diag("cmd: '%s' returned %d", cmd, rrc);
+ cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc);
/*****************************************
* simple test command 2
*/
strcpy(cmd, "/bin/true 2>&1");
rc = run_check(cmd, &result);
- if(!ok(rc == 0, "pclose for cmd '%s' returned rc %d", cmd, rc))
- diag("cmd: '%s' returned %d", cmd, rc);
+ cmp_ok(rc, "==", 0, "pclose for cmd '%s' returned rc %d", cmd, rc);
rrc = real_exit_code(rc);
- if(!ok(rrc == 0, "cmd '%s' returned rc %d", cmd, rrc))
- diag("cmd: '%s' returned %d", cmd, rrc);
+ cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc);
/*****************************************
* simple test command 3
*/
strcpy(cmd, "/usr/lib/nagios/plugins/check_icmp -H 127.0.0.1");
rc = run_check(cmd, &result);
- if(!ok(rc == 0, "pclose for cmd '%s' returned rc %d", cmd, rc))
- diag("cmd: '%s' returned %d", cmd, rc);
+ cmp_ok(rc, "==", 0, "pclose for cmd '%s' returned rc %d", cmd, rc);
rrc = real_exit_code(rc);
- if(!ok(rrc == 0, "cmd '%s' returned rc %d", cmd, rrc))
- diag("cmd: '%s' returned %d", cmd, rrc);
+ cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc);
/*****************************************
* simple test command 4
@@ -88,10 +76,8 @@
strcpy(cmd, "echo -n 'test'; exit 2");
rc = run_check(cmd, &result);
rrc = real_exit_code(rc);
- if(!ok(rrc == 2, "cmd '%s' returned rc %d", cmd, rrc))
- diag("cmd: '%s' returned %d", cmd, rrc);
- if(!ok(!strcmp(result, "test"), "returned result string"))
- diag("expected 'test' but got '%s'", result);
+ cmp_ok(rrc, "==", 2, "cmd '%s' returned rc %d", cmd, rrc);
+ like(result, "test", "returned result string");
gm_job_t * exec_job;
exec_job = ( gm_job_t * )malloc( sizeof *exec_job );
@@ -223,3 +209,9 @@
return exit_status();
}
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tests: %s", data);
+ return;
+}
|
[-]
[+]
|
Added |
mod_gearman-1.0.6.tar.bz2/t/04-log.c
^
|
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <sys/time.h>
+
+#include <t/tap.h>
+#include <common.h>
+#include <utils.h>
+
+
+mod_gm_opt_t *mod_gm_opt;
+
+/* main tests */
+int main(void) {
+ int tests = 4;
+ plan(tests);
+
+ mod_gm_opt = malloc(sizeof(mod_gm_opt_t));
+ set_default_options(mod_gm_opt);
+
+ mod_gm_opt->logmode = GM_LOG_MODE_AUTO;
+ lives_ok({gm_log(GM_LOG_INFO, "info message auto\n");}, "info message in auto mode");
+
+ mod_gm_opt->logmode = GM_LOG_MODE_STDOUT;
+ lives_ok({gm_log(GM_LOG_INFO, "info message stdout\n");}, "info message in stdout mode");
+
+ mod_gm_opt->logmode = GM_LOG_MODE_SYSLOG;
+ lives_ok({gm_log(GM_LOG_INFO, "info message syslog\n");}, "info message in syslog mode");
+
+ mod_gm_opt->logmode = GM_LOG_MODE_CORE;
+ lives_ok({gm_log(GM_LOG_INFO, "info message core\n");}, "info message in core mode");
+
+ return exit_status();
+}
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tests: %s", data);
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/t/tap.c
^
|
@@ -9,13 +9,6 @@
static int current_test;
static char *todo_mesg;
-void
-plan (int tests) {
- expected_tests = tests;
- if (tests != NO_PLAN)
- printf("1..%d\n", tests);
-}
-
static char *
vstrdupf (const char *fmt, va_list args) {
char *str;
@@ -31,6 +24,24 @@
return str;
}
+void
+cplan (int tests, const char *fmt, ...) {
+ expected_tests = tests;
+ if (tests == SKIP_ALL) {
+ char *why;
+ va_list args;
+ va_start(args, fmt);
+ why = vstrdupf(fmt, args);
+ va_end(args);
+ printf("1..0 ");
+ note("SKIP %s\n", why);
+ exit(0);
+ }
+ if (tests != NO_PLAN) {
+ printf("1..%d\n", tests);
+ }
+}
+
int
vok_at_loc (const char *file, int line, int test, const char *fmt,
va_list args)
@@ -205,6 +216,18 @@
return retval;
}
+int
+bail_out (int ignore, const char *fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ printf("Bail out! ");
+ vprintf(fmt, args);
+ printf("\n");
+ va_end(args);
+ exit(255);
+ return 0;
+}
+
void
skippy (int n, const char *fmt, ...) {
char *why;
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/t/tap.h
^
|
@@ -1,46 +1,46 @@
#ifndef __TAP_H__
#define __TAP_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef va_copy
+#define va_copy(d,s) ((d) = (s))
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
-#define NO_PLAN -1
-#define ok(...) ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
-#define pass(...) ok(1, ## __VA_ARGS__)
-#define fail(...) ok(0, ## __VA_ARGS__)
-#define is(...) is_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
-#define isnt(...) isnt_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
-#define cmp_ok(...) cmp_ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
-
int vok_at_loc (const char *file, int line, int test, const char *fmt,
va_list args);
-void plan (int tests);
int ok_at_loc (const char *file, int line, int test, const char *fmt,
...);
-int diag (const char *fmt, ...);
-int note (const char *fmt, ...);
-int exit_status (void);
-void skippy (int n, const char *fmt, ...);
-void ctodo (int ignore, const char *fmt, ...);
-void cendtodo (void);
int is_at_loc (const char *file, int line, const char *got,
const char *expected, const char *fmt, ...);
int isnt_at_loc (const char *file, int line, const char *got,
const char *expected, const char *fmt, ...);
int cmp_ok_at_loc (const char *file, int line, int a, const char *op,
int b, const char *fmt, ...);
+int bail_out (int ignore, const char *fmt, ...);
+void cplan (int tests, const char *fmt, ...);
+int diag (const char *fmt, ...);
+int note (const char *fmt, ...);
+int exit_status (void);
+void skippy (int n, const char *fmt, ...);
+void ctodo (int ignore, const char *fmt, ...);
+void cendtodo (void);
-#ifdef _WIN32
-#define like(...) skippy(1, "like is not implemented on MSWin32")
-#define unlike(...) like()
-#else
-#define like(...) like_at_loc(1, __FILE__, __LINE__, __VA_ARGS__, NULL)
-#define unlike(...) like_at_loc(0, __FILE__, __LINE__, __VA_ARGS__, NULL)
-int like_at_loc (int for_match, const char *file, int line,
- const char *got, const char *expected,
- const char *fmt, ...);
-#endif
+#define NO_PLAN -1
+#define SKIP_ALL -2
+#define ok(...) ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
+#define is(...) is_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
+#define isnt(...) isnt_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
+#define cmp_ok(...) cmp_ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
+#define plan(...) cplan(__VA_ARGS__, NULL)
+#define done_testing return exit_status()
+#define BAIL_OUT(...) bail_out(0, ## __VA_ARGS__, NULL)
#define skip(test, ...) do {if (test) {skippy(__VA_ARGS__, NULL); break;}
#define endskip } while (0)
@@ -48,38 +48,57 @@
#define todo(...) ctodo(0, ## __VA_ARGS__, NULL)
#define endtodo cendtodo()
-#define dies_ok(code, ...) dies_ok_common(code, 1, ## __VA_ARGS__)
-#define lives_ok(code, ...) dies_ok_common(code, 0, ## __VA_ARGS__)
+#define dies_ok(...) dies_ok_common(1, ## __VA_ARGS__)
+#define lives_ok(...) dies_ok_common(0, ## __VA_ARGS__)
#ifdef _WIN32
+#define pass(...) ok_at_loc(__FILE__, __LINE__, 1, __VA_ARGS__, NULL)
+#define fail(...) ok_at_loc(__FILE__, __LINE__, 0, __VA_ARGS__, NULL)
+#define like(...) skippy(1, "like is not implemented on MSWin32")
+#define unlike(...) like()
#define dies_ok_common(...) \
skippy(1, "Death detection is not supported on MSWin32")
#else
+#define pass(...) ok(1, ## __VA_ARGS__)
+#define fail(...) ok(0, ## __VA_ARGS__)
+#define like(...) like_at_loc(1, __FILE__, __LINE__, __VA_ARGS__, NULL)
+#define unlike(...) like_at_loc(0, __FILE__, __LINE__, __VA_ARGS__, NULL)
+int like_at_loc (int for_match, const char *file, int line,
+ const char *got, const char *expected,
+ const char *fmt, ...);
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int tap_test_died (int status);
-#define dies_ok_common(code, for_death, ...) \
+#define dies_ok_common(for_death, code, ...) \
do { \
tap_test_died(1); \
int cpid = fork(); \
switch (cpid) { \
case -1: \
perror("fork error"); \
- exit(EXIT_FAILURE); \
- case 0: /* child */ \
- close(1); close(2); \
+ exit(1); \
+ case 0: \
+ close(1); \
+ close(2); \
code \
tap_test_died(0); \
- exit(EXIT_SUCCESS); \
+ exit(0); \
} \
if (waitpid(cpid, NULL, 0) < 0) { \
perror("waitpid error"); \
- exit(EXIT_FAILURE); \
+ exit(1); \
} \
int it_died = tap_test_died(0); \
- if (!it_died) {code} \
+ if (!it_died) \
+ {code} \
ok(for_death ? it_died : !it_died, ## __VA_ARGS__); \
} while (0)
#endif
+
+#ifdef __cplusplus
+}
#endif
+
+#endif
+
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/tools/check_gearman.c
^
|
@@ -88,6 +88,7 @@
}
}
mod_gm_opt->debug_level = opt_verbose;
+ mod_gm_opt->logmode = GM_LOG_MODE_TOOLS;
server_list[server_list_num] = NULL;
if(opt_server == NULL) {
@@ -132,10 +133,10 @@
printf("\n");
printf("check_gearman [ -H=<hostname> ]\n");
printf(" [ -t=<timeout> ]\n");
- printf(" [ -w=<jobs warning level> ] default: 10\n");
- printf(" [ -c=<jobs critical level> ] default: 100\n");
- printf(" [ -W=<worker warning level> ] default: 25\n");
- printf(" [ -C=<worker critical level> ] default: 50\n");
+ printf(" [ -w=<jobs warning level> ] default: %i\n", opt_job_warning);
+ printf(" [ -c=<jobs critical level> ] default: %i\n", opt_job_critical);
+ printf(" [ -W=<worker warning level> ] default: %i\n", opt_worker_warning);
+ printf(" [ -C=<worker critical level> ] default: %i\n", opt_worker_critical);
printf(" [ -q=<queue> ]\n");
printf("\n");
printf("\n");
@@ -355,3 +356,10 @@
printf("%s OK - %s\n", PLUGIN_NAME, result );
return( STATE_OK );
}
+
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tools: %s", data);
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/tools/gearman_top.c
^
|
@@ -42,6 +42,7 @@
mod_gm_opt = malloc(sizeof(mod_gm_opt_t));
set_default_options(mod_gm_opt);
+
/*
* and parse command line
*/
@@ -66,6 +67,7 @@
}
}
mod_gm_opt->debug_level = opt_verbose;
+ mod_gm_opt->logmode = GM_LOG_MODE_TOOLS;
if(server_list_num == 0)
server_list[server_list_num++] = "localhost";
server_list[server_list_num] = NULL;
@@ -211,3 +213,10 @@
free_mod_gm_status_server(stats);
return;
}
+
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tools: %s", data);
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/tools/send_gearman.c
^
|
@@ -24,10 +24,10 @@
/* include header */
#include "send_gearman.h"
#include "utils.h"
-#include "worker_logger.h"
#include "gearman.h"
gearman_client_st client;
+gearman_client_st client_dup;
/* work starts here */
int main (int argc, char **argv) {
@@ -42,6 +42,10 @@
exit( EXIT_FAILURE );
}
+ /* set logging */
+ mod_gm_opt->debug_level = GM_LOG_INFO;
+ mod_gm_opt->logmode = GM_LOG_MODE_TOOLS;
+
/* init crypto functions */
if(mod_gm_opt->encryption == GM_ENABLED) {
mod_gm_crypt_init(mod_gm_opt->crypt_key);
@@ -55,11 +59,19 @@
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 );
}
@@ -125,6 +137,8 @@
if ( mod_gm_opt->result_queue == NULL )
mod_gm_opt->result_queue = GM_DEFAULT_RESULT_QUEUE;
+ mod_gm_opt->logmode = GM_LOG_MODE_STDOUT;
+
return(GM_OK);
}
@@ -255,6 +269,24 @@
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" );
@@ -280,3 +312,10 @@
printf("\n");
exit( STATE_UNKNOWN );
}
+
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tools: %s", data);
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/tools/send_multi.c
^
|
@@ -25,10 +25,10 @@
/* include header */
#include "send_multi.h"
#include "utils.h"
-#include "worker_logger.h"
#include "gearman.h"
gearman_client_st client;
+gearman_client_st client_dup;
/* work starts here */
int main (int argc, char **argv) {
@@ -43,6 +43,10 @@
exit( 3 );
}
+ /* set logging */
+ mod_gm_opt->debug_level = GM_LOG_INFO;
+ mod_gm_opt->logmode = GM_LOG_MODE_TOOLS;
+
/* init crypto functions */
if(mod_gm_opt->encryption == GM_ENABLED) {
mod_gm_crypt_init(mod_gm_opt->crypt_key);
@@ -56,6 +60,12 @@
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);
@@ -73,6 +83,8 @@
}
gearman_client_free( &client );
+ if( mod_gm_opt->dupserver_num )
+ gearman_client_free( &client_dup );
mod_gm_free_opt(mod_gm_opt);
exit( rc );
}
@@ -246,6 +258,24 @@
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" );
@@ -463,3 +493,10 @@
}
return string;
}
+
+
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for tools: %s", data);
+ return;
+}
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/worker/worker.c
^
|
@@ -24,7 +24,6 @@
/* include header */
#include "worker.h"
#include "utils.h"
-#include "worker_logger.h"
#include "worker_client.h"
int current_number_of_workers = 0;
@@ -95,6 +94,11 @@
gm_log( GM_LOG_INFO, "mod_gearman worker started with pid %d\n", getpid());
}
+ /* print some version information */
+ gm_log( GM_LOG_DEBUG, "Version %s\n", GM_VERSION );
+ gm_log( GM_LOG_DEBUG, "running on libgearman %s\n", gearman_version() );
+
+
/* set signal handlers for a clean exit */
signal(SIGINT, clean_exit);
signal(SIGTERM,clean_exit);
@@ -342,7 +346,10 @@
}
/* open new logfile */
- if(mod_gm_opt->logfile && mod_gm_opt->debug_level < GM_LOG_STDOUT) {
+ if ( mod_gm_new_opt->logmode == GM_LOG_MODE_AUTO && mod_gm_new_opt->logfile ) {
+ mod_gm_opt->logmode = GM_LOG_MODE_FILE;
+ }
+ if(mod_gm_new_opt->logmode == GM_LOG_MODE_FILE && mod_gm_opt->logfile && mod_gm_opt->debug_level < GM_LOG_STDOUT) {
mod_gm_opt->logfile_fp = fopen(mod_gm_opt->logfile, "a+");
if(mod_gm_opt->logfile_fp == NULL) {
perror(mod_gm_opt->logfile);
@@ -750,6 +757,12 @@
}
+/* core log wrapper */
+void write_core_log(char *data) {
+ printf("core logger is not available for worker: %s", data);
+ return;
+}
+
/* print version */
void print_version() {
printf("mod_gearman_worker: version %s running on libgearman %s\n", GM_VERSION, gearman_version());
|
[-]
[+]
|
Changed |
mod_gearman-1.0.6.tar.bz2/worker/worker_client.c
^
|
@@ -26,7 +26,6 @@
#include "common.h"
#include "worker_client.h"
#include "utils.h"
-#include "worker_logger.h"
#include "gearman.h"
char temp_buffer1[GM_BUFFERSIZE];
|
|
Deleted |
mod_gearman-1.0.tar.bz2
^
|