mod_gearman-1.4.14/0000755001161000116100000000000012241511662011043 500000000000000mod_gearman-1.4.14/contrib/0000755001161000116100000000000012212675260012506 500000000000000mod_gearman-1.4.14/contrib/gearman_proxy.pl0000644001161000116100000000777112141667303015652 00000000000000#!/usr/bin/perl # vim: expandtab:ts=4:sw=4:syntax=perl =pod =head1 NAME gearman_proxy - proxy for gearman jobs =head1 SYNOPSIS gearman_proxy [options] Options: 'c|config' defines the config file 'l|log' defines the logfile 'd|debug' enable debug output 'h' this help message =head1 DESCRIPTION This script redirects jobs from one gearmand server to another gearmand server. =head1 OPTIONS =item [B<--config> I] Specifies the path to the configfile. =item [B<--log> I] Specifies the path to the logfile. =item [B<--debug>] Enable debug logging. =head1 EXAMPLES =cut use warnings; use strict; use Gearman::Worker; use Gearman::Client; use threads; use Pod::Usage; use Getopt::Long; use Data::Dumper; our $pidFile; our $logFile; our $queues; our $debug; my $configFile; my $help; my $cfgFiles = [ '~/.gearman_proxy', '/etc/mod-gearman/gearman_proxy.cfg', ]; if(defined $ENV{OMD_ROOT}) { push @{$cfgFiles}, $ENV{OMD_ROOT}.'/etc/mod-gearman/proxy.cfg'; } GetOptions ('p|pid=s' => \$pidFile, 'l|log=s' => \$logFile, 'c|config=s' => \$configFile, 'd|debug' => \$debug, 'h' => \$help, ); pod2usage(-exitval => 1) if $help; if($configFile) { die("$configFile: $!") unless -r $configFile; $cfgFiles = [ $configFile ]; } for my $cfgFile (@{$cfgFiles}) { ($cfgFile) = glob($cfgFile); out("looking for config file in ".$cfgFile) if $debug; next unless defined $cfgFile; next unless -f $cfgFile; out("reading config file ".$cfgFile) if $debug; do "$cfgFile"; last; } my $listOfVariables = { 'pidFile' => $pidFile, 'logFile' => $logFile, 'debug' => $debug, 'queues' => $queues, 'config' => $configFile, }; out('starting...'); out('startparam:'); out($listOfVariables); if(!defined $queues or scalar keys %{$queues} == 0) { out('ERROR: no queues set!'); exit 1; } ################################################# # save pid file if($pidFile) { open(my $fhpid, ">", $pidFile) or die "open $pidFile failed: ".$!; print $fhpid $$; close($fhpid); } ################################################# # create worker my $workers = {}; for my $conf (keys %{$queues}) { my($server,$queue) = split/\//, $conf, 2; my $worker = $workers->{$server}; unless( defined $worker) { $worker = Gearman::Worker->new(job_servers => [ $server ]); $workers->{$server} = $worker; } $worker->register_function($queue => sub { forward_job($queues->{$conf}, @_) } ); } my $clients = {}; # start all worker my $threads = []; for my $worker (values %{$workers}) { push @{$threads}, threads->create('worker', $worker); } # wait till worker finish (hopefully never) for my $thr (@{$threads}) { $thr->join(); } unlink($pidFile) if $pidFile; exit; ################################################# # SUBS ################################################# sub worker { my $worker = shift; $worker->work while 1; } ################################################# sub forward_job { my($target,$job) = @_; my($server,$queue) = split/\//, $target, 2; out($job->handle." -> ".$target) if $debug; my $client = $clients->{$server}; unless( defined $client) { $client = Gearman::Client->new(job_servers => [ $server ]); $clients->{$server} = $client; } $client->dispatch_background($queue, $job->arg, { uniq => $job->handle }); return; } ################################################# sub out { my($txt) = @_; return unless defined $txt; if(ref $txt) { return(out(Dumper($txt))); } chomp($txt); my @txt = split/\n/,$txt; if($logFile) { open (my $fh, ">>", $logFile) or die "open $logFile failed: ".$!; for my $t (@txt) { print $fh localtime(time)." ".$t,"\n"; } close ($fh); } else { for my $t (@txt) { print localtime(time)." ".$t."\n"; } } return; }mod_gearman-1.4.14/contrib/mod_gearman_mini_epn.c0000755001161000116100000000630712212675260016732 00000000000000/* mini_epn.c */ #include #include #include "../include/nagios/epn_nagios.h" #define MAX_INPUT_CHARS 1024 #define P1FILE DATADIR"/mod_gearman/mod_gearman_p1.pl" static PerlInterpreter *my_perl = NULL; int run_epn(char *command_line); int main(int argc, char **argv) { struct stat stat_buf; char *p1 = P1FILE; // try fallback p1 file if(stat(P1FILE, &stat_buf) != 0 && stat("worker/mod_gearman_p1.pl", &stat_buf) == 0 ) { p1 = "worker/mod_gearman_p1.pl"; } char *embedding[] = { "", p1 }; char command_line[MAX_INPUT_CHARS]; int exitstatus; /* usage? */ if(argc > 1 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) { printf("Mod-Gearman Mini-ePN:\n"); printf("\n"); printf("Usage: %s [perl_plugin [arguments]]\n", argv[0]); printf("\n"); printf("test perl plugins as if they were run by ePN.\n"); exit(3); } if((my_perl = perl_alloc()) == NULL) { printf("%s\n", "Error: Could not allocate memory for embedded Perl interpreter!"); exit(1); } perl_construct(my_perl); exitstatus = perl_parse(my_perl, xs_init, 2, embedding, NULL); if(!exitstatus) { exitstatus = perl_run(my_perl); if(argc > 1) { int x; command_line[0] = '\0'; for(x=1; x/dev/null` if [ -f $PIDFILE ]; then kill $pid rm $PIDFILE if [ $? -eq 0 ]; then echo "OK" exit 0; else echo "failed" exit 1; fi else echo "Not running." fi ;; status) pid=`cat $PIDFILE 2>/dev/null` if [ "$pid" != "" ]; then ps -p $pid > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "$NAME is running with pid $pid" exit 0; fi fi echo "$NAME is not running" exit 1; ;; restart) $0 stop && sleep 1 && $0 start exit $? ;; *) echo "Usage: $NAME {start|stop|status|restart}" exit 1 ;; esac exit 0 mod_gearman-1.4.14/contrib/Makefile.am0000644001161000116100000000053712064652151014466 00000000000000mod_gearman_mini_epn: contrib/mod_gearman_mini_epn.c perl -MExtUtils::Embed -e xsinit $(CC) $(CFLAGS) -c perlxsi.c `perl -MExtUtils::Embed -e ccopts` $(CC) $(CFLAGS) -c contrib/mod_gearman_mini_epn.c `perl -MExtUtils::Embed -e ccopts` $(CC) $(CFLAGS) $(LDFLAGS) perlxsi.o mod_gearman_mini_epn.o `perl -MExtUtils::Embed -e ccopts -e ldopts` -o $@ mod_gearman-1.4.14/contrib/gearman_proxy.cfg0000644001161000116100000000157112141667303015766 00000000000000############################## # Gearman Proxy Config # # default is 0. # 0 gives less informations # 1 writes every datahandle into the logfile #$debug=0; # path to the logfile $logfile="var/log/gearman/proxy.log"; # defines the remote Port of the gearmand. Default is 4730 $remotePort="4730"; # defines the server where the jobs will come from $remoteHost="10.0.1.99"; # defines the server where the jobs will come from $localHost="192.168.5.5"; # defines the remote Port of the gearmand. Default is 4730 $localPort="4730"; # The queues which will be copied to the remote host $queues = { "$localHost:$localPort/hostgroup_Gearmanproxy" => "$remoteHost:$remotePort/hostgroup_Gearmanproxy", "$localHost:$localPort/hosts" => "$remoteHost:$remotePort/hosts", "$remoteHost:$remotePort/check_results" => "$localHost:$localPort/check_results", }; mod_gearman-1.4.14/contrib/README0000644001161000116100000000135312001246372013302 00000000000000Contributed Addons ================== This folder contains unsorted addons for Mod-Gearman. gearman_proxy.pl ---------------- Proxy Gearman Jobs from one jobserver to another jobserver. This could be handy, when you have a worker in a remote net and only push is allowed. Mod-Gearman <-> Gearmand <-> Gearman-Proxy <--|--> Gearmand <-> Worker Instead of the Worker polling from the master gearmand, it can now poll the jobs from a local jobserver which gets fed by the Gearman-Proxy. Written by: Sven Nierlein send_gearman.pl --------------- send_gearman.pl is a perl implementation of the send_gearman tool. You can use it to compile a windows binary and use that to send in results from windows platforms. Written by: Vincent Candeau mod_gearman-1.4.14/contrib/send_gearman.pl0000755001161000116100000000710712004617242015411 00000000000000#!/usr/bin/perl use strict; use warnings; use Nagios::Passive; use Nagios::Passive::Gearman; use Getopt::Long; ################### # Vincent CANDEAU # # Capensis - v1.0 # ################### ### Manage CLI options my($server, $encryption, $key, $host, $service, $message, $returncode, $debug, $help); my $params = GetOptions( "server=s" => \$server, # Serveur Addresse IP:PORT,IP:PORT "e|encryption" => \$encryption, # Enable Encryption "k|key=s" => \$key, # Encryption key "h|host=s" => \$host, # HostName "s|service=s" => \$service, # Service Name "m|message=s" => \$message, # Output "r|returncode=i" => \$returncode, # Return Code "d|debug" => \$debug, # Debug "help" => \$help # Display help ); ### HELP sub help { print("help:\n"); print("usage : $0 [ --server ] [ -e / --encryption [ -k / --key ] ] [ -h / --host ] [ -s / --service service name> ] [ -m / --message \"\" ][ -r / --returncode ] [ -d / --debug ] [ --help ]\n"); print("\tserver\t\tServer IP:PORT (Default: IP: 127.0.0.1 / PORT: 4730)\n"); print("\tencryption\tEnable / Disable Encryption\n"); print("\tkey\t\tEncryption passphrase\n"); print("\thost\t\tHost Name\n"); print("\tservice\t\tService Name\n"); print("\tmessage\t\tOutput message\n"); print("\treturncode\tReturn Code\n"); print("\tdebug\t\tEnable / Disable debug\n"); print("\thelp\t\tDisplay this message\n"); } ### MAIN if( not $params ) { exit(1); } elsif ( defined($help) ) { &help(); exit(0); } elsif ( !defined($host) || !defined($service) || !defined($message) || !defined($returncode) || ( defined($encryption) && ( !defined($key) ) ) ) { &help(); } else { my @server; if ( $server =~ /,/ ) { foreach my $adr ( split(',', $server) ) { if ( not $adr =~ /:/ ) { $adr = $adr.":4730"; } push( @server, $adr ); } } elsif ( ! defined($server) ) { $server = "127.0.0.1:4730"; push( @server, $server ); } else { if ( not $server =~ /:/ ){ $server = $server.":4730"; } push( @server, $server ); } if ( defined($debug) ){ print "Server: ".join(',',@server)."\n"; print "Encryption: " .(defined $encryption ? 'on' : 'off'). "\n"; print "Key: " . $key . "\n" if defined $encryption; print "Host: " . $host . "\n"; print "Service: " . $service . "\n"; print "Message: " . $message . "\n"; print "Code: " . $returncode . "\n"; } my $gearman = Gearman::Client->new; $gearman->job_servers($server); my $nw; if( !defined($key) ) { $nw = Nagios::Passive->create( gearman => $gearman, service_description => $service, check_name => $service, host_name => $host, return_code => $returncode, output => $message ); } else { $nw = Nagios::Passive->create( gearman => $gearman, key => $key, service_description => $service, check_name => $service, host_name => $host, return_code => $returncode, output => $message ); } my $job = $nw->submit; print "submitted job: ".$job."\n" if defined $debug; } mod_gearman-1.4.14/THANKS0000644001161000116100000000104411765745437011720 00000000000000Thanks to all people helping to complete and test this software Thanks to http://dnx.sourceforge.net/ for inspiration and parts of the nagios logic. Thanks to http://freecode-freecode.blogspot.com/2008/02/base64c.html for the base64 code. Thanks to http://www.efgh.com/software/rijndael.htm for the aes-256 code. Thanks to https://github.com/zorgnax/libtap for the libtap code. Thanks to www.jukie.net/bart/blog/popenRWE for the popenRWE code. Thanks to http://polarssl.org for the MD5 implementation Thanks to Tone Darrud for the nice logo mod_gearman-1.4.14/include/0000755001161000116100000000000012241503656012472 500000000000000mod_gearman-1.4.14/include/gearman_utils.h0000644001161000116100000001136512025726240015417 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** @file * @brief gearman specific utils * * @{ */ #include #include #include #include #include #include #include #include #include #include #ifdef LIBGEARMAN_1_0 #include "libgearman-1.0/gearman.h" #else #include "libgearman/gearman.h" #endif typedef void*( mod_gm_worker_fn)(gearman_job_st *job, void *context, size_t *result_size, gearman_return_t *ret_ptr); gearman_client_st *current_client; gearman_client_st *current_client_dup; gearman_job_st *current_gearman_job; int create_client( gm_server_t * server_list[GM_LISTSIZE], gearman_client_st * client); int create_client_dup( gm_server_t * server_list[GM_LISTSIZE], gearman_client_st * client); int create_worker( gm_server_t * server_list[GM_LISTSIZE], gearman_worker_st * worker); int add_job_to_queue( gearman_client_st *client, gm_server_t * server_list[GM_LISTSIZE], char * queue, char * uniq, char * data, int priority, int retries, int transport_mode, int send_now ); int worker_add_function( gearman_worker_st * worker, char * queue, gearman_worker_fn *function); void *dummy( gearman_job_st *, void *, size_t *, gearman_return_t * ); void free_client(gearman_client_st *client); void free_worker(gearman_worker_st *worker); /** function status structure */ typedef struct mod_gm_status_function { char * queue; /**< name of the queue (function name) */ int total; /**< total number of workers */ int running; /**< number of running worker */ int waiting; /**< number of waiting jobs */ int worker; /**< number of workers */ } mod_gm_status_function_t; /** worker status structure * * not used at the moment */ typedef struct mod_gm_status_worker { int fd; /**< file descriptor */ char * ip; /**< ip from this worker */ char * id; /**< id of the worker */ char * function[GM_LISTSIZE]; /**< list of functions returned from gearmand */ } mod_gm_status_worker_t; /** server status structure */ typedef struct mod_gm_status_server { mod_gm_status_worker_t * worker[GM_LISTSIZE]; /**< list of worker */ int worker_num; /**< number of worker */ mod_gm_status_function_t * function[GM_LISTSIZE]; /**< number of functions */ int function_num; /**< number of functions */ } mod_gm_server_status_t; /** * get_gearman_server_data * * return admin statistics from gearmand * * @param[out] stats - stats structure * @param[out] message - info/error message * @param[out] version - version string from server * @param[in] hostname - hostname to connect to * @param[in] port - port to connect * * @return true on success */ int get_gearman_server_data(mod_gm_server_status_t *stats, char ** message, char **version, char * hostname, int port); /** * send2gearmandadmin * * send command via gearman admin protocol * * @param[in] cmd - cmd to send * @param[in] hostname - hostname to connect to * @param[in] port - port to connect * @param[out] output - result from gearmand * @param[out] error - error message * * @return true on success */ int send2gearmandadmin(char * cmd, char * hostnam, int port, char ** output, char ** error); /** * free_mod_gm_status_server * * free status structure * * @param[in] stats - structure to free * * @return nothing */ void free_mod_gm_status_server(mod_gm_server_status_t *stats); /** * struct_cmp_by_queue * * sort gearman queues by name * * @param[in] a - structure a * @param[in] b - structure b * * @return true on success */ int struct_cmp_by_queue(const void *a, const void *b); /** * @} */ mod_gearman-1.4.14/include/popenRWE.h0000644001161000116100000000123411660503135014256 00000000000000/** * Copyright 2009-2010 Bart Trojanowski * Licensed under GPLv2, or later, at your choosing. * * bidirectional popen() call * * @param rwepipe - int array of size three * @param exe - program to run * @param argv - argument list * @return pid or -1 on error * * The caller passes in an array of three integers (rwepipe), on successful * execution it can then write to element 0 (stdin of exe), and read from * element 1 (stdout) and 2 (stderr). */ #include #include #include #include #include int popenRWE(int *rwepipe, char *command); int pcloseRWE(int pid, int *rwepipe); mod_gearman-1.4.14/include/rijndael.h0000644001161000116100000000134011540351113014337 00000000000000/** @file * @brief header for the aes encryption component * * http://www.efgh.com/software/rijndael.htm * * @{ */ #ifndef H__RIJNDAEL #define H__RIJNDAEL int rijndaelSetupEncrypt(unsigned long *rk, const unsigned char *key, int keybits); int rijndaelSetupDecrypt(unsigned long *rk, const unsigned char *key, int keybits); void rijndaelEncrypt(const unsigned long *rk, int nrounds, const unsigned char plaintext[16], unsigned char ciphertext[16]); void rijndaelDecrypt(const unsigned long *rk, int nrounds, const unsigned char ciphertext[16], unsigned char plaintext[16]); #define KEYLENGTH(keybits) ((keybits)/8) #define RKLENGTH(keybits) ((keybits)/8+28) #define NROUNDS(keybits) ((keybits)/32+6) #endif /** * @} */ mod_gearman-1.4.14/include/send_gearman.h0000644001161000116100000000525611770062655015223 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** * @file * @brief send_gearman command line utility * @addtogroup mod_gearman_send_gearman send_gearman * * command line utility to send results back to core. Replacement for send_nsca. * * @{ */ #define MOD_GM_SEND_GEARMAN #include #include #include #include #include #include #include #include "common.h" /** send_gearman * * main function of send_gearman * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return just exits */ int main (int argc, char **argv); /** * parse the arguments into the global options structure * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return TRUE on success or FALSE if not */ int parse_arguments(int argc, char **argv); /** * * print the usage and exit * * @return exits with a nagios compatible exit code */ void print_usage(void); /** * * print the version and exit * * @return exits with a nagios compatible exit code */ void print_version(void); /** * verify options structure and check for missing options * * @param[in] opt - options structure to verify * * @return TRUE on success or FALSE if something went wrong */ int verify_options(mod_gm_opt_t *opt); /** * send_result * * extract result * * @return TRUE on success or FALSE if something went wrong */ int send_result(void); /** * submit_result * * send back result as gearman job * * @return TRUE on success or FALSE if something went wrong */ int submit_result(void); /** * alarm_sighandler * * handles sig alarms * * @param[in] sig - signal number * * @return nothing */ void alarm_sighandler(int sig); /** * @} */ mod_gearman-1.4.14/include/send_multi.h0000644001161000116100000000673411700632412014730 00000000000000/****************************************************************************** * * mod_gearman - distribute checks with gearman * * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de * Copyright (c) 2010 Matthias Flacke - matthias.flacke@gmx.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 . * *****************************************************************************/ /** * @file * @brief send_multi command line utility * @addtogroup mod_gearman_send_multi send_multi * * @{ */ #define MOD_GM_SEND_MULTI #include #include #include #include #include #include #include #include #include "common.h" /** send_multi * * main function of send_multi * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return exits with a nagios compatible exit code */ int main (int argc, char **argv); /** * parse the arguments into the global options structure * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return TRUE on success or FALSE if not */ int parse_arguments(int argc, char **argv); /** * * print the usage and exit * * @return exits with a nagios compatible exit code */ void print_usage(void); /** * * print the version and exit * * @return exits with a nagios compatible exit code */ void print_version(void); /** * verify options structure and check for missing options * * @param[in] opt - options structure to verify * * @return TRUE on success or FALSE if something went wrong */ int verify_options(mod_gm_opt_t *opt); /** * send_result * * create and send back the gearman jobs * * @return TRUE on success or FALSE if something went wrong */ int send_result(void); /** * alarm_sighandler * * handles sig alarms * * @param[in] sig - signal number * * @return nothing */ void alarm_sighandler(int sig); /** * read_multi_stream * * read xml data from stream * * @param[in] stream - file pointer to read xml data from * * @return TRUE on success or FALSE if something went wrong */ int read_multi_stream(FILE *stream); /** * read_child_check * * @param[in] bufstart - start of buffer * @param[in] bufend - end of buffer * @param[in] end_time - timestruct when check is over * * @return TRUE on success or FALSE if something went wrong */ int read_child_check(char *bufstart, char *bufend, struct timeval * end_time); /** * read_multi_attribute * * @param[in] bufstart - start of buffer * @param[in] bufend - end of buffer * @param[in] attname - name of attribute to read * * @return value for this attribute */ char *read_multi_attribute(char *bufstart, char *bufend, char *attname); /** * decode_xml * * @param[in] xml - xml to decode * * @return decoded string */ char *decode_xml(char * xml); /** * @} */ mod_gearman-1.4.14/include/nagios/0000755001161000116100000000000012213031442013736 500000000000000mod_gearman-1.4.14/include/nagios/cgiutils.h.in0000644001161000116100000004342712213031442016271 00000000000000/************************************************************************ * * CGIUTILS.H - Header file for common CGI functions * Copyright (c) 1999-2008 Ethan Galstad (egalstad@nagios.org) * Last Modified: 10-15-2008 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #ifndef _CGIUTILS_H #define _CGIUTILS_H #include "objects.h" #include "cgiauth.h" #ifdef __cplusplus extern "C" { #endif /* should we compile and use the statusmap CGI? */ #undef USE_STATUSMAP /* should we compile and use the statuswrl CGI? */ #undef USE_STATUSWRL /* should we compile and use the trends CGI? */ #undef USE_TRENDS /* should we compile and use the histogram CGI? */ #undef USE_HISTOGRAM /**************************** CGI REFRESH RATE ******************************/ #define DEFAULT_REFRESH_RATE 60 /* 60 second refresh rate for CGIs */ /******************************* CGI NAMES **********************************/ #define STATUS_CGI "status.cgi" #define STATUSMAP_CGI "statusmap.cgi" #define STATUSWORLD_CGI "statuswrl.cgi" #define COMMAND_CGI "cmd.cgi" #define EXTINFO_CGI "extinfo.cgi" #define SHOWLOG_CGI "showlog.cgi" #define NOTIFICATIONS_CGI "notifications.cgi" #define HISTORY_CGI "history.cgi" #define CONFIG_CGI "config.cgi" #define OUTAGES_CGI "outages.cgi" #define TRENDS_CGI "trends.cgi" #define AVAIL_CGI "avail.cgi" #define TAC_CGI "tac.cgi" #define STATUSWML_CGI "statuswml.cgi" #define TRACEROUTE_CGI "traceroute.cgi" #define HISTOGRAM_CGI "histogram.cgi" #define CHECKSANITY_CGI "checksanity.cgi" #define MINISTATUS_CGI "ministatus.cgi" #define SUMMARY_CGI "summary.cgi" /**************************** STYLE SHEET NAMES ******************************/ #define COMMON_CSS "common.css" #define SHOWLOG_CSS "showlog.css" #define STATUS_CSS "status.css" #define STATUSMAP_CSS "statusmap.css" #define COMMAND_CSS "cmd.css" #define EXTINFO_CSS "extinfo.css" #define NOTIFICATIONS_CSS "notifications.css" #define HISTORY_CSS "history.css" #define CONFIG_CSS "config.css" #define OUTAGES_CSS "outages.css" #define TRENDS_CSS "trends.css" #define AVAIL_CSS "avail.css" #define TAC_CSS "tac.css" #define HISTOGRAM_CSS "histogram.css" #define CHECKSANITY_CSS "checksanity.css" #define MINISTATUS_CSS "ministatus.css" #define SUMMARY_CSS "summary.css" /********************************* ICONS ************************************/ #define STATUS_ICON_WIDTH 20 #define STATUS_ICON_HEIGHT 20 #define INFO_ICON "info.png" #define INFO_ICON_ALT "Informational Message" #define START_ICON "start.gif" #define START_ICON_ALT "Program Start" #define STOP_ICON "stop.gif" #define STOP_ICON_ALT "Program End" #define RESTART_ICON "restart.gif" #define RESTART_ICON_ALT "Program Restart" #define OK_ICON "recovery.png" #define OK_ICON_ALT "Service Ok" #define CRITICAL_ICON "critical.png" #define CRITICAL_ICON_ALT "Service Critical" #define WARNING_ICON "warning.png" #define WARNING_ICON_ALT "Service Warning" #define UNKNOWN_ICON "unknown.png" #define UNKNOWN_ICON_ALT "Service Unknown" #define NOTIFICATION_ICON "notify.gif" #define NOTIFICATION_ICON_ALT "Service Notification" #define LOG_ROTATION_ICON "logrotate.png" #define LOG_ROTATION_ICON_ALT "Log Rotation" #define EXTERNAL_COMMAND_ICON "command.png" #define EXTERNAL_COMMAND_ICON_ALT "External Command" #define STATUS_DETAIL_ICON "status2.gif" #define STATUS_OVERVIEW_ICON "status.gif" #define STATUSMAP_ICON "status3.gif" #define STATUSWORLD_ICON "status4.gif" #define EXTINFO_ICON "extinfo.gif" #define HISTORY_ICON "history.gif" #define CONTACTGROUP_ICON "contactgroup.gif" #define TRENDS_ICON "trends.gif" #define DISABLED_ICON "disabled.gif" #define ENABLED_ICON "enabled.gif" #define PASSIVE_ONLY_ICON "passiveonly.gif" #define NOTIFICATIONS_DISABLED_ICON "ndisabled.gif" #define ACKNOWLEDGEMENT_ICON "ack.gif" #define REMOVE_ACKNOWLEDGEMENT_ICON "noack.gif" #define COMMENT_ICON "comment.gif" #define DELETE_ICON "delete.gif" #define DELAY_ICON "delay.gif" #define DOWNTIME_ICON "downtime.gif" #define PASSIVE_ICON "passiveonly.gif" #define RIGHT_ARROW_ICON "right.gif" #define LEFT_ARROW_ICON "left.gif" #define UP_ARROW_ICON "up.gif" #define DOWN_ARROW_ICON "down.gif" #define FLAPPING_ICON "flapping.gif" #define SCHEDULED_DOWNTIME_ICON "downtime.gif" #define EMPTY_ICON "empty.gif" #define ACTIVE_ICON "active.gif" #define ACTIVE_ICON_ALT "Active Mode" #define STANDBY_ICON "standby.gif" #define STANDBY_ICON_ALT "Standby Mode" #define HOST_DOWN_ICON "critical.png" #define HOST_DOWN_ICON_ALT "Host Down" #define HOST_UNREACHABLE_ICON "critical.png" #define HOST_UNREACHABLE_ICON_ALT "Host Unreachable" #define HOST_UP_ICON "recovery.png" #define HOST_UP_ICON_ALT "Host Up" #define HOST_NOTIFICATION_ICON "notify.gif" #define HOST_NOTIFICATION_ICON_ALT "Host Notification" #define SERVICE_EVENT_ICON "serviceevent.gif" #define SERVICE_EVENT_ICON_ALT "Service Event Handler" #define HOST_EVENT_ICON "hostevent.gif" #define HOST_EVENT_ICON_ALT "Host Event Handler" #define THERM_OK_IMAGE "thermok.png" #define THERM_WARNING_IMAGE "thermwarn.png" #define THERM_CRITICAL_IMAGE "thermcrit.png" #define CONFIGURATION_ICON "config.gif" #define NOTES_ICON "notes.gif" #define ACTION_ICON "action.gif" #define DETAIL_ICON "detail.gif" #define PARENT_TRAVERSAL_ICON "parentup.gif" #define TAC_DISABLED_ICON "tacdisabled.png" #define TAC_ENABLED_ICON "tacenabled.png" #define ZOOM1_ICON "zoom1.gif" #define ZOOM2_ICON "zoom2.gif" #define CONTEXT_HELP_ICON1 "contexthelp1.gif" #define CONTEXT_HELP_ICON2 "contexthelp2.gif" #define SPLUNK_SMALL_WHITE_ICON "splunk1.gif" #define SPLUNK_SMALL_BLACK_ICON "splunk2.gif" /************************** PLUGIN RETURN VALUES ****************************/ #define STATE_OK 0 #define STATE_WARNING 1 #define STATE_CRITICAL 2 #define STATE_UNKNOWN 3 /* changed from -1 on 02/24/2001 */ /********************* EXTENDED INFO CGI DISPLAY TYPES *********************/ #define DISPLAY_PROCESS_INFO 0 #define DISPLAY_HOST_INFO 1 #define DISPLAY_SERVICE_INFO 2 #define DISPLAY_COMMENTS 3 #define DISPLAY_PERFORMANCE 4 #define DISPLAY_HOSTGROUP_INFO 5 #define DISPLAY_DOWNTIME 6 #define DISPLAY_SCHEDULING_QUEUE 7 #define DISPLAY_SERVICEGROUP_INFO 8 /************************ COMMAND CGI COMMAND MODES *************************/ #define CMDMODE_NONE 0 #define CMDMODE_REQUEST 1 #define CMDMODE_COMMIT 2 /******************** HOST AND SERVICE NOTIFICATION TYPES ******************/ #define NOTIFICATION_ALL 0 /* all service and host notifications */ #define NOTIFICATION_SERVICE_ALL 1 /* all types of service notifications */ #define NOTIFICATION_HOST_ALL 2 /* all types of host notifications */ #define NOTIFICATION_SERVICE_WARNING 4 #define NOTIFICATION_SERVICE_UNKNOWN 8 #define NOTIFICATION_SERVICE_CRITICAL 16 #define NOTIFICATION_SERVICE_RECOVERY 32 #define NOTIFICATION_HOST_DOWN 64 #define NOTIFICATION_HOST_UNREACHABLE 128 #define NOTIFICATION_HOST_RECOVERY 256 #define NOTIFICATION_SERVICE_ACK 512 #define NOTIFICATION_HOST_ACK 1024 #define NOTIFICATION_SERVICE_FLAP 2048 #define NOTIFICATION_HOST_FLAP 4096 #define NOTIFICATION_SERVICE_CUSTOM 8192 #define NOTIFICATION_HOST_CUSTOM 16384 /********************** HOST AND SERVICE ALERT TYPES **********************/ #define HISTORY_ALL 0 /* all service and host alert */ #define HISTORY_SERVICE_ALL 1 /* all types of service alerts */ #define HISTORY_HOST_ALL 2 /* all types of host alerts */ #define HISTORY_SERVICE_WARNING 4 #define HISTORY_SERVICE_UNKNOWN 8 #define HISTORY_SERVICE_CRITICAL 16 #define HISTORY_SERVICE_RECOVERY 32 #define HISTORY_HOST_DOWN 64 #define HISTORY_HOST_UNREACHABLE 128 #define HISTORY_HOST_RECOVERY 256 /****************************** SORT TYPES *******************************/ #define SORT_NONE 0 #define SORT_ASCENDING 1 #define SORT_DESCENDING 2 /***************************** SORT OPTIONS ******************************/ #define SORT_NOTHING 0 #define SORT_HOSTNAME 1 #define SORT_SERVICENAME 2 #define SORT_SERVICESTATUS 3 #define SORT_LASTCHECKTIME 4 #define SORT_CURRENTATTEMPT 5 #define SORT_STATEDURATION 6 #define SORT_NEXTCHECKTIME 7 #define SORT_HOSTSTATUS 8 /****************** HOST AND SERVICE FILTER PROPERTIES *******************/ #define HOST_SCHEDULED_DOWNTIME 1 #define HOST_NO_SCHEDULED_DOWNTIME 2 #define HOST_STATE_ACKNOWLEDGED 4 #define HOST_STATE_UNACKNOWLEDGED 8 #define HOST_CHECKS_DISABLED 16 #define HOST_CHECKS_ENABLED 32 #define HOST_EVENT_HANDLER_DISABLED 64 #define HOST_EVENT_HANDLER_ENABLED 128 #define HOST_FLAP_DETECTION_DISABLED 256 #define HOST_FLAP_DETECTION_ENABLED 512 #define HOST_IS_FLAPPING 1024 #define HOST_IS_NOT_FLAPPING 2048 #define HOST_NOTIFICATIONS_DISABLED 4096 #define HOST_NOTIFICATIONS_ENABLED 8192 #define HOST_PASSIVE_CHECKS_DISABLED 16384 #define HOST_PASSIVE_CHECKS_ENABLED 32768 #define HOST_PASSIVE_CHECK 65536 #define HOST_ACTIVE_CHECK 131072 #define HOST_HARD_STATE 262144 #define HOST_SOFT_STATE 524288 #define SERVICE_SCHEDULED_DOWNTIME 1 #define SERVICE_NO_SCHEDULED_DOWNTIME 2 #define SERVICE_STATE_ACKNOWLEDGED 4 #define SERVICE_STATE_UNACKNOWLEDGED 8 #define SERVICE_CHECKS_DISABLED 16 #define SERVICE_CHECKS_ENABLED 32 #define SERVICE_EVENT_HANDLER_DISABLED 64 #define SERVICE_EVENT_HANDLER_ENABLED 128 #define SERVICE_FLAP_DETECTION_ENABLED 256 #define SERVICE_FLAP_DETECTION_DISABLED 512 #define SERVICE_IS_FLAPPING 1024 #define SERVICE_IS_NOT_FLAPPING 2048 #define SERVICE_NOTIFICATIONS_DISABLED 4096 #define SERVICE_NOTIFICATIONS_ENABLED 8192 #define SERVICE_PASSIVE_CHECKS_DISABLED 16384 #define SERVICE_PASSIVE_CHECKS_ENABLED 32768 #define SERVICE_PASSIVE_CHECK 65536 #define SERVICE_ACTIVE_CHECK 131072 #define SERVICE_HARD_STATE 262144 #define SERVICE_SOFT_STATE 524288 /****************************** SSI TYPES ********************************/ #define SSI_HEADER 0 #define SSI_FOOTER 1 /************************ CONTEXT-SENSITIVE HELP *************************/ #define CONTEXTHELP_STATUS_DETAIL "A1" #define CONTEXTHELP_STATUS_HGOVERVIEW "A2" #define CONTEXTHELP_STATUS_HGSUMMARY "A3" #define CONTEXTHELP_STATUS_HGGRID "A4" #define CONTEXTHELP_STATUS_SVCPROBLEMS "A5" #define CONTEXTHELP_STATUS_HOST_DETAIL "A6" #define CONTEXTHELP_STATUS_HOSTPROBLEMS "A7" #define CONTEXTHELP_STATUS_SGOVERVIEW "A8" #define CONTEXTHELP_STATUS_SGSUMMARY "A9" #define CONTEXTHELP_STATUS_SGGRID "A10" #define CONTEXTHELP_TAC "B1" #define CONTEXTHELP_MAP "C1" #define CONTEXTHELP_LOG "D1" #define CONTEXTHELP_HISTORY "E1" #define CONTEXTHELP_NOTIFICATIONS "F1" #define CONTEXTHELP_TRENDS_MENU1 "G1" #define CONTEXTHELP_TRENDS_MENU2 "G2" #define CONTEXTHELP_TRENDS_MENU3 "G3" #define CONTEXTHELP_TRENDS_MENU4 "G4" #define CONTEXTHELP_TRENDS_HOST "G5" #define CONTEXTHELP_TRENDS_SERVICE "G6" #define CONTEXTHELP_AVAIL_MENU1 "H1" #define CONTEXTHELP_AVAIL_MENU2 "H2" #define CONTEXTHELP_AVAIL_MENU3 "H3" #define CONTEXTHELP_AVAIL_MENU4 "H4" #define CONTEXTHELP_AVAIL_MENU5 "H5" #define CONTEXTHELP_AVAIL_HOSTGROUP "H6" #define CONTEXTHELP_AVAIL_HOST "H7" #define CONTEXTHELP_AVAIL_SERVICE "H8" #define CONTEXTHELP_AVAIL_SERVICEGROUP "H9" #define CONTEXTHELP_EXT_HOST "I1" #define CONTEXTHELP_EXT_SERVICE "I2" #define CONTEXTHELP_EXT_HOSTGROUP "I3" #define CONTEXTHELP_EXT_PROCESS "I4" #define CONTEXTHELP_EXT_PERFORMANCE "I5" #define CONTEXTHELP_EXT_COMMENTS "I6" #define CONTEXTHELP_EXT_DOWNTIME "I7" #define CONTEXTHELP_EXT_QUEUE "I8" #define CONTEXTHELP_EXT_SERVICEGROUP "I9" #define CONTEXTHELP_CMD_INPUT "J1" #define CONTEXTHELP_CMD_COMMIT "J2" #define CONTEXTHELP_OUTAGES "K1" #define CONTEXTHELP_CONFIG_MENU "L1" #define CONTEXTHELP_CONFIG_HOSTS "L2" #define CONTEXTHELP_CONFIG_HOSTDEPENDENCIES "L3" #define CONTEXTHELP_CONFIG_HOSTESCALATIONS "L4" #define CONTEXTHELP_CONFIG_HOSTGROUPS "L5" #define CONTEXTHELP_CONFIG_HOSTGROUPESCALATIONS "L6" #define CONTEXTHELP_CONFIG_SERVICES "L7" #define CONTEXTHELP_CONFIG_SERVICEDEPENDENCIES "L8" #define CONTEXTHELP_CONFIG_SERVICEESCALATIONS "L9" #define CONTEXTHELP_CONFIG_CONTACTS "L10" #define CONTEXTHELP_CONFIG_CONTACTGROUPS "L11" #define CONTEXTHELP_CONFIG_TIMEPERIODS "L12" #define CONTEXTHELP_CONFIG_COMMANDS "L13" #define CONTEXTHELP_CONFIG_HOSTEXTINFO "L14" #define CONTEXTHELP_CONFIG_SERVICEEXTINFO "L15" #define CONTEXTHELP_CONFIG_SERVICEGROUPS "L16" #define CONTEXTHELP_HISTOGRAM_MENU1 "M1" #define CONTEXTHELP_HISTOGRAM_MENU2 "M2" #define CONTEXTHELP_HISTOGRAM_MENU3 "M3" #define CONTEXTHELP_HISTOGRAM_MENU4 "M4" #define CONTEXTHELP_HISTOGRAM_HOST "M5" #define CONTEXTHELP_HISTOGRAM_SERVICE "M6" #define CONTEXTHELP_SUMMARY_MENU "N1" #define CONTEXTHELP_SUMMARY_RECENT_ALERTS "N2" #define CONTEXTHELP_SUMMARY_ALERT_TOTALS "N3" #define CONTEXTHELP_SUMMARY_HOSTGROUP_ALERT_TOTALS "N4" #define CONTEXTHELP_SUMMARY_HOST_ALERT_TOTALS "N5" #define CONTEXTHELP_SUMMARY_SERVICE_ALERT_TOTALS "N6" #define CONTEXTHELP_SUMMARY_ALERT_PRODUCERS "N7" #define CONTEXTHELP_SUMMARY_SERVICEGROUP_ALERT_TOTALS "N8" /************************** LIFO RETURN CODES ****************************/ #define LIFO_OK 0 #define LIFO_ERROR_MEMORY 1 #define LIFO_ERROR_FILE 2 #define LIFO_ERROR_DATA 3 /*************************** DATA STRUCTURES *****************************/ /* LIFO data structure */ typedef struct lifo_struct{ char *data; struct lifo_struct *next; }lifo; /* MMAPFILE structure - used for reading files via mmap() */ typedef struct mmapfile_struct{ char *path; int mode; int fd; unsigned long file_size; unsigned long current_position; unsigned long current_line; void *mmap_buf; }mmapfile; /******************************** FUNCTIONS *******************************/ void reset_cgi_vars(void); void free_cgi_vars(void); void free_memory(void); char * get_cgi_config_location(void); /* gets location of the CGI config file to read */ char * get_cmd_file_location(void); /* gets location of external command file to write to */ int read_cgi_config_file(char *); int read_main_config_file(char *); int read_all_object_configuration_data(char *,int); int read_all_status_data(char *,int); int hashfunc(const char *name1, const char *name2, int hashslots); int compare_hashdata(const char *,const char *,const char *,const char *); void strip(char *); /* strips newlines, carriage returns, and spaces from end of buffer */ char *unescape_newlines(char *); void sanitize_plugin_output(char *); /* strips HTML and bad characters from plugin output */ void strip_html_brackets(char *); /* strips > and < from string */ int process_macros(char *,char **,int); /* processes macros in a string */ void get_time_string(time_t *,char *,int,int); /* gets a date/time string */ void get_datetime_string(time_t *,char *,int,int); void get_interval_time_string(double,char *,int); /* gets a time string for an interval of time */ void get_expire_time_string(time_t *,char *,int); /* gets a date/time string in the format used for Expire: tags*/ char * my_strtok(char *,char *); /* replacement for strtok() function - doesn't skip multiple tokens */ char * my_strsep (char **, const char *); #ifdef REMOVED_10182007 int my_free(void **); /* my wrapper for free() */ #endif char * url_encode(char *); /* encodes a string in proper URL format */ char * html_encode(char *,int); /* encodes a string in HTML format (for what the user sees) */ char * escape_string(char *); /* escape string for html form usage */ void get_time_breakdown(unsigned long,int *,int *,int *,int *); /* given total seconds, get days, hours, minutes, seconds */ void get_log_archive_to_use(int,char *,int); /* determines the name of the log archive to use */ void determine_log_rotation_times(int); int determine_archive_to_use_from_time(time_t); void print_extra_hostgroup_url(char *,char *); void print_extra_servicegroup_url(char *,char *); void display_info_table(char *,int,authdata *); void display_nav_table(char *,int); void display_splunk_host_url(host *); void display_splunk_service_url(service *); void display_splunk_generic_url(char *,int); void strip_splunk_query_terms(char *); void include_ssi_files(char *,int); /* include user-defined SSI footers/headers */ void include_ssi_file(char *); /* include user-defined SSI footer/header */ void cgi_config_file_error(char *); void main_config_file_error(char *); void object_data_error(void); void status_data_error(void); void display_context_help(char *); /* displays context-sensitive help window */ int read_file_into_lifo(char *); /* LIFO functions */ void free_lifo_memory(void); int push_lifo(char *); char *pop_lifo(void); mmapfile *mmap_fopen(char *); /* open a file read-only using mmap() */ int mmap_fclose(mmapfile *); char *mmap_fgets(mmapfile *); char *mmap_fgets_multiline(mmapfile *); #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/downtime.h0000644001161000116100000000727112213031442015664 00000000000000/***************************************************************************** * * DOWNTIME.H - Header file for scheduled downtime functions * * Copyright (c) 2001-2005 Ethan Galstad (egalstad@nagios.org) * Last Modified: 11-25-2005 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _DOWNTIME_H #define _DOWNTIME_H #include "config.h" #include "common.h" #include "objects.h" #ifdef __cplusplus extern "C" { #endif /* SCHEDULED_DOWNTIME_ENTRY structure */ typedef struct scheduled_downtime_struct{ int type; char *host_name; char *service_description; time_t entry_time; time_t start_time; time_t end_time; int fixed; unsigned long triggered_by; unsigned long duration; unsigned long downtime_id; char *author; char *comment; #ifdef NSCORE unsigned long comment_id; int is_in_effect; int start_flex_downtime; int incremented_pending_downtime; #endif struct scheduled_downtime_struct *next; }scheduled_downtime; #ifdef NSCORE int initialize_downtime_data(char *); /* initializes scheduled downtime data */ int cleanup_downtime_data(char *); /* cleans up scheduled downtime data */ int add_new_downtime(int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *); int add_new_host_downtime(char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *); int add_new_service_downtime(char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *); int delete_host_downtime(unsigned long); int delete_service_downtime(unsigned long); int delete_downtime(int,unsigned long); int schedule_downtime(int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *); int unschedule_downtime(int,unsigned long); int register_downtime(int,unsigned long); int handle_scheduled_downtime(scheduled_downtime *); int handle_scheduled_downtime_by_id(unsigned long); int check_pending_flex_host_downtime(host *); int check_pending_flex_service_downtime(service *); int check_for_expired_downtime(void); #endif int add_host_downtime(char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long); int add_service_downtime(char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long); /* If you are going to be adding a lot of downtime in sequence, set defer_downtime_sorting to 1 before you start and then call sort_downtime afterwards. Things will go MUCH faster. */ extern int defer_downtime_sorting; int add_downtime(int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long); int sort_downtime(void); scheduled_downtime *find_downtime(int,unsigned long); scheduled_downtime *find_host_downtime(unsigned long); scheduled_downtime *find_service_downtime(unsigned long); void free_downtime_data(void); /* frees memory allocated to scheduled downtime list */ #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/nebstructs.h0000644001161000116100000003312612213031442016230 00000000000000/***************************************************************************** * * NEBSTRUCTS.H - Event broker includes for Nagios * * Copyright (c) 2003-2007 Ethan Galstad (egalstad@nagios.org) * Last Modified: 10-28-2007 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _NEBSTRUCTS_H #define _NEBSTRUCTS_H #include "config.h" #include "objects.h" #include "nagios.h" #ifdef __cplusplus extern "C" { #endif /****** STRUCTURES *************************/ /* process data structure */ typedef struct nebstruct_process_struct{ int type; int flags; int attr; struct timeval timestamp; }nebstruct_process_data; /* timed event data structure */ typedef struct nebstruct_timed_event_struct{ int type; int flags; int attr; struct timeval timestamp; int event_type; int recurring; time_t run_time; void *event_data; void *event_ptr; }nebstruct_timed_event_data; /* log data structure */ typedef struct nebstruct_log_struct{ int type; int flags; int attr; struct timeval timestamp; time_t entry_time; int data_type; char *data; }nebstruct_log_data; /* system command structure */ typedef struct nebstruct_system_command_struct{ int type; int flags; int attr; struct timeval timestamp; struct timeval start_time; struct timeval end_time; int timeout; char *command_line; int early_timeout; double execution_time; int return_code; char *output; }nebstruct_system_command_data; /* event handler structure */ typedef struct nebstruct_event_handler_struct{ int type; int flags; int attr; struct timeval timestamp; int eventhandler_type; char *host_name; char *service_description; int state_type; int state; int timeout; char *command_name; char *command_args; char *command_line; struct timeval start_time; struct timeval end_time; int early_timeout; double execution_time; int return_code; char *output; void *object_ptr; }nebstruct_event_handler_data; /* host check structure */ typedef struct nebstruct_host_check_struct{ int type; int flags; int attr; struct timeval timestamp; char *host_name; int current_attempt; int check_type; int max_attempts; int state_type; int state; int timeout; char *command_name; char *command_args; char *command_line; struct timeval start_time; struct timeval end_time; int early_timeout; double execution_time; double latency; int return_code; char *output; char *long_output; char *perf_data; void *object_ptr; }nebstruct_host_check_data; /* service check structure */ typedef struct nebstruct_service_check_struct{ int type; int flags; int attr; struct timeval timestamp; char *host_name; char *service_description; int check_type; int current_attempt; int max_attempts; int state_type; int state; int timeout; char *command_name; char *command_args; char *command_line; struct timeval start_time; struct timeval end_time; int early_timeout; double execution_time; double latency; int return_code; char *output; char *long_output; char *perf_data; void *object_ptr; }nebstruct_service_check_data; /* comment data structure */ typedef struct nebstruct_comment_struct{ int type; int flags; int attr; struct timeval timestamp; int comment_type; char *host_name; char *service_description; time_t entry_time; char *author_name; char *comment_data; int persistent; int source; int entry_type; int expires; time_t expire_time; unsigned long comment_id; void *object_ptr; /* not implemented yet */ }nebstruct_comment_data; /* downtime data structure */ typedef struct nebstruct_downtime_struct{ int type; int flags; int attr; struct timeval timestamp; int downtime_type; char *host_name; char *service_description; time_t entry_time; char *author_name; char *comment_data; time_t start_time; time_t end_time; int fixed; unsigned long duration; unsigned long triggered_by; unsigned long downtime_id; void *object_ptr; /* not implemented yet */ }nebstruct_downtime_data; /* flapping data structure */ typedef struct nebstruct_flapping_struct{ int type; int flags; int attr; struct timeval timestamp; int flapping_type; char *host_name; char *service_description; double percent_change; double high_threshold; double low_threshold; unsigned long comment_id; void *object_ptr; }nebstruct_flapping_data; /* program status structure */ typedef struct nebstruct_program_status_struct{ int type; int flags; int attr; struct timeval timestamp; time_t program_start; int pid; int daemon_mode; time_t last_command_check; time_t last_log_rotation; int notifications_enabled; int active_service_checks_enabled; int passive_service_checks_enabled; int active_host_checks_enabled; int passive_host_checks_enabled; int event_handlers_enabled; int flap_detection_enabled; int failure_prediction_enabled; int process_performance_data; int obsess_over_hosts; int obsess_over_services; unsigned long modified_host_attributes; unsigned long modified_service_attributes; char *global_host_event_handler; char *global_service_event_handler; }nebstruct_program_status_data; /* host status structure */ typedef struct nebstruct_host_status_struct{ int type; int flags; int attr; struct timeval timestamp; void *object_ptr; }nebstruct_host_status_data; /* service status structure */ typedef struct nebstruct_service_status_struct{ int type; int flags; int attr; struct timeval timestamp; void *object_ptr; }nebstruct_service_status_data; /* contact status structure */ typedef struct nebstruct_contact_status_struct{ int type; int flags; int attr; struct timeval timestamp; void *object_ptr; }nebstruct_contact_status_data; /* notification data structure */ typedef struct nebstruct_notification_struct{ int type; int flags; int attr; struct timeval timestamp; int notification_type; struct timeval start_time; struct timeval end_time; char *host_name; char *service_description; int reason_type; int state; char *output; char *ack_author; char *ack_data; int escalated; int contacts_notified; void *object_ptr; }nebstruct_notification_data; /* contact notification data structure */ typedef struct nebstruct_contact_notification_struct{ int type; int flags; int attr; struct timeval timestamp; int notification_type; struct timeval start_time; struct timeval end_time; char *host_name; char *service_description; char *contact_name; int reason_type; int state; char *output; char *ack_author; char *ack_data; int escalated; void *object_ptr; void *contact_ptr; }nebstruct_contact_notification_data; /* contact notification method data structure */ typedef struct nebstruct_contact_notification_method_struct{ int type; int flags; int attr; struct timeval timestamp; int notification_type; struct timeval start_time; struct timeval end_time; char *host_name; char *service_description; char *contact_name; char *command_name; char *command_args; int reason_type; int state; char *output; char *ack_author; char *ack_data; int escalated; void *object_ptr; void *contact_ptr; }nebstruct_contact_notification_method_data; /* adaptive program data structure */ typedef struct nebstruct_adaptive_program_data_struct{ int type; int flags; int attr; struct timeval timestamp; int command_type; unsigned long modified_host_attribute; unsigned long modified_host_attributes; unsigned long modified_service_attribute; unsigned long modified_service_attributes; }nebstruct_adaptive_program_data; /* adaptive host data structure */ typedef struct nebstruct_adaptive_host_data_struct{ int type; int flags; int attr; struct timeval timestamp; int command_type; unsigned long modified_attribute; unsigned long modified_attributes; void *object_ptr; }nebstruct_adaptive_host_data; /* adaptive service data structure */ typedef struct nebstruct_adaptive_service_data_struct{ int type; int flags; int attr; struct timeval timestamp; int command_type; unsigned long modified_attribute; unsigned long modified_attributes; void *object_ptr; }nebstruct_adaptive_service_data; /* adaptive contact data structure */ typedef struct nebstruct_adaptive_contact_data_struct{ int type; int flags; int attr; struct timeval timestamp; int command_type; unsigned long modified_attribute; unsigned long modified_attributes; unsigned long modified_host_attribute; unsigned long modified_host_attributes; unsigned long modified_service_attribute; unsigned long modified_service_attributes; void *object_ptr; }nebstruct_adaptive_contact_data; /* external command data structure */ typedef struct nebstruct_external_command_struct{ int type; int flags; int attr; struct timeval timestamp; int command_type; time_t entry_time; char *command_string; char *command_args; }nebstruct_external_command_data; /* aggregated status data structure */ typedef struct nebstruct_aggregated_status_struct{ int type; int flags; int attr; struct timeval timestamp; }nebstruct_aggregated_status_data; /* retention data structure */ typedef struct nebstruct_retention_struct{ int type; int flags; int attr; struct timeval timestamp; }nebstruct_retention_data; /* acknowledgement structure */ typedef struct nebstruct_acknowledgement_struct{ int type; int flags; int attr; struct timeval timestamp; int acknowledgement_type; char *host_name; char *service_description; int state; char *author_name; char *comment_data; int is_sticky; int persistent_comment; int notify_contacts; void *object_ptr; }nebstruct_acknowledgement_data; /* state change structure */ typedef struct nebstruct_statechange_struct{ int type; int flags; int attr; struct timeval timestamp; int statechange_type; char *host_name; char *service_description; int state; int state_type; int current_attempt; int max_attempts; char *output; void *object_ptr; }nebstruct_statechange_data; #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/nebmodules.h0000644001161000116100000000562312213031442016172 00000000000000/***************************************************************************** * * NEBMODULES.H - Include file for event broker modules * * Copyright (c) 2002-2006 Ethan Galstad (egalstad@nagios.org) * Last Modified: 02-27-2006 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _NEBMODULES_H #define _NEBMODULES_H #ifdef __cplusplus extern "C" { #endif /***** MODULE VERSION INFORMATION *****/ #define NEB_API_VERSION(x) int __neb_api_version = x; #define CURRENT_NEB_API_VERSION 3 /***** MODULE INFORMATION *****/ #define NEBMODULE_MODINFO_NUMITEMS 6 #define NEBMODULE_MODINFO_TITLE 0 #define NEBMODULE_MODINFO_AUTHOR 1 #define NEBMODULE_MODINFO_COPYRIGHT 2 #define NEBMODULE_MODINFO_VERSION 3 #define NEBMODULE_MODINFO_LICENSE 4 #define NEBMODULE_MODINFO_DESC 5 /***** MODULE LOAD/UNLOAD OPTIONS *****/ #define NEBMODULE_NORMAL_LOAD 0 /* module is being loaded normally */ #define NEBMODULE_REQUEST_UNLOAD 0 /* request module to unload (but don't force it) */ #define NEBMODULE_FORCE_UNLOAD 1 /* force module to unload */ /***** MODULES UNLOAD REASONS *****/ #define NEBMODULE_NEB_SHUTDOWN 1 /* event broker is shutting down */ #define NEBMODULE_NEB_RESTART 2 /* event broker is restarting */ #define NEBMODULE_ERROR_NO_INIT 3 /* _module_init() function was not found in module */ #define NEBMODULE_ERROR_BAD_INIT 4 /* _module_init() function returned a bad code */ #define NEBMODULE_ERROR_API_VERSION 5 /* module version is incompatible with current api */ /***** MODULE STRUCTURES *****/ /* NEB module structure */ typedef struct nebmodule_struct{ char *filename; char *args; char *info[NEBMODULE_MODINFO_NUMITEMS]; int should_be_loaded; int is_currently_loaded; #ifdef USE_LTDL lt_dlhandle module_handle; lt_ptr init_func; lt_ptr deinit_func; #else void *module_handle; void *init_func; void *deinit_func; #endif #ifdef HAVE_PTHREAD_H pthread_t thread_id; #endif struct nebmodule_struct *next; }nebmodule; /***** MODULE FUNCTIONS *****/ int neb_set_module_info(void *,int,char *); #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/skiplist.h0000644001161000116100000000463312213031442015677 00000000000000/************************************************************************ * * SKIPLIST.H - Skiplist data structures and functions * * Copyright (c) 2008 Ethan Galstad * Last Modified: 02-24-2008 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #ifndef _SKIPLIST_H #define _SKIPLIST_H #define SKIPLIST_OK 0 #define SKIPLIST_ERROR_ARGS 1 #define SKIPLIST_ERROR_MEMORY 2 #define SKIPLIST_ERROR_DUPLICATE 3 typedef struct skiplistnode_struct{ void *data; struct skiplistnode_struct *forward[1]; /* this must be the last element of the struct, as we allocate # of elements during runtime*/ }skiplistnode; typedef struct skiplist_struct{ int current_level; int max_levels; float level_probability; unsigned long items; int allow_duplicates; int append_duplicates; int (*compare_function)(void *,void *); skiplistnode *head; }skiplist; skiplist *skiplist_new(int max_levels, float level_probability, int allow_duplicates, int append_duplicates, int (*compare_function)(void *,void *)); skiplistnode *skiplist_new_node(skiplist *list,int node_levels); int skiplist_insert(skiplist *list, void *data); int skiplist_random_level(skiplist *list); int skiplist_empty(skiplist *list); int skiplist_free(skiplist **list); void *skiplist_peek(skiplist *); void *skiplist_pop(skiplist *); void *skiplist_get_first(skiplist *list, void **node_ptr); void *skiplist_get_next(void **node_ptr); void *skiplist_find_first(skiplist *list, void *data, void **node_ptr); void *skiplist_find_next(skiplist *list, void *data, void **node_ptr); int skiplist_delete(skiplist *list, void *data); int skiplist_delete_first(skiplist *list, void *data); int skiplist_delete_all(skiplist *list, void *data); int skiplist_delete_node(skiplist *list, void *node_ptr); #endif mod_gearman-1.4.14/include/nagios/locations.h.in0000644001161000116100000000435412213031442016435 00000000000000/************************************************************************ * * Nagios Locations Header File * Written By: Ethan Galstad (egalstad@nagios.org) * Last Modified: 04-30-2007 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #define DEFAULT_TEMP_FILE "@localstatedir@/tempfile" #define DEFAULT_TEMP_PATH "/tmp" #define DEFAULT_CHECK_RESULT_PATH "@localstatedir@/spool/checkresults" #define DEFAULT_STATUS_FILE "@localstatedir@/status.dat" #define DEFAULT_LOG_FILE "@localstatedir@/nagios.log" #define DEFAULT_LOG_ARCHIVE_PATH "@localstatedir@/archives/" #define DEFAULT_DEBUG_FILE "@localstatedir@/nagios.debug" #define DEFAULT_COMMENT_FILE "@localstatedir@/comments.dat" #define DEFAULT_DOWNTIME_FILE "@localstatedir@/downtime.dat" #define DEFAULT_RETENTION_FILE "@localstatedir@/retention.dat" #define DEFAULT_COMMAND_FILE "@localstatedir@/rw/nagios.cmd" #define DEFAULT_CONFIG_FILE "@sysconfdir@/nagios.cfg" #define DEFAULT_PHYSICAL_HTML_PATH "@datadir@" #define DEFAULT_URL_HTML_PATH "@htmurl@" #define DEFAULT_PHYSICAL_CGIBIN_PATH "@sbindir@" #define DEFAULT_URL_CGIBIN_PATH "@cgiurl@" #define DEFAULT_CGI_CONFIG_FILE "@sysconfdir@/cgi.cfg" #define DEFAULT_LOCK_FILE "@lockfile@" #define DEFAULT_OBJECT_CACHE_FILE "@localstatedir@/objects.cache" #define DEFAULT_PRECACHED_OBJECT_FILE "@localstatedir@/objects.precache" #define DEFAULT_EVENT_BROKER_FILE "@localstatedir@/broker.socket" #define DEFAULT_P1_FILE "@bindir@/p1.pl" /**** EMBEDDED PERL ****/ #define DEFAULT_AUTH_FILE "" /**** EMBEDDED PERL - IS THIS USED? ****/ mod_gearman-1.4.14/include/nagios/config.h.in0000644001161000116100000001402212213031442015700 00000000000000/************************************************************************ * * Nagios Config Header File * Written By: Ethan Galstad (egalstad@nagios.org) * Last Modified: 11-02-2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ /***** NAGIOS STUFF *****/ #define DEFAULT_NAGIOS_USER nagios #define DEFAULT_NAGIOS_GROUP nagios /* stop gcc from bitching about implicit asprintf declarations */ #define _GNU_SOURCE 1 /* Event broker integration */ #undef USE_EVENT_BROKER /* Embed a PERL interpreter into Nagios with optional cache for compiled code (contributed by Stephen Davies) */ #undef EMBEDDEDPERL #undef THREADEDPERL /* 0 = cache, 1 = do not cache */ #define DO_CLEAN "1" /* commands used by CGIs */ #undef TRACEROUTE_COMMAND #undef PING_COMMAND #undef PING_PACKETS_FIRST /* Debugging options */ /* function entry and exit */ #undef DEBUG0 /* general info messages */ #undef DEBUG1 /* warning messages */ #undef DEBUG2 /* service and host checks, other events */ #undef DEBUG3 /* service and host notifications */ #undef DEBUG4 /* SQL queries (defunct) */ #undef DEBUG5 /* I/O implementations */ #undef USE_XSDDEFAULT #undef USE_XCDDEFAULT #undef USE_XRDDEFAULT #undef USE_XODTEMPLATE #undef USE_XPDDEFAULT #undef USE_XDDDEFAULT /***** FUNCTION DEFINITIONS *****/ #undef HAVE_SETENV #undef HAVE_UNSETENV #undef HAVE_SOCKET #undef HAVE_STRDUP #undef HAVE_STRSTR #undef HAVE_STRTOUL #undef HAVE_INITGROUPS #undef HAVE_GETLOADAVG #undef HAVE_GDIMAGECREATETRUECOLOR /***** ASPRINTF() AND FRIENDS *****/ #undef HAVE_VSNPRINTF #undef HAVE_SNPRINTF #undef HAVE_ASPRINTF #undef HAVE_VASPRINTF #undef HAVE_C99_VSNPRINTF #undef HAVE_VA_COPY #undef HAVE___VA_COPY /***** MISC DEFINITIONS *****/ #undef USE_NANOSLEEP #undef STDC_HEADERS #undef HAVE_TM_ZONE #undef HAVE_TZNAME #undef USE_PROC #define SOCKET_SIZE_TYPE "" #define GETGROUPS_T "" #define RETSIGTYPE "" /***** HEADER FILES *****/ #include #include /* needed for the time_t structures we use later... */ /* this include must come before sys/resource.h or we can have problems on some OSes */ #undef TIME_WITH_SYS_TIME #undef HAVE_SYS_TIME_H #if TIME_WITH_SYS_TIME #include #include #else #if HAVE_SYS_TIME_H #include #else #include #endif #endif #undef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H #include #endif #undef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H #include #endif #undef HAVE_PWD_H #ifdef HAVE_PWD_H #include #endif #undef HAVE_GRP_H #ifdef HAVE_GRP_H #include #endif #undef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H #include #endif #undef HAVE_STRING_H #ifdef HAVE_STRINGS_H #include #endif #undef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H #include #endif #undef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H #include #endif #undef HAVE_SIGNAL_H #ifdef HAVE_SIGNAL_H #include #endif #undef HAVE_SYS_STAT_H #ifdef HAVE_SYS_STAT_H #include #endif #undef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H #include #endif #undef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H #include #endif #undef HAVE_STDARG_H #ifdef HAVE_STDARG_H #include #endif #undef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H #include #endif #undef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H #include #endif #undef HAVE_ERRNO_H #ifdef HAVE_ERRNO_H #include #endif #undef HAVE_SYS_TIMEB_H #if HAVE_SYS_TIMEB_H #include #endif #undef HAVE_SYS_IPC_H #ifdef HAVE_SYS_IPC_H #include #endif #undef HAVE_SYS_MSG_H #ifdef HAVE_SYS_MSG_H #include #endif #undef HAVE_MATH_H #ifdef HAVE_MATH_H #include #endif #undef HAVE_CTYPE_H #ifdef HAVE_CTYPE_H #include #endif #undef HAVE_DIRENT_H #ifdef HAVE_DIRENT_H #include #endif #undef HAVE_PTHREAD_H #ifdef HAVE_PTHREAD_H #include #endif #undef HAVE_REGEX_H #ifdef HAVE_REGEX_H #include #undef HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H #include #endif #undef HAVE_SOCKET #ifdef HAVE_SOCKET_H #include #endif #undef HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H #include #endif #undef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H #include #endif #undef HAVE_NETDB_H #ifdef HAVE_NETDB_H #include #endif #undef HAVE_LIBGEN_H #ifdef HAVE_LIBGEN_H #include #endif #undef HAVE_SYS_UN_H #ifdef HAVE_SYS_UN_H #include #endif #undef HAVE_SYS_POLL_H #ifdef HAVE_SYS_POLL_H #include #endif #undef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H #include #endif #undef HAVE_LINUX_MODULE_H #ifdef HAVE_LINUX_MODULE_H #include #endif /* configure script should allow user to override ltdl choice, but this will do for now... */ #undef USE_LTDL #undef HAVE_LTDL_H #ifdef HAVE_LTDL_H #define USE_LTDL #endif #ifdef USE_LTDL #include #else #undef HAVE_DLFCN_H #ifdef HAVE_DLFCN_H #include #endif #endif /* moved to end to prevent AIX compiler warnings */ #ifndef RTLD_GLOBAL #define RTLD_GLOBAL 0 #endif #ifndef RTLD_NOW #define RTLD_NOW 0 #endif /***** MARO DEFINITIONS *****/ /* this needs to come after all system include files, so we don't accidentally attempt to redefine it */ #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #endif mod_gearman-1.4.14/include/nagios/comments.h0000644001161000116100000001246212213031442015661 00000000000000/***************************************************************************** * * COMMENTS.H - Header file for comment functions * * Copyright (c) 1999-2006 Ethan Galstad (egalstad@nagios.org) * Last Modified: 12-26-2006 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _COMMENTS_H #define _COMMENTS_H #include "config.h" #include "common.h" #include "objects.h" #ifdef __cplusplus extern "C" { #endif /**************************** COMMENT SOURCES ******************************/ #define COMMENTSOURCE_INTERNAL 0 #define COMMENTSOURCE_EXTERNAL 1 /***************************** COMMENT TYPES *******************************/ #define HOST_COMMENT 1 #define SERVICE_COMMENT 2 /****************************** ENTRY TYPES ********************************/ #define USER_COMMENT 1 #define DOWNTIME_COMMENT 2 #define FLAPPING_COMMENT 3 #define ACKNOWLEDGEMENT_COMMENT 4 /*************************** CHAINED HASH LIMITS ***************************/ #define COMMENT_HASHSLOTS 1024 /**************************** DATA STRUCTURES ******************************/ /* COMMENT structure */ typedef struct comment_struct{ int comment_type; int entry_type; unsigned long comment_id; int source; int persistent; time_t entry_time; int expires; time_t expire_time; char *host_name; char *service_description; char *author; char *comment_data; struct comment_struct *next; struct comment_struct *nexthash; }comment; #ifdef NSCORE int initialize_comment_data(char *); /* initializes comment data */ int cleanup_comment_data(char *); /* cleans up comment data */ int add_new_comment(int,int,char *,char *,time_t,char *,char *,int,int,int,time_t,unsigned long *); /* adds a new host or service comment */ int add_new_host_comment(int,char *,time_t,char *,char *,int,int,int,time_t,unsigned long *); /* adds a new host comment */ int add_new_service_comment(int,char *,char *,time_t,char *,char *,int,int,int,time_t,unsigned long *); /* adds a new service comment */ int delete_comment(int,unsigned long); /* deletes a host or service comment */ int delete_host_comment(unsigned long); /* deletes a host comment */ int delete_service_comment(unsigned long); /* deletes a service comment */ int delete_all_comments(int,char *,char *); /* deletes all comments for a particular host or service */ int delete_all_host_comments(char *); /* deletes all comments for a specific host */ int delete_host_acknowledgement_comments(host *); /* deletes all non-persistent ack comments for a specific host */ int delete_all_service_comments(char *,char *); /* deletes all comments for a specific service */ int delete_service_acknowledgement_comments(service *); /* deletes all non-persistent ack comments for a specific service */ int check_for_expired_comment(unsigned long); /* expires a comment */ #endif comment *find_comment(unsigned long,int); /* finds a specific comment */ comment *find_service_comment(unsigned long); /* finds a specific service comment */ comment *find_host_comment(unsigned long); /* finds a specific host comment */ comment *get_first_comment_by_host(char *); comment *get_next_comment_by_host(char *,comment *); int number_of_host_comments(char *); /* returns the number of comments associated with a particular host */ int number_of_service_comments(char *, char *); /* returns the number of comments associated with a particular service */ /* If you are going to be adding a lot of comments in sequence, set defer_comment_sorting to 1 before you start and then call sort_comments afterwards. Things will go MUCH faster. */ extern int defer_comment_sorting; int add_comment(int,int,char *,char *,time_t,char *,char *,unsigned long,int,int,time_t,int); /* adds a comment (host or service) */ int sort_comments(void); int add_host_comment(int,char *,time_t,char *,char *,unsigned long,int,int,time_t,int); /* adds a host comment */ int add_service_comment(int,char *,char *,time_t,char *,char *,unsigned long,int,int,time_t,int); /* adds a service comment */ int add_comment_to_hashlist(comment *); void free_comment_data(void); /* frees memory allocated to the comment list */ #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/broker.h0000644001161000116100000002434112213031442015317 00000000000000/***************************************************************************** * * BROKER.H - Event broker includes for Nagios * * Copyright (c) 2002-2006 Ethan Galstad (egalstad@nagios.org) * Last Modified: 12-12-2006 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _BROKER_H #define _BROKER_H #include "config.h" #include "nagios.h" #ifdef __cplusplus extern "C" { #endif /*************** EVENT BROKER OPTIONS *****************/ #define BROKER_NOTHING 0 #define BROKER_EVERYTHING 1048575 #define BROKER_PROGRAM_STATE 1 /* DONE */ #define BROKER_TIMED_EVENTS 2 /* DONE */ #define BROKER_SERVICE_CHECKS 4 /* DONE */ #define BROKER_HOST_CHECKS 8 /* DONE */ #define BROKER_EVENT_HANDLERS 16 /* DONE */ #define BROKER_LOGGED_DATA 32 /* DONE */ #define BROKER_NOTIFICATIONS 64 /* DONE */ #define BROKER_FLAPPING_DATA 128 /* DONE */ #define BROKER_COMMENT_DATA 256 /* DONE */ #define BROKER_DOWNTIME_DATA 512 /* DONE */ #define BROKER_SYSTEM_COMMANDS 1024 /* DONE */ #define BROKER_OCP_DATA 2048 /* DONE */ #define BROKER_STATUS_DATA 4096 /* DONE */ #define BROKER_ADAPTIVE_DATA 8192 /* DONE */ #define BROKER_EXTERNALCOMMAND_DATA 16384 /* DONE */ #define BROKER_RETENTION_DATA 32768 /* DONE */ #define BROKER_ACKNOWLEDGEMENT_DATA 65536 #define BROKER_STATECHANGE_DATA 131072 #define BROKER_RESERVED18 262144 #define BROKER_RESERVED19 524288 /****** EVENT TYPES ************************/ #define NEBTYPE_NONE 0 #define NEBTYPE_HELLO 1 #define NEBTYPE_GOODBYE 2 #define NEBTYPE_INFO 3 #define NEBTYPE_PROCESS_START 100 #define NEBTYPE_PROCESS_DAEMONIZE 101 #define NEBTYPE_PROCESS_RESTART 102 #define NEBTYPE_PROCESS_SHUTDOWN 103 #define NEBTYPE_PROCESS_PRELAUNCH 104 /* before objects are read or verified */ #define NEBTYPE_PROCESS_EVENTLOOPSTART 105 #define NEBTYPE_PROCESS_EVENTLOOPEND 106 #define NEBTYPE_TIMEDEVENT_ADD 200 #define NEBTYPE_TIMEDEVENT_REMOVE 201 #define NEBTYPE_TIMEDEVENT_EXECUTE 202 #define NEBTYPE_TIMEDEVENT_DELAY 203 /* NOT IMPLEMENTED */ #define NEBTYPE_TIMEDEVENT_SKIP 204 /* NOT IMPLEMENTED */ #define NEBTYPE_TIMEDEVENT_SLEEP 205 #define NEBTYPE_LOG_DATA 300 #define NEBTYPE_LOG_ROTATION 301 #define NEBTYPE_SYSTEM_COMMAND_START 400 #define NEBTYPE_SYSTEM_COMMAND_END 401 #define NEBTYPE_EVENTHANDLER_START 500 #define NEBTYPE_EVENTHANDLER_END 501 #define NEBTYPE_NOTIFICATION_START 600 #define NEBTYPE_NOTIFICATION_END 601 #define NEBTYPE_CONTACTNOTIFICATION_START 602 #define NEBTYPE_CONTACTNOTIFICATION_END 603 #define NEBTYPE_CONTACTNOTIFICATIONMETHOD_START 604 #define NEBTYPE_CONTACTNOTIFICATIONMETHOD_END 605 #define NEBTYPE_SERVICECHECK_INITIATE 700 #define NEBTYPE_SERVICECHECK_PROCESSED 701 #define NEBTYPE_SERVICECHECK_RAW_START 702 /* NOT IMPLEMENTED */ #define NEBTYPE_SERVICECHECK_RAW_END 703 /* NOT IMPLEMENTED */ #define NEBTYPE_SERVICECHECK_ASYNC_PRECHECK 704 #define NEBTYPE_HOSTCHECK_INITIATE 800 /* a check of the route to the host has been initiated */ #define NEBTYPE_HOSTCHECK_PROCESSED 801 /* the processed/final result of a host check */ #define NEBTYPE_HOSTCHECK_RAW_START 802 /* the start of a "raw" host check */ #define NEBTYPE_HOSTCHECK_RAW_END 803 /* a finished "raw" host check */ #define NEBTYPE_HOSTCHECK_ASYNC_PRECHECK 804 #define NEBTYPE_HOSTCHECK_SYNC_PRECHECK 805 #define NEBTYPE_COMMENT_ADD 900 #define NEBTYPE_COMMENT_DELETE 901 #define NEBTYPE_COMMENT_LOAD 902 #define NEBTYPE_FLAPPING_START 1000 #define NEBTYPE_FLAPPING_STOP 1001 #define NEBTYPE_DOWNTIME_ADD 1100 #define NEBTYPE_DOWNTIME_DELETE 1101 #define NEBTYPE_DOWNTIME_LOAD 1102 #define NEBTYPE_DOWNTIME_START 1103 #define NEBTYPE_DOWNTIME_STOP 1104 #define NEBTYPE_PROGRAMSTATUS_UPDATE 1200 #define NEBTYPE_HOSTSTATUS_UPDATE 1201 #define NEBTYPE_SERVICESTATUS_UPDATE 1202 #define NEBTYPE_CONTACTSTATUS_UPDATE 1203 #define NEBTYPE_ADAPTIVEPROGRAM_UPDATE 1300 #define NEBTYPE_ADAPTIVEHOST_UPDATE 1301 #define NEBTYPE_ADAPTIVESERVICE_UPDATE 1302 #define NEBTYPE_ADAPTIVECONTACT_UPDATE 1303 #define NEBTYPE_EXTERNALCOMMAND_START 1400 #define NEBTYPE_EXTERNALCOMMAND_END 1401 #define NEBTYPE_AGGREGATEDSTATUS_STARTDUMP 1500 #define NEBTYPE_AGGREGATEDSTATUS_ENDDUMP 1501 #define NEBTYPE_RETENTIONDATA_STARTLOAD 1600 #define NEBTYPE_RETENTIONDATA_ENDLOAD 1601 #define NEBTYPE_RETENTIONDATA_STARTSAVE 1602 #define NEBTYPE_RETENTIONDATA_ENDSAVE 1603 #define NEBTYPE_ACKNOWLEDGEMENT_ADD 1700 #define NEBTYPE_ACKNOWLEDGEMENT_REMOVE 1701 /* NOT IMPLEMENTED */ #define NEBTYPE_ACKNOWLEDGEMENT_LOAD 1702 /* NOT IMPLEMENTED */ #define NEBTYPE_STATECHANGE_START 1800 /* NOT IMPLEMENTED */ #define NEBTYPE_STATECHANGE_END 1801 /****** EVENT FLAGS ************************/ #define NEBFLAG_NONE 0 #define NEBFLAG_PROCESS_INITIATED 1 /* event was initiated by Nagios process */ #define NEBFLAG_USER_INITIATED 2 /* event was initiated by a user request */ #define NEBFLAG_MODULE_INITIATED 3 /* event was initiated by an event broker module */ /****** EVENT ATTRIBUTES *******************/ #define NEBATTR_NONE 0 #define NEBATTR_SHUTDOWN_NORMAL 1 #define NEBATTR_SHUTDOWN_ABNORMAL 2 #define NEBATTR_RESTART_NORMAL 4 #define NEBATTR_RESTART_ABNORMAL 8 #define NEBATTR_FLAPPING_STOP_NORMAL 1 #define NEBATTR_FLAPPING_STOP_DISABLED 2 /* flapping stopped because flap detection was disabled */ #define NEBATTR_DOWNTIME_STOP_NORMAL 1 #define NEBATTR_DOWNTIME_STOP_CANCELLED 2 /****** EVENT BROKER FUNCTIONS *************/ #ifdef USE_EVENT_BROKER struct timeval get_broker_timestamp(struct timeval *); void broker_program_state(int,int,int,struct timeval *); void broker_timed_event(int,int,int,timed_event *,struct timeval *); void broker_log_data(int,int,int,char *,unsigned long,time_t,struct timeval *); int broker_event_handler(int,int,int,int,void *,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,char *,struct timeval *); void broker_ocp_data(int,int,int,void *,int,int,double,int,int,struct timeval *); void broker_system_command(int,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,struct timeval *); int broker_host_check(int,int,int,host *,int,int,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,char *,char *,char *,struct timeval *); int broker_service_check(int,int,int,service *,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,struct timeval *); void broker_comment_data(int,int,int,int,int,char *,char *,time_t,char *,char *,int,int,int,time_t,unsigned long,struct timeval *); void broker_downtime_data(int,int,int,int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long,struct timeval *); void broker_flapping_data(int,int,int,int,void *,double,double,double,struct timeval *); void broker_program_status(int,int,int,struct timeval *); void broker_host_status(int,int,int,host *,struct timeval *); void broker_service_status(int,int,int,service *,struct timeval *); void broker_contact_status(int,int,int,contact *,struct timeval *); void broker_notification_data(int,int,int,int,int,struct timeval,struct timeval,void *,char *,char *,int,int,struct timeval *); void broker_contact_notification_data(int,int,int,int,int,struct timeval,struct timeval,void *,contact *,char *,char *,int,struct timeval *); void broker_contact_notification_method_data(int,int,int,int,int,struct timeval,struct timeval,void *,contact *,char *,char *,char *,int,struct timeval *); void broker_adaptive_program_data(int,int,int,int,unsigned long,unsigned long,unsigned long,unsigned long,struct timeval *); void broker_adaptive_host_data(int,int,int,host *,int,unsigned long,unsigned long,struct timeval *); void broker_adaptive_service_data(int,int,int,service *,int,unsigned long,unsigned long,struct timeval *); void broker_adaptive_contact_data(int,int,int,contact *,int,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long, struct timeval *); void broker_external_command(int,int,int,int,time_t,char *,char *,struct timeval *); void broker_aggregated_status_data(int,int,int,struct timeval *); void broker_retention_data(int,int,int,struct timeval *); void broker_acknowledgement_data(int,int,int,int,void *,char *,char *,int,int,int,struct timeval *); void broker_statechange_data(int,int,int,int,void *,int,int,int,int,struct timeval *); #endif #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/config.h0000644001161000116100000001472112213031442015301 00000000000000/* include/config.h. Generated from config.h.in by configure. */ /************************************************************************ * * Nagios Config Header File * Written By: Ethan Galstad (egalstad@nagios.org) * Last Modified: 11-02-2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ /***** NAGIOS STUFF *****/ #define DEFAULT_NAGIOS_USER "nagios" #define DEFAULT_NAGIOS_GROUP "nagios" /* stop gcc from bitching about implicit asprintf declarations */ #define _GNU_SOURCE 1 /* Event broker integration */ #define USE_EVENT_BROKER /* Embed a PERL interpreter into Nagios with optional cache for compiled code (contributed by Stephen Davies) */ /* #undef EMBEDDEDPERL */ /* #undef THREADEDPERL */ /* 0 = cache, 1 = do not cache */ #define DO_CLEAN "1" /* commands used by CGIs */ #define TRACEROUTE_COMMAND "/usr/sbin/traceroute" /* #undef PING_COMMAND */ /* #undef PING_PACKETS_FIRST */ /* Debugging options */ /* function entry and exit */ /* #undef DEBUG0 */ /* general info messages */ /* #undef DEBUG1 */ /* warning messages */ /* #undef DEBUG2 */ /* service and host checks, other events */ /* #undef DEBUG3 */ /* service and host notifications */ /* #undef DEBUG4 */ /* SQL queries (defunct) */ /* #undef DEBUG5 */ /* I/O implementations */ #define USE_XSDDEFAULT #define USE_XCDDEFAULT #define USE_XRDDEFAULT #define USE_XODTEMPLATE #define USE_XPDDEFAULT #define USE_XDDDEFAULT /***** FUNCTION DEFINITIONS *****/ #define HAVE_SETENV 1 #define HAVE_UNSETENV 1 /* #undef HAVE_SOCKET */ #define HAVE_STRDUP 1 #define HAVE_STRSTR 1 #define HAVE_STRTOUL 1 #define HAVE_INITGROUPS 1 /* #undef HAVE_GETLOADAVG */ #define HAVE_GDIMAGECREATETRUECOLOR 1 /***** ASPRINTF() AND FRIENDS *****/ /* #undef HAVE_VSNPRINTF */ /* #undef HAVE_SNPRINTF */ /* #undef HAVE_ASPRINTF */ /* #undef HAVE_VASPRINTF */ #define HAVE_C99_VSNPRINTF 1 #define HAVE_VA_COPY 1 /* #undef HAVE___VA_COPY */ /***** MISC DEFINITIONS *****/ #define USE_NANOSLEEP #define STDC_HEADERS 1 #define HAVE_TM_ZONE 1 /* #undef HAVE_TZNAME */ /* #undef USE_PROC */ #define SOCKET_SIZE_TYPE size_t #define GETGROUPS_T gid_t #define RETSIGTYPE void /***** HEADER FILES *****/ #include #include /* needed for the time_t structures we use later... */ /* this include must come before sys/resource.h or we can have problems on some OSes */ #define TIME_WITH_SYS_TIME 1 #define HAVE_SYS_TIME_H 1 #if TIME_WITH_SYS_TIME #include #include #else #if HAVE_SYS_TIME_H #include #else #include #endif #endif #define HAVE_SYS_RESOURCE_H 1 #ifdef HAVE_SYS_RESOURCE_H #include #endif #define HAVE_LIMITS_H 1 #ifdef HAVE_LIMITS_H #include #endif #define HAVE_PWD_H 1 #ifdef HAVE_PWD_H #include #endif #define HAVE_GRP_H 1 #ifdef HAVE_GRP_H #include #endif #define HAVE_STRINGS_H 1 #ifdef HAVE_STRINGS_H #include #endif #define HAVE_STRING_H 1 #ifdef HAVE_STRINGS_H #include #endif #define HAVE_UNISTD_H 1 #ifdef HAVE_UNISTD_H #include #endif #define HAVE_SYSLOG_H 1 #ifdef HAVE_SYSLOG_H #include #endif #define HAVE_SIGNAL_H 1 #ifdef HAVE_SIGNAL_H #include #endif #define HAVE_SYS_STAT_H 1 #ifdef HAVE_SYS_STAT_H #include #endif #define HAVE_SYS_MMAN_H 1 #ifdef HAVE_SYS_MMAN_H #include #endif #define HAVE_FCNTL_H 1 #ifdef HAVE_FCNTL_H #include #endif #define HAVE_STDARG_H 1 #ifdef HAVE_STDARG_H #include #endif #define HAVE_SYS_TYPES_H 1 #ifdef HAVE_SYS_TYPES_H #include #endif #define HAVE_SYS_WAIT_H 1 #ifdef HAVE_SYS_WAIT_H #include #endif #define HAVE_ERRNO_H 1 #ifdef HAVE_ERRNO_H #include #endif #define HAVE_SYS_TIMEB_H 1 #if HAVE_SYS_TIMEB_H #include #endif #define HAVE_SYS_IPC_H 1 #ifdef HAVE_SYS_IPC_H #include #endif #define HAVE_SYS_MSG_H 1 #ifdef HAVE_SYS_MSG_H #include #endif #define HAVE_MATH_H 1 #ifdef HAVE_MATH_H #include #endif #define HAVE_CTYPE_H 1 #ifdef HAVE_CTYPE_H #include #endif #define HAVE_DIRENT_H 1 #ifdef HAVE_DIRENT_H #include #endif #define HAVE_PTHREAD_H 1 #ifdef HAVE_PTHREAD_H #include #endif #define HAVE_REGEX_H 1 #ifdef HAVE_REGEX_H #include #define HAVE_SYS_SOCKET_H 1 #ifdef HAVE_SYS_SOCKET_H #include #endif /* #undef HAVE_SOCKET */ #ifdef HAVE_SOCKET_H #include #endif #define HAVE_NETINET_IN_H 1 #ifdef HAVE_NETINET_IN_H #include #endif #define HAVE_ARPA_INET_H 1 #ifdef HAVE_ARPA_INET_H #include #endif #define HAVE_NETDB_H 1 #ifdef HAVE_NETDB_H #include #endif #define HAVE_LIBGEN_H 1 #ifdef HAVE_LIBGEN_H #include #endif #define HAVE_SYS_UN_H 1 #ifdef HAVE_SYS_UN_H #include #endif #define HAVE_SYS_POLL_H 1 #ifdef HAVE_SYS_POLL_H #include #endif #define HAVE_GETOPT_H 1 #ifdef HAVE_GETOPT_H #include #endif /* #undef HAVE_LINUX_MODULE_H */ #ifdef HAVE_LINUX_MODULE_H #include #endif /* configure script should allow user to override ltdl choice, but this will do for now... */ /* #undef USE_LTDL */ #ifndef HAVE_LTDL_H #endif #ifndef HAVE_LTDL_H #define HAVE_LTDL_H #endif #ifdef HAVE_LTDL_H #define USE_LTDL #endif #ifdef USE_LTDL #include #else /* #undef HAVE_DLFCN_H */ #ifdef HAVE_DLFCN_H #include #endif #endif /* moved to end to prevent AIX compiler warnings */ #ifndef RTLD_GLOBAL #define RTLD_GLOBAL 0 #endif #ifndef RTLD_NOW #define RTLD_NOW 0 #endif /***** MARO DEFINITIONS *****/ /* this needs to come after all system include files, so we don't accidentally attempt to redefine it */ #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #endif mod_gearman-1.4.14/include/nagios/objects.h0000644001161000116100000006620612213031442015472 00000000000000/***************************************************************************** * * OBJECTS.H - Header file for object addition/search functions * * Copyright (c) 1999-2007 Ethan Galstad (egalstad@nagios.org) * Last Modified: 11-10-2007 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _OBJECTS_H #define _OBJECTS_H #include "config.h" #include "common.h" #ifdef __cplusplus extern "C" { #endif /*************** CURRENT OBJECT REVISION **************/ #define CURRENT_OBJECT_STRUCTURE_VERSION 307 /* increment when changes are made to data structures... */ /* Nagios 3 starts at 300, Nagios 4 at 400, etc. */ /***************** OBJECT SIZE LIMITS *****************/ #define MAX_STATE_HISTORY_ENTRIES 21 /* max number of old states to keep track of for flap detection */ #define MAX_CONTACT_ADDRESSES 6 /* max number of custom addresses a contact can have */ /***************** SKIP LISTS ****************/ #define NUM_OBJECT_SKIPLISTS 12 #define HOST_SKIPLIST 0 #define SERVICE_SKIPLIST 1 #define COMMAND_SKIPLIST 2 #define TIMEPERIOD_SKIPLIST 3 #define CONTACT_SKIPLIST 4 #define CONTACTGROUP_SKIPLIST 5 #define HOSTGROUP_SKIPLIST 6 #define SERVICEGROUP_SKIPLIST 7 #define HOSTDEPENDENCY_SKIPLIST 8 #define SERVICEDEPENDENCY_SKIPLIST 9 #define HOSTESCALATION_SKIPLIST 10 #define SERVICEESCALATION_SKIPLIST 11 /****************** DATA STRUCTURES *******************/ typedef struct host_struct host; typedef struct service_struct service; typedef struct contact_struct contact; /* OBJECT LIST STRUCTURE */ typedef struct objectlist_struct{ void *object_ptr; struct objectlist_struct *next; }objectlist; /* TIMERANGE structure */ typedef struct timerange_struct{ unsigned long range_start; unsigned long range_end; struct timerange_struct *next; }timerange; /* DATERANGE structure */ typedef struct daterange_struct{ int type; int syear; /* start year */ int smon; /* start month */ int smday; /* start day of month (may 3rd, last day in feb) */ int swday; /* start day of week (thursday) */ int swday_offset; /* start weekday offset (3rd thursday, last monday in jan) */ int eyear; int emon; int emday; int ewday; int ewday_offset; int skip_interval; timerange *times; struct daterange_struct *next; }daterange; /* TIMEPERIODEXCLUSION structure */ typedef struct timeperiodexclusion_struct{ char *timeperiod_name; struct timeperiod_struct *timeperiod_ptr; struct timeperiodexclusion_struct *next; }timeperiodexclusion; /* TIMEPERIOD structure */ typedef struct timeperiod_struct{ char *name; char *alias; timerange *days[7]; daterange *exceptions[DATERANGE_TYPES]; timeperiodexclusion *exclusions; struct timeperiod_struct *next; struct timeperiod_struct *nexthash; }timeperiod; /* CONTACTSMEMBER structure */ typedef struct contactsmember_struct{ char *contact_name; #ifdef NSCORE contact *contact_ptr; #endif struct contactsmember_struct *next; }contactsmember; /* CONTACTGROUP structure */ typedef struct contactgroup_struct{ char *group_name; char *alias; contactsmember *members; struct contactgroup_struct *next; struct contactgroup_struct *nexthash; }contactgroup; /* CONTACTGROUPSMEMBER structure */ typedef struct contactgroupsmember_struct{ char *group_name; #ifdef NSCORE contactgroup *group_ptr; #endif struct contactgroupsmember_struct *next; }contactgroupsmember; /* CUSTOMVARIABLESMEMBER structure */ typedef struct customvariablesmember_struct{ char *variable_name; char *variable_value; int has_been_modified; struct customvariablesmember_struct *next; }customvariablesmember; /* COMMAND structure */ typedef struct command_struct{ char *name; char *command_line; struct command_struct *next; struct command_struct *nexthash; }command; /* COMMANDSMEMBER structure */ typedef struct commandsmember_struct{ char *command; #ifdef NSCORE command *command_ptr; #endif struct commandsmember_struct *next; }commandsmember; /* CONTACT structure */ struct contact_struct{ char *name; char *alias; char *email; char *pager; char *address[MAX_CONTACT_ADDRESSES]; commandsmember *host_notification_commands; commandsmember *service_notification_commands; int notify_on_service_unknown; int notify_on_service_warning; int notify_on_service_critical; int notify_on_service_recovery; int notify_on_service_flapping; int notify_on_service_downtime; int notify_on_host_down; int notify_on_host_unreachable; int notify_on_host_recovery; int notify_on_host_flapping; int notify_on_host_downtime; char *host_notification_period; char *service_notification_period; int host_notifications_enabled; int service_notifications_enabled; int can_submit_commands; int retain_status_information; int retain_nonstatus_information; customvariablesmember *custom_variables; #ifdef NSCORE time_t last_host_notification; time_t last_service_notification; unsigned long modified_attributes; unsigned long modified_host_attributes; unsigned long modified_service_attributes; timeperiod *host_notification_period_ptr; timeperiod *service_notification_period_ptr; objectlist *contactgroups_ptr; #endif struct contact_struct *next; struct contact_struct *nexthash; }; /* SERVICESMEMBER structure */ typedef struct servicesmember_struct{ char *host_name; char *service_description; #ifdef NSCORE service *service_ptr; #endif struct servicesmember_struct *next; }servicesmember; /* HOSTSMEMBER structure */ typedef struct hostsmember_struct{ char *host_name; #ifdef NSCORE host *host_ptr; #endif struct hostsmember_struct *next; }hostsmember; /* HOSTGROUP structure */ typedef struct hostgroup_struct{ char *group_name; char *alias; hostsmember *members; char *notes; char *notes_url; char *action_url; struct hostgroup_struct *next; struct hostgroup_struct *nexthash; }hostgroup; /* HOST structure */ struct host_struct{ char *name; char *display_name; char *alias; char *address; hostsmember *parent_hosts; hostsmember *child_hosts; servicesmember *services; char *host_check_command; int initial_state; double check_interval; double retry_interval; int max_attempts; char *event_handler; contactgroupsmember *contact_groups; contactsmember *contacts; double notification_interval; double first_notification_delay; int notify_on_down; int notify_on_unreachable; int notify_on_recovery; int notify_on_flapping; int notify_on_downtime; char *notification_period; char *check_period; int flap_detection_enabled; double low_flap_threshold; double high_flap_threshold; int flap_detection_on_up; int flap_detection_on_down; int flap_detection_on_unreachable; int stalk_on_up; int stalk_on_down; int stalk_on_unreachable; int check_freshness; int freshness_threshold; int process_performance_data; int checks_enabled; int accept_passive_host_checks; int event_handler_enabled; int retain_status_information; int retain_nonstatus_information; int failure_prediction_enabled; char *failure_prediction_options; int obsess_over_host; char *notes; char *notes_url; char *action_url; char *icon_image; char *icon_image_alt; char *vrml_image; char *statusmap_image; int have_2d_coords; int x_2d; int y_2d; int have_3d_coords; double x_3d; double y_3d; double z_3d; int should_be_drawn; customvariablesmember *custom_variables; #ifdef NSCORE int problem_has_been_acknowledged; int acknowledgement_type; int check_type; int current_state; int last_state; int last_hard_state; char *plugin_output; char *long_plugin_output; char *perf_data; int state_type; int current_attempt; unsigned long current_event_id; unsigned long last_event_id; unsigned long current_problem_id; unsigned long last_problem_id; double latency; double execution_time; int is_executing; int check_options; int notifications_enabled; time_t last_host_notification; time_t next_host_notification; time_t next_check; int should_be_scheduled; time_t last_check; time_t last_state_change; time_t last_hard_state_change; time_t last_time_up; time_t last_time_down; time_t last_time_unreachable; int has_been_checked; int is_being_freshened; int notified_on_down; int notified_on_unreachable; int current_notification_number; int no_more_notifications; unsigned long current_notification_id; int check_flapping_recovery_notification; int scheduled_downtime_depth; int pending_flex_downtime; int state_history[MAX_STATE_HISTORY_ENTRIES]; /* flap detection */ int state_history_index; time_t last_state_history_update; int is_flapping; unsigned long flapping_comment_id; double percent_state_change; int total_services; unsigned long total_service_check_interval; unsigned long modified_attributes; int circular_path_checked; int contains_circular_path; command *event_handler_ptr; command *check_command_ptr; timeperiod *check_period_ptr; timeperiod *notification_period_ptr; objectlist *hostgroups_ptr; #endif struct host_struct *next; struct host_struct *nexthash; }; /* SERVICEGROUP structure */ typedef struct servicegroup_struct{ char *group_name; char *alias; servicesmember *members; char *notes; char *notes_url; char *action_url; struct servicegroup_struct *next; struct servicegroup_struct *nexthash; }servicegroup; /* SERVICE structure */ struct service_struct{ char *host_name; char *description; char *display_name; char *service_check_command; char *event_handler; int initial_state; double check_interval; double retry_interval; int max_attempts; int parallelize; contactgroupsmember *contact_groups; contactsmember *contacts; double notification_interval; double first_notification_delay; int notify_on_unknown; int notify_on_warning; int notify_on_critical; int notify_on_recovery; int notify_on_flapping; int notify_on_downtime; int stalk_on_ok; int stalk_on_warning; int stalk_on_unknown; int stalk_on_critical; int is_volatile; char *notification_period; char *check_period; int flap_detection_enabled; double low_flap_threshold; double high_flap_threshold; int flap_detection_on_ok; int flap_detection_on_warning; int flap_detection_on_unknown; int flap_detection_on_critical; int process_performance_data; int check_freshness; int freshness_threshold; int accept_passive_service_checks; int event_handler_enabled; int checks_enabled; int retain_status_information; int retain_nonstatus_information; int notifications_enabled; int obsess_over_service; int failure_prediction_enabled; char *failure_prediction_options; char *notes; char *notes_url; char *action_url; char *icon_image; char *icon_image_alt; customvariablesmember *custom_variables; #ifdef NSCORE int problem_has_been_acknowledged; int acknowledgement_type; int host_problem_at_last_check; int check_type; int current_state; int last_state; int last_hard_state; char *plugin_output; char *long_plugin_output; char *perf_data; int state_type; time_t next_check; int should_be_scheduled; time_t last_check; int current_attempt; unsigned long current_event_id; unsigned long last_event_id; unsigned long current_problem_id; unsigned long last_problem_id; time_t last_notification; time_t next_notification; int no_more_notifications; int check_flapping_recovery_notification; time_t last_state_change; time_t last_hard_state_change; time_t last_time_ok; time_t last_time_warning; time_t last_time_unknown; time_t last_time_critical; int has_been_checked; int is_being_freshened; int notified_on_unknown; int notified_on_warning; int notified_on_critical; int current_notification_number; unsigned long current_notification_id; double latency; double execution_time; int is_executing; int check_options; int scheduled_downtime_depth; int pending_flex_downtime; int state_history[MAX_STATE_HISTORY_ENTRIES]; /* flap detection */ int state_history_index; int is_flapping; unsigned long flapping_comment_id; double percent_state_change; unsigned long modified_attributes; host *host_ptr; command *event_handler_ptr; char *event_handler_args; command *check_command_ptr; char *check_command_args; timeperiod *check_period_ptr; timeperiod *notification_period_ptr; objectlist *servicegroups_ptr; #endif struct service_struct *next; struct service_struct *nexthash; }; /* SERVICE ESCALATION structure */ typedef struct serviceescalation_struct{ char *host_name; char *description; int first_notification; int last_notification; double notification_interval; char *escalation_period; int escalate_on_recovery; int escalate_on_warning; int escalate_on_unknown; int escalate_on_critical; contactgroupsmember *contact_groups; contactsmember *contacts; #ifdef NSCORE service *service_ptr; timeperiod *escalation_period_ptr; #endif struct serviceescalation_struct *next; struct serviceescalation_struct *nexthash; }serviceescalation; /* SERVICE DEPENDENCY structure */ typedef struct servicedependency_struct{ int dependency_type; char *dependent_host_name; char *dependent_service_description; char *host_name; char *service_description; char *dependency_period; int inherits_parent; int fail_on_ok; int fail_on_warning; int fail_on_unknown; int fail_on_critical; int fail_on_pending; #ifdef NSCORE int circular_path_checked; int contains_circular_path; service *master_service_ptr; service *dependent_service_ptr; timeperiod *dependency_period_ptr; #endif struct servicedependency_struct *next; struct servicedependency_struct *nexthash; }servicedependency; /* HOST ESCALATION structure */ typedef struct hostescalation_struct{ char *host_name; int first_notification; int last_notification; double notification_interval; char *escalation_period; int escalate_on_recovery; int escalate_on_down; int escalate_on_unreachable; contactgroupsmember *contact_groups; contactsmember *contacts; #ifdef NSCORE host *host_ptr; timeperiod *escalation_period_ptr; #endif struct hostescalation_struct *next; struct hostescalation_struct *nexthash; }hostescalation; /* HOST DEPENDENCY structure */ typedef struct hostdependency_struct{ int dependency_type; char *dependent_host_name; char *host_name; char *dependency_period; int inherits_parent; int fail_on_up; int fail_on_down; int fail_on_unreachable; int fail_on_pending; #ifdef NSCORE int circular_path_checked; int contains_circular_path; host *master_host_ptr; host *dependent_host_ptr; timeperiod *dependency_period_ptr; #endif struct hostdependency_struct *next; struct hostdependency_struct *nexthash; }hostdependency; /****************** HASH STRUCTURES ********************/ typedef struct host_cursor_struct{ int host_hashchain_iterator; host *current_host_pointer; }host_cursor; /********************* FUNCTIONS **********************/ /**** Top-level input functions ****/ int read_object_config_data(char *,int,int,int); /* reads all external configuration data of specific types */ /**** Object Creation Functions ****/ contact *add_contact(char *,char *,char *,char *,char **,char *,char *,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int); /* adds a contact definition */ commandsmember *add_service_notification_command_to_contact(contact *,char *); /* adds a service notification command to a contact definition */ commandsmember *add_host_notification_command_to_contact(contact *,char *); /* adds a host notification command to a contact definition */ customvariablesmember *add_custom_variable_to_contact(contact *,char *,char *); /* adds a custom variable to a service definition */ host *add_host(char *,char *,char *,char *,char *,int,double,double,int,int,int,int,int,int,double,double,char *,int,char *,int,int,char *,int,int,double,double,int,int,int,int,int,int,int,int,char *,int,int,char *,char *,char *,char *,char *,char *,char *,int,int,int,double,double,double,int,int,int,int,int); /* adds a host definition */ hostsmember *add_parent_host_to_host(host *,char *); /* adds a parent host to a host definition */ hostsmember *add_child_link_to_host(host *,host *); /* adds a child host to a host definition */ contactgroupsmember *add_contactgroup_to_host(host *,char *); /* adds a contactgroup to a host definition */ contactsmember *add_contact_to_host(host *,char *); /* adds a contact to a host definition */ customvariablesmember *add_custom_variable_to_host(host *,char *,char *); /* adds a custom variable to a host definition */ timeperiod *add_timeperiod(char *,char *); /* adds a timeperiod definition */ timeperiodexclusion *add_exclusion_to_timeperiod(timeperiod *,char *); /* adds an exclusion to a timeperiod */ timerange *add_timerange_to_timeperiod(timeperiod *,int,unsigned long,unsigned long); /* adds a timerange to a timeperiod definition */ daterange *add_exception_to_timeperiod(timeperiod *,int,int,int,int,int,int,int,int,int,int,int,int); timerange *add_timerange_to_daterange(daterange *,unsigned long,unsigned long); hostgroup *add_hostgroup(char *,char *,char *,char *,char *); /* adds a hostgroup definition */ hostsmember *add_host_to_hostgroup(hostgroup *, char *); /* adds a host to a hostgroup definition */ servicegroup *add_servicegroup(char *,char *,char *,char *,char *); /* adds a servicegroup definition */ servicesmember *add_service_to_servicegroup(servicegroup *,char *,char *); /* adds a service to a servicegroup definition */ contactgroup *add_contactgroup(char *,char *); /* adds a contactgroup definition */ contactsmember *add_contact_to_contactgroup(contactgroup *,char *); /* adds a contact to a contact group definition */ command *add_command(char *,char *); /* adds a command definition */ service *add_service(char *,char *,char *,char *,int,int,int,int,double,double,double,double,char *,int,int,int,int,int,int,int,int,char *,int,char *,int,int,double,double,int,int,int,int,int,int,int,int,int,int,char *,int,int,char *,char *,char *,char *,char *,int,int,int); /* adds a service definition */ contactgroupsmember *add_contactgroup_to_service(service *,char *); /* adds a contact group to a service definition */ contactsmember *add_contact_to_service(service *,char *); /* adds a contact to a host definition */ serviceescalation *add_serviceescalation(char *,char *,int,int,double,char *,int,int,int,int); /* adds a service escalation definition */ contactgroupsmember *add_contactgroup_to_serviceescalation(serviceescalation *,char *); /* adds a contact group to a service escalation definition */ contactsmember *add_contact_to_serviceescalation(serviceescalation *,char *); /* adds a contact to a service escalation definition */ customvariablesmember *add_custom_variable_to_service(service *,char *,char *); /* adds a custom variable to a service definition */ servicedependency *add_service_dependency(char *,char *,char *,char *,int,int,int,int,int,int,int,char *); /* adds a service dependency definition */ hostdependency *add_host_dependency(char *,char *,int,int,int,int,int,int,char *); /* adds a host dependency definition */ hostescalation *add_hostescalation(char *,int,int,double,char *,int,int,int); /* adds a host escalation definition */ contactsmember *add_contact_to_hostescalation(hostescalation *,char *); /* adds a contact to a host escalation definition */ contactgroupsmember *add_contactgroup_to_hostescalation(hostescalation *,char *); /* adds a contact group to a host escalation definition */ contactsmember *add_contact_to_object(contactsmember **,char *); /* adds a contact to an object */ customvariablesmember *add_custom_variable_to_object(customvariablesmember **,char *,char *); /* adds a custom variable to an object */ servicesmember *add_service_link_to_host(host *,service *); /*** Object Skiplist Functions ****/ int init_object_skiplists(void); int free_object_skiplists(void); int skiplist_compare_text(const char *val1a, const char *val1b, const char *val2a, const char *val2b); int skiplist_compare_host(void *a, void *b); int skiplist_compare_service(void *a, void *b); int skiplist_compare_command(void *a, void *b); int skiplist_compare_timeperiod(void *a, void *b); int skiplist_compare_contact(void *a, void *b); int skiplist_compare_contactgroup(void *a, void *b); int skiplist_compare_hostgroup(void *a, void *b); int skiplist_compare_servicegroup(void *a, void *b); int skiplist_compare_hostescalation(void *a, void *b); int skiplist_compare_serviceescalation(void *a, void *b); int skiplist_compare_hostdependency(void *a, void *b); int skiplist_compare_servicedependency(void *a, void *b); int get_host_count(void); int get_service_count(void); /**** Object Hash Functions ****/ int add_servicedependency_to_hashlist(servicedependency *); /**** Object Search Functions ****/ timeperiod * find_timeperiod(char *); /* finds a timeperiod object */ host * find_host(char *); /* finds a host object */ hostgroup * find_hostgroup(char *); /* finds a hostgroup object */ servicegroup * find_servicegroup(char *); /* finds a servicegroup object */ contact * find_contact(char *); /* finds a contact object */ contactgroup * find_contactgroup(char *); /* finds a contactgroup object */ command * find_command(char *); /* finds a command object */ service * find_service(char *,char *); /* finds a service object */ /**** Object Traversal Functions ****/ hostescalation *get_first_hostescalation_by_host(char *, void **); hostescalation *get_next_hostescalation_by_host(char *,void **); serviceescalation *get_first_serviceescalation_by_service(char *,char *, void **); serviceescalation *get_next_serviceescalation_by_service(char *,char *,void **); hostdependency *get_first_hostdependency_by_dependent_host(char *, void **); hostdependency *get_next_hostdependency_by_dependent_host(char *, void **); servicedependency *get_first_servicedependency_by_dependent_service(char *,char *, void **); servicedependency *get_next_servicedependency_by_dependent_service(char *,char *,void **); #ifdef NSCORE int add_object_to_objectlist(objectlist **,void *); int free_objectlist(objectlist **); #endif /**** Object Query Functions ****/ int is_host_immediate_child_of_host(host *,host *); /* checks if a host is an immediate child of another host */ int is_host_primary_immediate_child_of_host(host *,host *); /* checks if a host is an immediate child (and primary child) of another host */ int is_host_immediate_parent_of_host(host *,host *); /* checks if a host is an immediate child of another host */ int is_host_member_of_hostgroup(hostgroup *,host *); /* tests whether or not a host is a member of a specific hostgroup */ int is_host_member_of_servicegroup(servicegroup *,host *); /* tests whether or not a service is a member of a specific servicegroup */ int is_service_member_of_servicegroup(servicegroup *,service *); /* tests whether or not a service is a member of a specific servicegroup */ int is_contact_member_of_contactgroup(contactgroup *, contact *); /* tests whether or not a contact is a member of a specific contact group */ int is_contact_for_hostgroup(hostgroup *,contact *); /* tests whether or not a contact is a member of a specific hostgroup */ int is_contact_for_servicegroup(servicegroup *,contact *); /* tests whether or not a contact is a member of a specific servicegroup */ int is_contact_for_host(host *,contact *); /* tests whether or not a contact is a contact member for a specific host */ int is_escalated_contact_for_host(host *,contact *); /* checks whether or not a contact is an escalated contact for a specific host */ int is_contact_for_service(service *,contact *); /* tests whether or not a contact is a contact member for a specific service */ int is_escalated_contact_for_service(service *,contact *); /* checks whether or not a contact is an escalated contact for a specific service */ int is_host_immediate_parent_of_host(host *,host *); /* tests whether or not a host is an immediate parent of another host */ int number_of_immediate_child_hosts(host *); /* counts the number of immediate child hosts for a particular host */ int number_of_total_child_hosts(host *); /* counts the number of total child hosts for a particular host */ int number_of_immediate_parent_hosts(host *); /* counts the number of immediate parents hosts for a particular host */ int number_of_total_parent_hosts(host *); /* counts the number of total parents hosts for a particular host */ #ifdef NSCORE int check_for_circular_servicedependency_path(servicedependency *,servicedependency *,int); /* checks if a circular dependency exists for a given service */ int check_for_circular_hostdependency_path(hostdependency *,hostdependency *,int); /* checks if a circular dependency exists for a given host */ #endif /**** Object Cleanup Functions ****/ int free_object_data(void); /* frees all allocated memory for the object definitions */ #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/snprintf.h0000644001161000116100000000021412111647377015710 00000000000000/* include/snprintf.h. Generated from snprintf.h.in by configure. */ /* -*- C -*- */ /* #undef HAVE_SNPRINTF */ /* #undef NEED_VA_LIST */ mod_gearman-1.4.14/include/nagios/common.h0000644001161000116100000004325512213031442015330 00000000000000/************************************************************************ * * Nagios Common Header File * Written By: Ethan Galstad (egalstad@nagios.org) * Last Modified: 10-22-2007 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #define PROGRAM_VERSION "3.2.1" #define PROGRAM_MODIFICATION_DATE "03-09-2010" /*#define DEBUG_CHECK_IPC 1 */ /*#define DEBUG_CHECK_IPC2 1*/ /* daemon is thread safe */ #ifdef NSCORE #ifndef _REENTRANT #define _REENTRANT #endif #ifndef _THREAD_SAFE #define _THREAD_SAFE #endif #endif /* Experimental performance tweaks - use with caution */ #undef USE_MEMORY_PERFORMANCE_TWEAKS /* my_free has been freed from bondage as a function */ #define my_free(ptr) { if(ptr) { free(ptr); ptr = NULL; } } /***************************** COMMANDS *********************************/ #define CMD_NONE 0 #define CMD_ADD_HOST_COMMENT 1 #define CMD_DEL_HOST_COMMENT 2 #define CMD_ADD_SVC_COMMENT 3 #define CMD_DEL_SVC_COMMENT 4 #define CMD_ENABLE_SVC_CHECK 5 #define CMD_DISABLE_SVC_CHECK 6 #define CMD_SCHEDULE_SVC_CHECK 7 #define CMD_DELAY_SVC_NOTIFICATION 9 #define CMD_DELAY_HOST_NOTIFICATION 10 #define CMD_DISABLE_NOTIFICATIONS 11 #define CMD_ENABLE_NOTIFICATIONS 12 #define CMD_RESTART_PROCESS 13 #define CMD_SHUTDOWN_PROCESS 14 #define CMD_ENABLE_HOST_SVC_CHECKS 15 #define CMD_DISABLE_HOST_SVC_CHECKS 16 #define CMD_SCHEDULE_HOST_SVC_CHECKS 17 #define CMD_DELAY_HOST_SVC_NOTIFICATIONS 19 /* currently unimplemented */ #define CMD_DEL_ALL_HOST_COMMENTS 20 #define CMD_DEL_ALL_SVC_COMMENTS 21 #define CMD_ENABLE_SVC_NOTIFICATIONS 22 #define CMD_DISABLE_SVC_NOTIFICATIONS 23 #define CMD_ENABLE_HOST_NOTIFICATIONS 24 #define CMD_DISABLE_HOST_NOTIFICATIONS 25 #define CMD_ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST 26 #define CMD_DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST 27 #define CMD_ENABLE_HOST_SVC_NOTIFICATIONS 28 #define CMD_DISABLE_HOST_SVC_NOTIFICATIONS 29 #define CMD_PROCESS_SERVICE_CHECK_RESULT 30 #define CMD_SAVE_STATE_INFORMATION 31 #define CMD_READ_STATE_INFORMATION 32 #define CMD_ACKNOWLEDGE_HOST_PROBLEM 33 #define CMD_ACKNOWLEDGE_SVC_PROBLEM 34 #define CMD_START_EXECUTING_SVC_CHECKS 35 #define CMD_STOP_EXECUTING_SVC_CHECKS 36 #define CMD_START_ACCEPTING_PASSIVE_SVC_CHECKS 37 #define CMD_STOP_ACCEPTING_PASSIVE_SVC_CHECKS 38 #define CMD_ENABLE_PASSIVE_SVC_CHECKS 39 #define CMD_DISABLE_PASSIVE_SVC_CHECKS 40 #define CMD_ENABLE_EVENT_HANDLERS 41 #define CMD_DISABLE_EVENT_HANDLERS 42 #define CMD_ENABLE_HOST_EVENT_HANDLER 43 #define CMD_DISABLE_HOST_EVENT_HANDLER 44 #define CMD_ENABLE_SVC_EVENT_HANDLER 45 #define CMD_DISABLE_SVC_EVENT_HANDLER 46 #define CMD_ENABLE_HOST_CHECK 47 #define CMD_DISABLE_HOST_CHECK 48 #define CMD_START_OBSESSING_OVER_SVC_CHECKS 49 #define CMD_STOP_OBSESSING_OVER_SVC_CHECKS 50 #define CMD_REMOVE_HOST_ACKNOWLEDGEMENT 51 #define CMD_REMOVE_SVC_ACKNOWLEDGEMENT 52 #define CMD_SCHEDULE_FORCED_HOST_SVC_CHECKS 53 #define CMD_SCHEDULE_FORCED_SVC_CHECK 54 #define CMD_SCHEDULE_HOST_DOWNTIME 55 #define CMD_SCHEDULE_SVC_DOWNTIME 56 #define CMD_ENABLE_HOST_FLAP_DETECTION 57 #define CMD_DISABLE_HOST_FLAP_DETECTION 58 #define CMD_ENABLE_SVC_FLAP_DETECTION 59 #define CMD_DISABLE_SVC_FLAP_DETECTION 60 #define CMD_ENABLE_FLAP_DETECTION 61 #define CMD_DISABLE_FLAP_DETECTION 62 #define CMD_ENABLE_HOSTGROUP_SVC_NOTIFICATIONS 63 #define CMD_DISABLE_HOSTGROUP_SVC_NOTIFICATIONS 64 #define CMD_ENABLE_HOSTGROUP_HOST_NOTIFICATIONS 65 #define CMD_DISABLE_HOSTGROUP_HOST_NOTIFICATIONS 66 #define CMD_ENABLE_HOSTGROUP_SVC_CHECKS 67 #define CMD_DISABLE_HOSTGROUP_SVC_CHECKS 68 #define CMD_CANCEL_HOST_DOWNTIME 69 /* not internally implemented */ #define CMD_CANCEL_SVC_DOWNTIME 70 /* not internally implemented */ #define CMD_CANCEL_ACTIVE_HOST_DOWNTIME 71 /* old - no longer used */ #define CMD_CANCEL_PENDING_HOST_DOWNTIME 72 /* old - no longer used */ #define CMD_CANCEL_ACTIVE_SVC_DOWNTIME 73 /* old - no longer used */ #define CMD_CANCEL_PENDING_SVC_DOWNTIME 74 /* old - no longer used */ #define CMD_CANCEL_ACTIVE_HOST_SVC_DOWNTIME 75 /* unimplemented */ #define CMD_CANCEL_PENDING_HOST_SVC_DOWNTIME 76 /* unimplemented */ #define CMD_FLUSH_PENDING_COMMANDS 77 #define CMD_DEL_HOST_DOWNTIME 78 #define CMD_DEL_SVC_DOWNTIME 79 #define CMD_ENABLE_FAILURE_PREDICTION 80 #define CMD_DISABLE_FAILURE_PREDICTION 81 #define CMD_ENABLE_PERFORMANCE_DATA 82 #define CMD_DISABLE_PERFORMANCE_DATA 83 #define CMD_SCHEDULE_HOSTGROUP_HOST_DOWNTIME 84 #define CMD_SCHEDULE_HOSTGROUP_SVC_DOWNTIME 85 #define CMD_SCHEDULE_HOST_SVC_DOWNTIME 86 /* new commands in Nagios 2.x found below... */ #define CMD_PROCESS_HOST_CHECK_RESULT 87 #define CMD_START_EXECUTING_HOST_CHECKS 88 #define CMD_STOP_EXECUTING_HOST_CHECKS 89 #define CMD_START_ACCEPTING_PASSIVE_HOST_CHECKS 90 #define CMD_STOP_ACCEPTING_PASSIVE_HOST_CHECKS 91 #define CMD_ENABLE_PASSIVE_HOST_CHECKS 92 #define CMD_DISABLE_PASSIVE_HOST_CHECKS 93 #define CMD_START_OBSESSING_OVER_HOST_CHECKS 94 #define CMD_STOP_OBSESSING_OVER_HOST_CHECKS 95 #define CMD_SCHEDULE_HOST_CHECK 96 #define CMD_SCHEDULE_FORCED_HOST_CHECK 98 #define CMD_START_OBSESSING_OVER_SVC 99 #define CMD_STOP_OBSESSING_OVER_SVC 100 #define CMD_START_OBSESSING_OVER_HOST 101 #define CMD_STOP_OBSESSING_OVER_HOST 102 #define CMD_ENABLE_HOSTGROUP_HOST_CHECKS 103 #define CMD_DISABLE_HOSTGROUP_HOST_CHECKS 104 #define CMD_ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS 105 #define CMD_DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS 106 #define CMD_ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS 107 #define CMD_DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS 108 #define CMD_ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS 109 #define CMD_DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS 110 #define CMD_ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS 111 #define CMD_DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS 112 #define CMD_ENABLE_SERVICEGROUP_SVC_CHECKS 113 #define CMD_DISABLE_SERVICEGROUP_SVC_CHECKS 114 #define CMD_ENABLE_SERVICEGROUP_HOST_CHECKS 115 #define CMD_DISABLE_SERVICEGROUP_HOST_CHECKS 116 #define CMD_ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS 117 #define CMD_DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS 118 #define CMD_ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS 119 #define CMD_DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS 120 #define CMD_SCHEDULE_SERVICEGROUP_HOST_DOWNTIME 121 #define CMD_SCHEDULE_SERVICEGROUP_SVC_DOWNTIME 122 #define CMD_CHANGE_GLOBAL_HOST_EVENT_HANDLER 123 #define CMD_CHANGE_GLOBAL_SVC_EVENT_HANDLER 124 #define CMD_CHANGE_HOST_EVENT_HANDLER 125 #define CMD_CHANGE_SVC_EVENT_HANDLER 126 #define CMD_CHANGE_HOST_CHECK_COMMAND 127 #define CMD_CHANGE_SVC_CHECK_COMMAND 128 #define CMD_CHANGE_NORMAL_HOST_CHECK_INTERVAL 129 #define CMD_CHANGE_NORMAL_SVC_CHECK_INTERVAL 130 #define CMD_CHANGE_RETRY_SVC_CHECK_INTERVAL 131 #define CMD_CHANGE_MAX_HOST_CHECK_ATTEMPTS 132 #define CMD_CHANGE_MAX_SVC_CHECK_ATTEMPTS 133 #define CMD_SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME 134 #define CMD_ENABLE_HOST_AND_CHILD_NOTIFICATIONS 135 #define CMD_DISABLE_HOST_AND_CHILD_NOTIFICATIONS 136 #define CMD_SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME 137 #define CMD_ENABLE_SERVICE_FRESHNESS_CHECKS 138 #define CMD_DISABLE_SERVICE_FRESHNESS_CHECKS 139 #define CMD_ENABLE_HOST_FRESHNESS_CHECKS 140 #define CMD_DISABLE_HOST_FRESHNESS_CHECKS 141 #define CMD_SET_HOST_NOTIFICATION_NUMBER 142 #define CMD_SET_SVC_NOTIFICATION_NUMBER 143 /* new commands in Nagios 3.x found below... */ #define CMD_CHANGE_HOST_CHECK_TIMEPERIOD 144 #define CMD_CHANGE_SVC_CHECK_TIMEPERIOD 145 #define CMD_PROCESS_FILE 146 #define CMD_CHANGE_CUSTOM_HOST_VAR 147 #define CMD_CHANGE_CUSTOM_SVC_VAR 148 #define CMD_CHANGE_CUSTOM_CONTACT_VAR 149 #define CMD_ENABLE_CONTACT_HOST_NOTIFICATIONS 150 #define CMD_DISABLE_CONTACT_HOST_NOTIFICATIONS 151 #define CMD_ENABLE_CONTACT_SVC_NOTIFICATIONS 152 #define CMD_DISABLE_CONTACT_SVC_NOTIFICATIONS 153 #define CMD_ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS 154 #define CMD_DISABLE_CONTACTGROUP_HOST_NOTIFICATIONS 155 #define CMD_ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS 156 #define CMD_DISABLE_CONTACTGROUP_SVC_NOTIFICATIONS 157 #define CMD_CHANGE_RETRY_HOST_CHECK_INTERVAL 158 #define CMD_SEND_CUSTOM_HOST_NOTIFICATION 159 #define CMD_SEND_CUSTOM_SVC_NOTIFICATION 160 #define CMD_CHANGE_HOST_NOTIFICATION_TIMEPERIOD 161 #define CMD_CHANGE_SVC_NOTIFICATION_TIMEPERIOD 162 #define CMD_CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD 163 #define CMD_CHANGE_CONTACT_SVC_NOTIFICATION_TIMEPERIOD 164 #define CMD_CHANGE_HOST_MODATTR 165 #define CMD_CHANGE_SVC_MODATTR 166 #define CMD_CHANGE_CONTACT_MODATTR 167 #define CMD_CHANGE_CONTACT_MODHATTR 168 #define CMD_CHANGE_CONTACT_MODSATTR 169 /* custom command introduced in Nagios 3.x */ #define CMD_CUSTOM_COMMAND 999 /************************ SERVICE CHECK TYPES ****************************/ #define SERVICE_CHECK_ACTIVE 0 /* Nagios performed the service check */ #define SERVICE_CHECK_PASSIVE 1 /* the service check result was submitted by an external source */ /************************** HOST CHECK TYPES *****************************/ #define HOST_CHECK_ACTIVE 0 /* Nagios performed the host check */ #define HOST_CHECK_PASSIVE 1 /* the host check result was submitted by an external source */ /************************ SERVICE STATE TYPES ****************************/ #define SOFT_STATE 0 #define HARD_STATE 1 /************************* SCHEDULED DOWNTIME TYPES **********************/ #define SERVICE_DOWNTIME 1 /* service downtime */ #define HOST_DOWNTIME 2 /* host downtime */ #define ANY_DOWNTIME 3 /* host or service downtime */ /************************** NOTIFICATION OPTIONS *************************/ #define NOTIFICATION_OPTION_NONE 0 #define NOTIFICATION_OPTION_BROADCAST 1 #define NOTIFICATION_OPTION_FORCED 2 #define NOTIFICATION_OPTION_INCREMENT 4 /************************** ACKNOWLEDGEMENT TYPES ************************/ #define HOST_ACKNOWLEDGEMENT 0 #define SERVICE_ACKNOWLEDGEMENT 1 #define ACKNOWLEDGEMENT_NONE 0 #define ACKNOWLEDGEMENT_NORMAL 1 #define ACKNOWLEDGEMENT_STICKY 2 /**************************** DEPENDENCY TYPES ***************************/ #define NOTIFICATION_DEPENDENCY 1 #define EXECUTION_DEPENDENCY 2 /********************** HOST/SERVICE CHECK OPTIONS ***********************/ #define CHECK_OPTION_NONE 0 /* no check options */ #define CHECK_OPTION_FORCE_EXECUTION 1 /* force execution of a check (ignores disabled services/hosts, invalid timeperiods) */ #define CHECK_OPTION_FRESHNESS_CHECK 2 /* this is a freshness check */ #define CHECK_OPTION_ORPHAN_CHECK 4 /* this is an orphan check */ /**************************** PROGRAM MODES ******************************/ #define STANDBY_MODE 0 #define ACTIVE_MODE 1 /************************** LOG ROTATION MODES ***************************/ #define LOG_ROTATION_NONE 0 #define LOG_ROTATION_HOURLY 1 #define LOG_ROTATION_DAILY 2 #define LOG_ROTATION_WEEKLY 3 #define LOG_ROTATION_MONTHLY 4 /***************************** LOG VERSIONS ******************************/ #define LOG_VERSION_1 "1.0" #define LOG_VERSION_2 "2.0" /*************************** CHECK STATISTICS ****************************/ #define ACTIVE_SCHEDULED_SERVICE_CHECK_STATS 0 #define ACTIVE_ONDEMAND_SERVICE_CHECK_STATS 1 #define PASSIVE_SERVICE_CHECK_STATS 2 #define ACTIVE_SCHEDULED_HOST_CHECK_STATS 3 #define ACTIVE_ONDEMAND_HOST_CHECK_STATS 4 #define PASSIVE_HOST_CHECK_STATS 5 #define ACTIVE_CACHED_HOST_CHECK_STATS 6 #define ACTIVE_CACHED_SERVICE_CHECK_STATS 7 #define EXTERNAL_COMMAND_STATS 8 #define PARALLEL_HOST_CHECK_STATS 9 #define SERIAL_HOST_CHECK_STATS 10 #define MAX_CHECK_STATS_TYPES 11 /************************* GENERAL DEFINITIONS **************************/ #define OK 0 #define ERROR -2 /* value was changed from -1 so as to not interfere with STATUS_UNKNOWN plugin result */ #ifndef TRUE #define TRUE 1 #elif (TRUE!=1) #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #elif (FALSE!=0) #define FALSE 0 #endif /****************** HOST CONFIG FILE READING OPTIONS ********************/ #define READ_HOSTS 1 #define READ_HOSTGROUPS 2 #define READ_CONTACTS 4 #define READ_CONTACTGROUPS 8 #define READ_SERVICES 16 #define READ_COMMANDS 32 #define READ_TIMEPERIODS 64 #define READ_SERVICEESCALATIONS 128 #define READ_HOSTGROUPESCALATIONS 256 /* no longer implemented */ #define READ_SERVICEDEPENDENCIES 512 #define READ_HOSTDEPENDENCIES 1024 #define READ_HOSTESCALATIONS 2048 #define READ_HOSTEXTINFO 4096 #define READ_SERVICEEXTINFO 8192 #define READ_SERVICEGROUPS 16384 #define READ_ALL_OBJECT_DATA READ_HOSTS | READ_HOSTGROUPS | READ_CONTACTS | READ_CONTACTGROUPS | READ_SERVICES | READ_COMMANDS | READ_TIMEPERIODS | READ_SERVICEESCALATIONS | READ_SERVICEDEPENDENCIES | READ_HOSTDEPENDENCIES | READ_HOSTESCALATIONS | READ_HOSTEXTINFO | READ_SERVICEEXTINFO | READ_SERVICEGROUPS /************************** DATE RANGE TYPES ****************************/ #define DATERANGE_CALENDAR_DATE 0 /* 2008-12-25 */ #define DATERANGE_MONTH_DATE 1 /* july 4 (specific month) */ #define DATERANGE_MONTH_DAY 2 /* day 21 (generic month) */ #define DATERANGE_MONTH_WEEK_DAY 3 /* 3rd thursday (specific month) */ #define DATERANGE_WEEK_DAY 4 /* 3rd thursday (generic month) */ #define DATERANGE_TYPES 5 /************************** DATE/TIME TYPES *****************************/ #define LONG_DATE_TIME 0 #define SHORT_DATE_TIME 1 #define SHORT_DATE 2 #define SHORT_TIME 3 #define HTTP_DATE_TIME 4 /* time formatted for use in HTTP headers */ /**************************** DATE FORMATS ******************************/ #define DATE_FORMAT_US 0 /* U.S. (MM-DD-YYYY HH:MM:SS) */ #define DATE_FORMAT_EURO 1 /* European (DD-MM-YYYY HH:MM:SS) */ #define DATE_FORMAT_ISO8601 2 /* ISO8601 (YYYY-MM-DD HH:MM:SS) */ #define DATE_FORMAT_STRICT_ISO8601 3 /* ISO8601 (YYYY-MM-DDTHH:MM:SS) */ /************************** MISC DEFINITIONS ****************************/ #define MAX_FILENAME_LENGTH 256 /* max length of path/filename that Nagios will process */ #define MAX_INPUT_BUFFER 1024 /* size in bytes of max. input buffer (for reading files, misc stuff) */ #define MAX_COMMAND_BUFFER 8192 /* max length of raw or processed command line */ #define MAX_EXTERNAL_COMMAND_LENGTH 8192 /* max length of an external command */ #define MAX_DATETIME_LENGTH 48 /************************* MODIFIED ATTRIBUTES **************************/ #define MODATTR_NONE 0 #define MODATTR_NOTIFICATIONS_ENABLED 1 #define MODATTR_ACTIVE_CHECKS_ENABLED 2 #define MODATTR_PASSIVE_CHECKS_ENABLED 4 #define MODATTR_EVENT_HANDLER_ENABLED 8 #define MODATTR_FLAP_DETECTION_ENABLED 16 #define MODATTR_FAILURE_PREDICTION_ENABLED 32 #define MODATTR_PERFORMANCE_DATA_ENABLED 64 #define MODATTR_OBSESSIVE_HANDLER_ENABLED 128 #define MODATTR_EVENT_HANDLER_COMMAND 256 #define MODATTR_CHECK_COMMAND 512 #define MODATTR_NORMAL_CHECK_INTERVAL 1024 #define MODATTR_RETRY_CHECK_INTERVAL 2048 #define MODATTR_MAX_CHECK_ATTEMPTS 4096 #define MODATTR_FRESHNESS_CHECKS_ENABLED 8192 #define MODATTR_CHECK_TIMEPERIOD 16384 #define MODATTR_CUSTOM_VARIABLE 32768 #define MODATTR_NOTIFICATION_TIMEPERIOD 65536 mod_gearman-1.4.14/include/nagios/perfdata.h0000644001161000116100000000272712213031442015625 00000000000000/***************************************************************************** * * PERFDATA.H - Include file for performance data routines * * Copyright (c) 2001-2005 Ethan Galstad (egalstad@nagios.org) * Last Modified: 11-25-2005 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _PERFDATA_H #define _PERFDATA_H #include "objects.h" #ifdef __cplusplus extern "C" { #endif int initialize_performance_data(char *); /* initializes performance data */ int cleanup_performance_data(char *); /* cleans up performance data */ int update_host_performance_data(host *); /* updates host performance data */ int update_service_performance_data(service *); /* updates service performance data */ #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/Makefile0000644001161000116100000000034612213031442015321 00000000000000############################### # Makefile for Include Files # # Last Modified: 10-18-2007 ############################### clean: rm -f *~ distclean: clean rm -f cgiutils.h config.h locations.h snprintf.h devclean: distclean mod_gearman-1.4.14/include/nagios/.cvsignore0000644001161000116100000000005312213031442015654 00000000000000locations.h config.h snprintf.h cgiutils.h mod_gearman-1.4.14/include/nagios/epn_nagios.h0000644001161000116100000000177612213031442016164 00000000000000/************************************************************************ * * Embedded Perl Header File * Last Modified: 01-15-2009 * ************************************************************************/ /******** BEGIN EMBEDDED PERL INTERPRETER DECLARATIONS ********/ #include #include #include #undef DEBUG /* epn-compiled Nagios spews just - this has a side effect of potentially disabling debug output on epn systems */ #undef ctime /* don't need perl's threaded version */ #undef printf /* can't use perl's printf until initialized */ /* In perl.h (or friends) there is a macro that defines sighandler as Perl_sighandler, so we must #undef it so we can use our sighandler() function */ #undef sighandler /* and we don't need perl's reentrant versions */ #undef localtime #undef getpwnam #undef getgrnam #undef strerror #ifdef aTHX EXTERN_C void xs_init(pTHX); #else EXTERN_C void xs_init(void); #endif /******** END EMBEDDED PERL INTERPRETER DECLARATIONS ********/ mod_gearman-1.4.14/include/nagios/cgiauth.h0000644001161000116100000000422512213031442015456 00000000000000/***************************************************************************** * * CGIAUTH.H - Authorization utilities header file * * Last Modified: 11-24-2005 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _AUTH_H #define _AUTH_H #include "common.h" #include "objects.h" #ifdef __cplusplus extern "C" { #endif typedef struct authdata_struct{ char *username; int authorized_for_all_hosts; int authorized_for_all_host_commands; int authorized_for_all_services; int authorized_for_all_service_commands; int authorized_for_system_information; int authorized_for_system_commands; int authorized_for_configuration_information; int authorized_for_read_only; int authenticated; }authdata; int get_authentication_information(authdata *); /* gets current authentication information */ int is_authorized_for_host(host *,authdata *); int is_authorized_for_service(service *,authdata *); int is_authorized_for_all_hosts(authdata *); int is_authorized_for_all_services(authdata *); int is_authorized_for_system_information(authdata *); int is_authorized_for_system_commands(authdata *); int is_authorized_for_host_commands(host *,authdata *); int is_authorized_for_service_commands(service *,authdata *); int is_authorized_for_hostgroup(hostgroup *,authdata *); int is_authorized_for_servicegroup(servicegroup *,authdata *); int is_authorized_for_configuration_information(authdata *); int is_authorized_for_read_only(authdata *); #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/neberrors.h0000644001161000116100000000430612213031442016033 00000000000000/***************************************************************************** * * NEBERRORS.H - Event broker errors * * Copyright (c) 2003-2006 Ethan Galstad (egalstad@nagios.org) * Last Modified: 12-12-2006 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _NEBERRORS_H #define _NEBERRORS_H /***** GENERIC DEFINES *****/ #define NEB_OK 0 #define NEB_ERROR -1 #define NEB_TRUE 1 #define NEB_FALSE 0 /***** GENERIC ERRORS *****/ #define NEBERROR_NOMEM 100 /* memory could not be allocated */ /***** CALLBACK ERRORS *****/ #define NEBERROR_NOCALLBACKFUNC 200 /* no callback function was specified */ #define NEBERROR_NOCALLBACKLIST 201 /* callback list not initialized */ #define NEBERROR_CALLBACKBOUNDS 202 /* callback type was out of bounds */ #define NEBERROR_CALLBACKNOTFOUND 203 /* the callback could not be found */ #define NEBERROR_NOMODULEHANDLE 204 /* no module handle specified */ #define NEBERROR_BADMODULEHANDLE 205 /* bad module handle */ #define NEBERROR_CALLBACKOVERRIDE 206 /* module wants to override default Nagios handling of event */ #define NEBERROR_CALLBACKCANCEL 207 /* module wants to cancel callbacks to other modules */ /***** MODULE ERRORS *****/ #define NEBERROR_NOMODULE 300 /* no module was specified */ /***** MODULE INFO ERRORS *****/ #define NEBERROR_MODINFOBOUNDS 400 /* module info index was out of bounds */ #endif mod_gearman-1.4.14/include/nagios/getcgi.h0000644001161000116100000000066012213031442015273 00000000000000/****************************************************** * * GETCGI.H - Nagios CGI Input Routine Include File * * Last Modified: 11-25-2005 * *****************************************************/ #ifdef __cplusplus extern "C" { #endif char **getcgivars(void); void free_cgivars(char **); void unescape_cgi_input(char *); void sanitize_cgi_input(char **); unsigned char hex_to_char(char *); #ifdef __cplusplus } #endif mod_gearman-1.4.14/include/nagios/locations.h0000644001161000116100000000462112213031442016025 00000000000000/************************************************************************ * * Nagios Locations Header File * Written By: Ethan Galstad (egalstad@nagios.org) * Last Modified: 04-30-2007 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #define DEFAULT_TEMP_FILE "/usr/local/nagios/var/tempfile" #define DEFAULT_TEMP_PATH "/tmp" #define DEFAULT_CHECK_RESULT_PATH "/usr/local/nagios/var/spool/checkresults" #define DEFAULT_STATUS_FILE "/usr/local/nagios/var/status.dat" #define DEFAULT_LOG_FILE "/usr/local/nagios/var/nagios.log" #define DEFAULT_LOG_ARCHIVE_PATH "/usr/local/nagios/var/archives/" #define DEFAULT_DEBUG_FILE "/usr/local/nagios/var/nagios.debug" #define DEFAULT_COMMENT_FILE "/usr/local/nagios/var/comments.dat" #define DEFAULT_DOWNTIME_FILE "/usr/local/nagios/var/downtime.dat" #define DEFAULT_RETENTION_FILE "/usr/local/nagios/var/retention.dat" #define DEFAULT_COMMAND_FILE "/usr/local/nagios/var/rw/nagios.cmd" #define DEFAULT_CONFIG_FILE "/usr/local/nagios/etc/nagios.cfg" #define DEFAULT_PHYSICAL_HTML_PATH "/usr/local/nagios/share" #define DEFAULT_URL_HTML_PATH "/nagios" #define DEFAULT_PHYSICAL_CGIBIN_PATH "/usr/local/nagios/sbin" #define DEFAULT_URL_CGIBIN_PATH "/nagios/cgi-bin" #define DEFAULT_CGI_CONFIG_FILE "/usr/local/nagios/etc/cgi.cfg" #define DEFAULT_LOCK_FILE "/usr/local/nagios/var/nagios.lock" #define DEFAULT_OBJECT_CACHE_FILE "/usr/local/nagios/var/objects.cache" #define DEFAULT_PRECACHED_OBJECT_FILE "/usr/local/nagios/var/objects.precache" #define DEFAULT_EVENT_BROKER_FILE "/usr/local/nagios/var/broker.socket" #define DEFAULT_P1_FILE "/usr/local/nagios/bin/p1.pl" /**** EMBEDDED PERL ****/ #define DEFAULT_AUTH_FILE "" /**** EMBEDDED PERL - IS THIS USED? ****/ mod_gearman-1.4.14/include/nagios/snprintf.h.in0000644001161000116100000000007112213031442016275 00000000000000/* -*- C -*- */ #undef HAVE_SNPRINTF #undef NEED_VA_LIST mod_gearman-1.4.14/include/nagios/nebcallbacks.h0000644001161000116100000000661512213031442016443 00000000000000/***************************************************************************** * * NEBCALLBACKS.H - Include file for event broker modules * * Copyright (c) 2002-2007 Ethan Galstad (egalstad@nagios.org) * Last Modified: 01-06-2007 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _NEBCALLBACKS_H #define _NEBCALLBACKS_H #include "config.h" #include "nebmodules.h" #ifdef __cplusplus extern "C" { #endif /***** CALLBACK TYPES *****/ #define NEBCALLBACK_NUMITEMS 33 /* total number of callback types we have */ #define NEBCALLBACK_RESERVED0 0 /* reserved for future use */ #define NEBCALLBACK_RESERVED1 1 #define NEBCALLBACK_RESERVED2 2 #define NEBCALLBACK_RESERVED3 3 #define NEBCALLBACK_RESERVED4 4 #define NEBCALLBACK_RAW_DATA 5 #define NEBCALLBACK_NEB_DATA 6 #define NEBCALLBACK_PROCESS_DATA 7 #define NEBCALLBACK_TIMED_EVENT_DATA 8 #define NEBCALLBACK_LOG_DATA 9 #define NEBCALLBACK_SYSTEM_COMMAND_DATA 10 #define NEBCALLBACK_EVENT_HANDLER_DATA 11 #define NEBCALLBACK_NOTIFICATION_DATA 12 #define NEBCALLBACK_SERVICE_CHECK_DATA 13 #define NEBCALLBACK_HOST_CHECK_DATA 14 #define NEBCALLBACK_COMMENT_DATA 15 #define NEBCALLBACK_DOWNTIME_DATA 16 #define NEBCALLBACK_FLAPPING_DATA 17 #define NEBCALLBACK_PROGRAM_STATUS_DATA 18 #define NEBCALLBACK_HOST_STATUS_DATA 19 #define NEBCALLBACK_SERVICE_STATUS_DATA 20 #define NEBCALLBACK_ADAPTIVE_PROGRAM_DATA 21 #define NEBCALLBACK_ADAPTIVE_HOST_DATA 22 #define NEBCALLBACK_ADAPTIVE_SERVICE_DATA 23 #define NEBCALLBACK_EXTERNAL_COMMAND_DATA 24 #define NEBCALLBACK_AGGREGATED_STATUS_DATA 25 #define NEBCALLBACK_RETENTION_DATA 26 #define NEBCALLBACK_CONTACT_NOTIFICATION_DATA 27 #define NEBCALLBACK_CONTACT_NOTIFICATION_METHOD_DATA 28 #define NEBCALLBACK_ACKNOWLEDGEMENT_DATA 29 #define NEBCALLBACK_STATE_CHANGE_DATA 30 #define NEBCALLBACK_CONTACT_STATUS_DATA 31 #define NEBCALLBACK_ADAPTIVE_CONTACT_DATA 32 /***** CALLBACK FUNCTIONS *****/ int neb_register_callback(int callback_type, void *mod_handle, int priority, int (*callback_func)(int,void *)); int neb_deregister_callback(int callback_type, int (*callback_func)(int,void *)); int neb_deregister_module_callbacks(nebmodule *); #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/sretention.h0000644001161000116100000000243212213031442016222 00000000000000/***************************************************************************** * * SRETENTION.H - Header for state retention routines * * Copyright (c) 1999-2006 Ethan Galstad (egalstad@nagios.org) * Last Modified: 02-28-2006 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifdef __cplusplus extern "C" { #endif int initialize_retention_data(char *); int cleanup_retention_data(char *); int save_state_information(int); /* saves all host and state information */ int read_initial_state_information(void); /* reads in initial host and state information */ #ifdef __cplusplus } #endif mod_gearman-1.4.14/include/nagios/nebmods.h0000644001161000116100000000350312213031442015457 00000000000000/***************************************************************************** * * NEBMODS.H - Include file for event broker modules * * Copyright (c) 2002-2005 Ethan Galstad (egalstad@nagios.org) * Last Modified: 11-25-2005 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _NEBMODS_H #define _NEBMODS_H #include "config.h" #include "nebcallbacks.h" #include "nebmodules.h" #ifdef __cplusplus extern "C" { #endif /***** MODULE STRUCTURES *****/ /* NEB module callback list struct */ typedef struct nebcallback_struct{ void *callback_func; void *module_handle; int priority; struct nebcallback_struct *next; }nebcallback; /***** MODULE FUNCTIONS *****/ int neb_init_modules(void); int neb_deinit_modules(void); int neb_load_all_modules(void); int neb_load_module(nebmodule *); int neb_free_module_list(void); int neb_unload_all_modules(int,int); int neb_unload_module(nebmodule *,int,int); int neb_add_module(char *,char *,int); /***** CALLBACK FUNCTIONS *****/ int neb_init_callback_list(void); int neb_free_callback_list(void); int neb_make_callbacks(int,void *); #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/statusdata.h0000644001161000116100000001407212213031442016210 00000000000000/***************************************************************************** * * STATUSDATA.H - Header for external status data routines * * Copyright (c) 2000-2007 Ethan Galstad (egalstad@nagios.org) * Last Modified: 10-19-2007 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************************************/ #ifndef _STATUSDATA_H #define _STATUSDATA_H #ifdef NSCORE #include "objects.h" #endif #ifdef __cplusplus extern "C" { #endif #ifdef NSCGI #define READ_PROGRAM_STATUS 1 #define READ_HOST_STATUS 2 #define READ_SERVICE_STATUS 4 #define READ_CONTACT_STATUS 8 #define READ_ALL_STATUS_DATA READ_PROGRAM_STATUS | READ_HOST_STATUS | READ_SERVICE_STATUS | READ_CONTACT_STATUS /*************************** CHAINED HASH LIMITS ***************************/ #define SERVICESTATUS_HASHSLOTS 1024 #define HOSTSTATUS_HASHSLOTS 1024 /**************************** DATA STRUCTURES ******************************/ /* HOST STATUS structure */ typedef struct hoststatus_struct{ char *host_name; char *plugin_output; char *long_plugin_output; char *perf_data; int status; time_t last_update; int has_been_checked; int should_be_scheduled; int current_attempt; int max_attempts; time_t last_check; time_t next_check; int check_options; int check_type; time_t last_state_change; time_t last_hard_state_change; int last_hard_state; time_t last_time_up; time_t last_time_down; time_t last_time_unreachable; int state_type; time_t last_notification; time_t next_notification; int no_more_notifications; int notifications_enabled; int problem_has_been_acknowledged; int acknowledgement_type; int current_notification_number; int accept_passive_host_checks; int event_handler_enabled; int checks_enabled; int flap_detection_enabled; int is_flapping; double percent_state_change; double latency; double execution_time; int scheduled_downtime_depth; int failure_prediction_enabled; int process_performance_data; int obsess_over_host; struct hoststatus_struct *next; struct hoststatus_struct *nexthash; }hoststatus; /* SERVICE STATUS structure */ typedef struct servicestatus_struct{ char *host_name; char *description; char *plugin_output; char *long_plugin_output; char *perf_data; int max_attempts; int current_attempt; int status; time_t last_update; int has_been_checked; int should_be_scheduled; time_t last_check; time_t next_check; int check_options; int check_type; int checks_enabled; time_t last_state_change; time_t last_hard_state_change; int last_hard_state; time_t last_time_ok; time_t last_time_warning; time_t last_time_unknown; time_t last_time_critical; int state_type; time_t last_notification; time_t next_notification; int no_more_notifications; int notifications_enabled; int problem_has_been_acknowledged; int acknowledgement_type; int current_notification_number; int accept_passive_service_checks; int event_handler_enabled; int flap_detection_enabled; int is_flapping; double percent_state_change; double latency; double execution_time; int scheduled_downtime_depth; int failure_prediction_enabled; int process_performance_data; int obsess_over_service; struct servicestatus_struct *next; struct servicestatus_struct *nexthash; }servicestatus; /*************************** SERVICE STATES ***************************/ #define SERVICE_PENDING 1 #define SERVICE_OK 2 #define SERVICE_WARNING 4 #define SERVICE_UNKNOWN 8 #define SERVICE_CRITICAL 16 /**************************** HOST STATES ****************************/ #define HOST_PENDING 1 #define HOST_UP 2 #define HOST_DOWN 4 #define HOST_UNREACHABLE 8 /**************************** FUNCTIONS ******************************/ int read_status_data(char *,int); /* reads all status data */ int add_host_status(hoststatus *); /* adds a host status entry to the list in memory */ int add_service_status(servicestatus *); /* adds a service status entry to the list in memory */ int add_hoststatus_to_hashlist(hoststatus *); int add_servicestatus_to_hashlist(servicestatus *); servicestatus *find_servicestatus(char *,char *); /* finds status information for a specific service */ hoststatus *find_hoststatus(char *); /* finds status information for a specific host */ int get_servicestatus_count(char *,int); /* gets total number of services of a certain type for a specific host */ void free_status_data(void); /* free all memory allocated to status data */ #endif #ifdef NSCORE int initialize_status_data(char *); /* initializes status data at program start */ int update_all_status_data(void); /* updates all status data */ int cleanup_status_data(char *,int); /* cleans up status data at program termination */ int update_program_status(int); /* updates program status data */ int update_host_status(host *,int); /* updates host status data */ int update_service_status(service *,int); /* updates service status data */ int update_contact_status(contact *,int); /* updates contact status data */ #endif #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/macros.h0000644001161000116100000002436712213031442015327 00000000000000/************************************************************************ * * MACROS.H - Common macro functions * Written By: Ethan Galstad (egalstad@nagios.org) * Last Modified: 10-28-2007 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #ifndef _MACROS_H #define _MACROS_H #include "config.h" #include "common.h" #include "objects.h" /****************** LENGTH LIMITATIONS ****************/ #define MAX_COMMAND_ARGUMENTS 32 /* maximum number of $ARGx$ macros */ /****************** MACRO DEFINITIONS *****************/ #define MACRO_ENV_VAR_PREFIX "NAGIOS_" #define MAX_USER_MACROS 256 /* maximum number of $USERx$ macros */ #define MACRO_X_COUNT 153 /* size of macro_x[] array */ #define MACRO_HOSTNAME 0 #define MACRO_HOSTALIAS 1 #define MACRO_HOSTADDRESS 2 #define MACRO_SERVICEDESC 3 #define MACRO_SERVICESTATE 4 #define MACRO_SERVICESTATEID 5 #define MACRO_SERVICEATTEMPT 6 #define MACRO_LONGDATETIME 7 #define MACRO_SHORTDATETIME 8 #define MACRO_DATE 9 #define MACRO_TIME 10 #define MACRO_TIMET 11 #define MACRO_LASTHOSTCHECK 12 #define MACRO_LASTSERVICECHECK 13 #define MACRO_LASTHOSTSTATECHANGE 14 #define MACRO_LASTSERVICESTATECHANGE 15 #define MACRO_HOSTOUTPUT 16 #define MACRO_SERVICEOUTPUT 17 #define MACRO_HOSTPERFDATA 18 #define MACRO_SERVICEPERFDATA 19 #define MACRO_CONTACTNAME 20 #define MACRO_CONTACTALIAS 21 #define MACRO_CONTACTEMAIL 22 #define MACRO_CONTACTPAGER 23 #define MACRO_ADMINEMAIL 24 #define MACRO_ADMINPAGER 25 #define MACRO_HOSTSTATE 26 #define MACRO_HOSTSTATEID 27 #define MACRO_HOSTATTEMPT 28 #define MACRO_NOTIFICATIONTYPE 29 #define MACRO_NOTIFICATIONNUMBER 30 /* deprecated - see HOSTNOTIFICATIONNUMBER and SERVICENOTIFICATIONNUMBER macros */ #define MACRO_HOSTEXECUTIONTIME 31 #define MACRO_SERVICEEXECUTIONTIME 32 #define MACRO_HOSTLATENCY 33 #define MACRO_SERVICELATENCY 34 #define MACRO_HOSTDURATION 35 #define MACRO_SERVICEDURATION 36 #define MACRO_HOSTDURATIONSEC 37 #define MACRO_SERVICEDURATIONSEC 38 #define MACRO_HOSTDOWNTIME 39 #define MACRO_SERVICEDOWNTIME 40 #define MACRO_HOSTSTATETYPE 41 #define MACRO_SERVICESTATETYPE 42 #define MACRO_HOSTPERCENTCHANGE 43 #define MACRO_SERVICEPERCENTCHANGE 44 #define MACRO_HOSTGROUPNAME 45 #define MACRO_HOSTGROUPALIAS 46 #define MACRO_SERVICEGROUPNAME 47 #define MACRO_SERVICEGROUPALIAS 48 #define MACRO_HOSTACKAUTHOR 49 #define MACRO_HOSTACKCOMMENT 50 #define MACRO_SERVICEACKAUTHOR 51 #define MACRO_SERVICEACKCOMMENT 52 #define MACRO_LASTSERVICEOK 53 #define MACRO_LASTSERVICEWARNING 54 #define MACRO_LASTSERVICEUNKNOWN 55 #define MACRO_LASTSERVICECRITICAL 56 #define MACRO_LASTHOSTUP 57 #define MACRO_LASTHOSTDOWN 58 #define MACRO_LASTHOSTUNREACHABLE 59 #define MACRO_SERVICECHECKCOMMAND 60 #define MACRO_HOSTCHECKCOMMAND 61 #define MACRO_MAINCONFIGFILE 62 #define MACRO_STATUSDATAFILE 63 #define MACRO_HOSTDISPLAYNAME 64 #define MACRO_SERVICEDISPLAYNAME 65 #define MACRO_RETENTIONDATAFILE 66 #define MACRO_OBJECTCACHEFILE 67 #define MACRO_TEMPFILE 68 #define MACRO_LOGFILE 69 #define MACRO_RESOURCEFILE 70 #define MACRO_COMMANDFILE 71 #define MACRO_HOSTPERFDATAFILE 72 #define MACRO_SERVICEPERFDATAFILE 73 #define MACRO_HOSTACTIONURL 74 #define MACRO_HOSTNOTESURL 75 #define MACRO_HOSTNOTES 76 #define MACRO_SERVICEACTIONURL 77 #define MACRO_SERVICENOTESURL 78 #define MACRO_SERVICENOTES 79 #define MACRO_TOTALHOSTSUP 80 #define MACRO_TOTALHOSTSDOWN 81 #define MACRO_TOTALHOSTSUNREACHABLE 82 #define MACRO_TOTALHOSTSDOWNUNHANDLED 83 #define MACRO_TOTALHOSTSUNREACHABLEUNHANDLED 84 #define MACRO_TOTALHOSTPROBLEMS 85 #define MACRO_TOTALHOSTPROBLEMSUNHANDLED 86 #define MACRO_TOTALSERVICESOK 87 #define MACRO_TOTALSERVICESWARNING 88 #define MACRO_TOTALSERVICESCRITICAL 89 #define MACRO_TOTALSERVICESUNKNOWN 90 #define MACRO_TOTALSERVICESWARNINGUNHANDLED 91 #define MACRO_TOTALSERVICESCRITICALUNHANDLED 92 #define MACRO_TOTALSERVICESUNKNOWNUNHANDLED 93 #define MACRO_TOTALSERVICEPROBLEMS 94 #define MACRO_TOTALSERVICEPROBLEMSUNHANDLED 95 #define MACRO_PROCESSSTARTTIME 96 #define MACRO_HOSTCHECKTYPE 97 #define MACRO_SERVICECHECKTYPE 98 #define MACRO_LONGHOSTOUTPUT 99 #define MACRO_LONGSERVICEOUTPUT 100 #define MACRO_TEMPPATH 101 #define MACRO_HOSTNOTIFICATIONNUMBER 102 #define MACRO_SERVICENOTIFICATIONNUMBER 103 #define MACRO_HOSTNOTIFICATIONID 104 #define MACRO_SERVICENOTIFICATIONID 105 #define MACRO_HOSTEVENTID 106 #define MACRO_LASTHOSTEVENTID 107 #define MACRO_SERVICEEVENTID 108 #define MACRO_LASTSERVICEEVENTID 109 #define MACRO_HOSTGROUPNAMES 110 #define MACRO_SERVICEGROUPNAMES 111 #define MACRO_HOSTACKAUTHORNAME 112 #define MACRO_HOSTACKAUTHORALIAS 113 #define MACRO_SERVICEACKAUTHORNAME 114 #define MACRO_SERVICEACKAUTHORALIAS 115 #define MACRO_MAXHOSTATTEMPTS 116 #define MACRO_MAXSERVICEATTEMPTS 117 #define MACRO_SERVICEISVOLATILE 118 #define MACRO_TOTALHOSTSERVICES 119 #define MACRO_TOTALHOSTSERVICESOK 120 #define MACRO_TOTALHOSTSERVICESWARNING 121 #define MACRO_TOTALHOSTSERVICESUNKNOWN 122 #define MACRO_TOTALHOSTSERVICESCRITICAL 123 #define MACRO_HOSTGROUPNOTES 124 #define MACRO_HOSTGROUPNOTESURL 125 #define MACRO_HOSTGROUPACTIONURL 126 #define MACRO_SERVICEGROUPNOTES 127 #define MACRO_SERVICEGROUPNOTESURL 128 #define MACRO_SERVICEGROUPACTIONURL 129 #define MACRO_HOSTGROUPMEMBERS 130 #define MACRO_SERVICEGROUPMEMBERS 131 #define MACRO_CONTACTGROUPNAME 132 #define MACRO_CONTACTGROUPALIAS 133 #define MACRO_CONTACTGROUPMEMBERS 134 #define MACRO_CONTACTGROUPNAMES 135 #define MACRO_NOTIFICATIONRECIPIENTS 136 #define MACRO_NOTIFICATIONISESCALATED 137 #define MACRO_NOTIFICATIONAUTHOR 138 #define MACRO_NOTIFICATIONAUTHORNAME 139 #define MACRO_NOTIFICATIONAUTHORALIAS 140 #define MACRO_NOTIFICATIONCOMMENT 141 #define MACRO_EVENTSTARTTIME 142 #define MACRO_HOSTPROBLEMID 143 #define MACRO_LASTHOSTPROBLEMID 144 #define MACRO_SERVICEPROBLEMID 145 #define MACRO_LASTSERVICEPROBLEMID 146 #define MACRO_ISVALIDTIME 147 #define MACRO_NEXTVALIDTIME 148 #define MACRO_LASTHOSTSTATE 149 #define MACRO_LASTHOSTSTATEID 150 #define MACRO_LASTSERVICESTATE 151 #define MACRO_LASTSERVICESTATEID 152 /************* MACRO CLEANING OPTIONS *****************/ #define STRIP_ILLEGAL_MACRO_CHARS 1 #define ESCAPE_MACRO_CHARS 2 #define URL_ENCODE_MACRO_CHARS 4 /****************** MACRO FUNCTIONS ******************/ int process_macros(char *,char **,int); /* replace macros with their actual values */ char *clean_macro_chars(char *,int); /* cleans macros characters before insertion into output string */ int grab_service_macros(service *); /* updates the service macro data */ int grab_host_macros(host *); /* updates the host macro data */ int grab_servicegroup_macros(servicegroup *); /* updates servicegroup macros */ int grab_hostgroup_macros(hostgroup *); /* updates hostgroup macros */ int grab_contact_macros(contact *); /* updates the contact macro data */ int grab_contactgroup_macros(contactgroup *); /* updates contactgroup macros */ int grab_datetime_macros(void); /* updates date/time macros */ int grab_on_demand_macro(char *); /* fetches an on-demand macro */ char *get_url_encoded_string(char *); /* URL encode a string */ int init_macros(void); int init_macrox_names(void); int add_macrox_name(int,char *); int free_macrox_names(void); int clear_argv_macros(void); int clear_volatile_macros(void); int clear_host_macros(void); int clear_service_macros(void); int clear_hostgroup_macros(void); int clear_servicegroup_macros(void); int clear_contact_macros(void); int clear_contactgroup_macros(void); int clear_summary_macros(void); int grab_macro_value(char *,char **,int *,int *); int grab_macrox_value(int,char *,char *,char **,int *); int grab_custom_macro_value(char *,char *,char *,char **); int grab_datetime_macro(int,char *,char *,char **); int grab_standard_host_macro(int,host *,char **,int *); int grab_standard_hostgroup_macro(int,hostgroup *,char **); int grab_standard_service_macro(int,service *,char **,int *); int grab_standard_servicegroup_macro(int,servicegroup *,char **); int grab_standard_contact_macro(int,contact *,char **); int grab_contact_address_macro(int,contact *,char **); int grab_standard_contactgroup_macro(int,contactgroup *,char **); int grab_custom_object_macro(char *,customvariablesmember *,char **); #ifdef NSCORE int set_all_macro_environment_vars(int); int set_macrox_environment_vars(int); int set_argv_macro_environment_vars(int); int set_custom_macro_environment_vars(int); int set_contact_address_environment_vars(int); int set_macro_environment_var(char *,char *,int); #endif #endif mod_gearman-1.4.14/include/nagios/cgiutils.h0000644001161000116100000004354612213031442015666 00000000000000/* include/cgiutils.h. Generated from cgiutils.h.in by configure. */ /************************************************************************ * * CGIUTILS.H - Header file for common CGI functions * Copyright (c) 1999-2008 Ethan Galstad (egalstad@nagios.org) * Last Modified: 10-15-2008 * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #ifndef _CGIUTILS_H #define _CGIUTILS_H #include "objects.h" #include "cgiauth.h" #ifdef __cplusplus extern "C" { #endif /* should we compile and use the statusmap CGI? */ #define USE_STATUSMAP /* should we compile and use the statuswrl CGI? */ #define USE_STATUSWRL /* should we compile and use the trends CGI? */ #define USE_TRENDS /* should we compile and use the histogram CGI? */ #define USE_HISTOGRAM /**************************** CGI REFRESH RATE ******************************/ #define DEFAULT_REFRESH_RATE 60 /* 60 second refresh rate for CGIs */ /******************************* CGI NAMES **********************************/ #define STATUS_CGI "status.cgi" #define STATUSMAP_CGI "statusmap.cgi" #define STATUSWORLD_CGI "statuswrl.cgi" #define COMMAND_CGI "cmd.cgi" #define EXTINFO_CGI "extinfo.cgi" #define SHOWLOG_CGI "showlog.cgi" #define NOTIFICATIONS_CGI "notifications.cgi" #define HISTORY_CGI "history.cgi" #define CONFIG_CGI "config.cgi" #define OUTAGES_CGI "outages.cgi" #define TRENDS_CGI "trends.cgi" #define AVAIL_CGI "avail.cgi" #define TAC_CGI "tac.cgi" #define STATUSWML_CGI "statuswml.cgi" #define TRACEROUTE_CGI "traceroute.cgi" #define HISTOGRAM_CGI "histogram.cgi" #define CHECKSANITY_CGI "checksanity.cgi" #define MINISTATUS_CGI "ministatus.cgi" #define SUMMARY_CGI "summary.cgi" /**************************** STYLE SHEET NAMES ******************************/ #define COMMON_CSS "common.css" #define SHOWLOG_CSS "showlog.css" #define STATUS_CSS "status.css" #define STATUSMAP_CSS "statusmap.css" #define COMMAND_CSS "cmd.css" #define EXTINFO_CSS "extinfo.css" #define NOTIFICATIONS_CSS "notifications.css" #define HISTORY_CSS "history.css" #define CONFIG_CSS "config.css" #define OUTAGES_CSS "outages.css" #define TRENDS_CSS "trends.css" #define AVAIL_CSS "avail.css" #define TAC_CSS "tac.css" #define HISTOGRAM_CSS "histogram.css" #define CHECKSANITY_CSS "checksanity.css" #define MINISTATUS_CSS "ministatus.css" #define SUMMARY_CSS "summary.css" /********************************* ICONS ************************************/ #define STATUS_ICON_WIDTH 20 #define STATUS_ICON_HEIGHT 20 #define INFO_ICON "info.png" #define INFO_ICON_ALT "Informational Message" #define START_ICON "start.gif" #define START_ICON_ALT "Program Start" #define STOP_ICON "stop.gif" #define STOP_ICON_ALT "Program End" #define RESTART_ICON "restart.gif" #define RESTART_ICON_ALT "Program Restart" #define OK_ICON "recovery.png" #define OK_ICON_ALT "Service Ok" #define CRITICAL_ICON "critical.png" #define CRITICAL_ICON_ALT "Service Critical" #define WARNING_ICON "warning.png" #define WARNING_ICON_ALT "Service Warning" #define UNKNOWN_ICON "unknown.png" #define UNKNOWN_ICON_ALT "Service Unknown" #define NOTIFICATION_ICON "notify.gif" #define NOTIFICATION_ICON_ALT "Service Notification" #define LOG_ROTATION_ICON "logrotate.png" #define LOG_ROTATION_ICON_ALT "Log Rotation" #define EXTERNAL_COMMAND_ICON "command.png" #define EXTERNAL_COMMAND_ICON_ALT "External Command" #define STATUS_DETAIL_ICON "status2.gif" #define STATUS_OVERVIEW_ICON "status.gif" #define STATUSMAP_ICON "status3.gif" #define STATUSWORLD_ICON "status4.gif" #define EXTINFO_ICON "extinfo.gif" #define HISTORY_ICON "history.gif" #define CONTACTGROUP_ICON "contactgroup.gif" #define TRENDS_ICON "trends.gif" #define DISABLED_ICON "disabled.gif" #define ENABLED_ICON "enabled.gif" #define PASSIVE_ONLY_ICON "passiveonly.gif" #define NOTIFICATIONS_DISABLED_ICON "ndisabled.gif" #define ACKNOWLEDGEMENT_ICON "ack.gif" #define REMOVE_ACKNOWLEDGEMENT_ICON "noack.gif" #define COMMENT_ICON "comment.gif" #define DELETE_ICON "delete.gif" #define DELAY_ICON "delay.gif" #define DOWNTIME_ICON "downtime.gif" #define PASSIVE_ICON "passiveonly.gif" #define RIGHT_ARROW_ICON "right.gif" #define LEFT_ARROW_ICON "left.gif" #define UP_ARROW_ICON "up.gif" #define DOWN_ARROW_ICON "down.gif" #define FLAPPING_ICON "flapping.gif" #define SCHEDULED_DOWNTIME_ICON "downtime.gif" #define EMPTY_ICON "empty.gif" #define ACTIVE_ICON "active.gif" #define ACTIVE_ICON_ALT "Active Mode" #define STANDBY_ICON "standby.gif" #define STANDBY_ICON_ALT "Standby Mode" #define HOST_DOWN_ICON "critical.png" #define HOST_DOWN_ICON_ALT "Host Down" #define HOST_UNREACHABLE_ICON "critical.png" #define HOST_UNREACHABLE_ICON_ALT "Host Unreachable" #define HOST_UP_ICON "recovery.png" #define HOST_UP_ICON_ALT "Host Up" #define HOST_NOTIFICATION_ICON "notify.gif" #define HOST_NOTIFICATION_ICON_ALT "Host Notification" #define SERVICE_EVENT_ICON "serviceevent.gif" #define SERVICE_EVENT_ICON_ALT "Service Event Handler" #define HOST_EVENT_ICON "hostevent.gif" #define HOST_EVENT_ICON_ALT "Host Event Handler" #define THERM_OK_IMAGE "thermok.png" #define THERM_WARNING_IMAGE "thermwarn.png" #define THERM_CRITICAL_IMAGE "thermcrit.png" #define CONFIGURATION_ICON "config.gif" #define NOTES_ICON "notes.gif" #define ACTION_ICON "action.gif" #define DETAIL_ICON "detail.gif" #define PARENT_TRAVERSAL_ICON "parentup.gif" #define TAC_DISABLED_ICON "tacdisabled.png" #define TAC_ENABLED_ICON "tacenabled.png" #define ZOOM1_ICON "zoom1.gif" #define ZOOM2_ICON "zoom2.gif" #define CONTEXT_HELP_ICON1 "contexthelp1.gif" #define CONTEXT_HELP_ICON2 "contexthelp2.gif" #define SPLUNK_SMALL_WHITE_ICON "splunk1.gif" #define SPLUNK_SMALL_BLACK_ICON "splunk2.gif" /************************** PLUGIN RETURN VALUES ****************************/ #define STATE_OK 0 #define STATE_WARNING 1 #define STATE_CRITICAL 2 #define STATE_UNKNOWN 3 /* changed from -1 on 02/24/2001 */ /********************* EXTENDED INFO CGI DISPLAY TYPES *********************/ #define DISPLAY_PROCESS_INFO 0 #define DISPLAY_HOST_INFO 1 #define DISPLAY_SERVICE_INFO 2 #define DISPLAY_COMMENTS 3 #define DISPLAY_PERFORMANCE 4 #define DISPLAY_HOSTGROUP_INFO 5 #define DISPLAY_DOWNTIME 6 #define DISPLAY_SCHEDULING_QUEUE 7 #define DISPLAY_SERVICEGROUP_INFO 8 /************************ COMMAND CGI COMMAND MODES *************************/ #define CMDMODE_NONE 0 #define CMDMODE_REQUEST 1 #define CMDMODE_COMMIT 2 /******************** HOST AND SERVICE NOTIFICATION TYPES ******************/ #define NOTIFICATION_ALL 0 /* all service and host notifications */ #define NOTIFICATION_SERVICE_ALL 1 /* all types of service notifications */ #define NOTIFICATION_HOST_ALL 2 /* all types of host notifications */ #define NOTIFICATION_SERVICE_WARNING 4 #define NOTIFICATION_SERVICE_UNKNOWN 8 #define NOTIFICATION_SERVICE_CRITICAL 16 #define NOTIFICATION_SERVICE_RECOVERY 32 #define NOTIFICATION_HOST_DOWN 64 #define NOTIFICATION_HOST_UNREACHABLE 128 #define NOTIFICATION_HOST_RECOVERY 256 #define NOTIFICATION_SERVICE_ACK 512 #define NOTIFICATION_HOST_ACK 1024 #define NOTIFICATION_SERVICE_FLAP 2048 #define NOTIFICATION_HOST_FLAP 4096 #define NOTIFICATION_SERVICE_CUSTOM 8192 #define NOTIFICATION_HOST_CUSTOM 16384 /********************** HOST AND SERVICE ALERT TYPES **********************/ #define HISTORY_ALL 0 /* all service and host alert */ #define HISTORY_SERVICE_ALL 1 /* all types of service alerts */ #define HISTORY_HOST_ALL 2 /* all types of host alerts */ #define HISTORY_SERVICE_WARNING 4 #define HISTORY_SERVICE_UNKNOWN 8 #define HISTORY_SERVICE_CRITICAL 16 #define HISTORY_SERVICE_RECOVERY 32 #define HISTORY_HOST_DOWN 64 #define HISTORY_HOST_UNREACHABLE 128 #define HISTORY_HOST_RECOVERY 256 /****************************** SORT TYPES *******************************/ #define SORT_NONE 0 #define SORT_ASCENDING 1 #define SORT_DESCENDING 2 /***************************** SORT OPTIONS ******************************/ #define SORT_NOTHING 0 #define SORT_HOSTNAME 1 #define SORT_SERVICENAME 2 #define SORT_SERVICESTATUS 3 #define SORT_LASTCHECKTIME 4 #define SORT_CURRENTATTEMPT 5 #define SORT_STATEDURATION 6 #define SORT_NEXTCHECKTIME 7 #define SORT_HOSTSTATUS 8 /****************** HOST AND SERVICE FILTER PROPERTIES *******************/ #define HOST_SCHEDULED_DOWNTIME 1 #define HOST_NO_SCHEDULED_DOWNTIME 2 #define HOST_STATE_ACKNOWLEDGED 4 #define HOST_STATE_UNACKNOWLEDGED 8 #define HOST_CHECKS_DISABLED 16 #define HOST_CHECKS_ENABLED 32 #define HOST_EVENT_HANDLER_DISABLED 64 #define HOST_EVENT_HANDLER_ENABLED 128 #define HOST_FLAP_DETECTION_DISABLED 256 #define HOST_FLAP_DETECTION_ENABLED 512 #define HOST_IS_FLAPPING 1024 #define HOST_IS_NOT_FLAPPING 2048 #define HOST_NOTIFICATIONS_DISABLED 4096 #define HOST_NOTIFICATIONS_ENABLED 8192 #define HOST_PASSIVE_CHECKS_DISABLED 16384 #define HOST_PASSIVE_CHECKS_ENABLED 32768 #define HOST_PASSIVE_CHECK 65536 #define HOST_ACTIVE_CHECK 131072 #define HOST_HARD_STATE 262144 #define HOST_SOFT_STATE 524288 #define SERVICE_SCHEDULED_DOWNTIME 1 #define SERVICE_NO_SCHEDULED_DOWNTIME 2 #define SERVICE_STATE_ACKNOWLEDGED 4 #define SERVICE_STATE_UNACKNOWLEDGED 8 #define SERVICE_CHECKS_DISABLED 16 #define SERVICE_CHECKS_ENABLED 32 #define SERVICE_EVENT_HANDLER_DISABLED 64 #define SERVICE_EVENT_HANDLER_ENABLED 128 #define SERVICE_FLAP_DETECTION_ENABLED 256 #define SERVICE_FLAP_DETECTION_DISABLED 512 #define SERVICE_IS_FLAPPING 1024 #define SERVICE_IS_NOT_FLAPPING 2048 #define SERVICE_NOTIFICATIONS_DISABLED 4096 #define SERVICE_NOTIFICATIONS_ENABLED 8192 #define SERVICE_PASSIVE_CHECKS_DISABLED 16384 #define SERVICE_PASSIVE_CHECKS_ENABLED 32768 #define SERVICE_PASSIVE_CHECK 65536 #define SERVICE_ACTIVE_CHECK 131072 #define SERVICE_HARD_STATE 262144 #define SERVICE_SOFT_STATE 524288 /****************************** SSI TYPES ********************************/ #define SSI_HEADER 0 #define SSI_FOOTER 1 /************************ CONTEXT-SENSITIVE HELP *************************/ #define CONTEXTHELP_STATUS_DETAIL "A1" #define CONTEXTHELP_STATUS_HGOVERVIEW "A2" #define CONTEXTHELP_STATUS_HGSUMMARY "A3" #define CONTEXTHELP_STATUS_HGGRID "A4" #define CONTEXTHELP_STATUS_SVCPROBLEMS "A5" #define CONTEXTHELP_STATUS_HOST_DETAIL "A6" #define CONTEXTHELP_STATUS_HOSTPROBLEMS "A7" #define CONTEXTHELP_STATUS_SGOVERVIEW "A8" #define CONTEXTHELP_STATUS_SGSUMMARY "A9" #define CONTEXTHELP_STATUS_SGGRID "A10" #define CONTEXTHELP_TAC "B1" #define CONTEXTHELP_MAP "C1" #define CONTEXTHELP_LOG "D1" #define CONTEXTHELP_HISTORY "E1" #define CONTEXTHELP_NOTIFICATIONS "F1" #define CONTEXTHELP_TRENDS_MENU1 "G1" #define CONTEXTHELP_TRENDS_MENU2 "G2" #define CONTEXTHELP_TRENDS_MENU3 "G3" #define CONTEXTHELP_TRENDS_MENU4 "G4" #define CONTEXTHELP_TRENDS_HOST "G5" #define CONTEXTHELP_TRENDS_SERVICE "G6" #define CONTEXTHELP_AVAIL_MENU1 "H1" #define CONTEXTHELP_AVAIL_MENU2 "H2" #define CONTEXTHELP_AVAIL_MENU3 "H3" #define CONTEXTHELP_AVAIL_MENU4 "H4" #define CONTEXTHELP_AVAIL_MENU5 "H5" #define CONTEXTHELP_AVAIL_HOSTGROUP "H6" #define CONTEXTHELP_AVAIL_HOST "H7" #define CONTEXTHELP_AVAIL_SERVICE "H8" #define CONTEXTHELP_AVAIL_SERVICEGROUP "H9" #define CONTEXTHELP_EXT_HOST "I1" #define CONTEXTHELP_EXT_SERVICE "I2" #define CONTEXTHELP_EXT_HOSTGROUP "I3" #define CONTEXTHELP_EXT_PROCESS "I4" #define CONTEXTHELP_EXT_PERFORMANCE "I5" #define CONTEXTHELP_EXT_COMMENTS "I6" #define CONTEXTHELP_EXT_DOWNTIME "I7" #define CONTEXTHELP_EXT_QUEUE "I8" #define CONTEXTHELP_EXT_SERVICEGROUP "I9" #define CONTEXTHELP_CMD_INPUT "J1" #define CONTEXTHELP_CMD_COMMIT "J2" #define CONTEXTHELP_OUTAGES "K1" #define CONTEXTHELP_CONFIG_MENU "L1" #define CONTEXTHELP_CONFIG_HOSTS "L2" #define CONTEXTHELP_CONFIG_HOSTDEPENDENCIES "L3" #define CONTEXTHELP_CONFIG_HOSTESCALATIONS "L4" #define CONTEXTHELP_CONFIG_HOSTGROUPS "L5" #define CONTEXTHELP_CONFIG_HOSTGROUPESCALATIONS "L6" #define CONTEXTHELP_CONFIG_SERVICES "L7" #define CONTEXTHELP_CONFIG_SERVICEDEPENDENCIES "L8" #define CONTEXTHELP_CONFIG_SERVICEESCALATIONS "L9" #define CONTEXTHELP_CONFIG_CONTACTS "L10" #define CONTEXTHELP_CONFIG_CONTACTGROUPS "L11" #define CONTEXTHELP_CONFIG_TIMEPERIODS "L12" #define CONTEXTHELP_CONFIG_COMMANDS "L13" #define CONTEXTHELP_CONFIG_HOSTEXTINFO "L14" #define CONTEXTHELP_CONFIG_SERVICEEXTINFO "L15" #define CONTEXTHELP_CONFIG_SERVICEGROUPS "L16" #define CONTEXTHELP_HISTOGRAM_MENU1 "M1" #define CONTEXTHELP_HISTOGRAM_MENU2 "M2" #define CONTEXTHELP_HISTOGRAM_MENU3 "M3" #define CONTEXTHELP_HISTOGRAM_MENU4 "M4" #define CONTEXTHELP_HISTOGRAM_HOST "M5" #define CONTEXTHELP_HISTOGRAM_SERVICE "M6" #define CONTEXTHELP_SUMMARY_MENU "N1" #define CONTEXTHELP_SUMMARY_RECENT_ALERTS "N2" #define CONTEXTHELP_SUMMARY_ALERT_TOTALS "N3" #define CONTEXTHELP_SUMMARY_HOSTGROUP_ALERT_TOTALS "N4" #define CONTEXTHELP_SUMMARY_HOST_ALERT_TOTALS "N5" #define CONTEXTHELP_SUMMARY_SERVICE_ALERT_TOTALS "N6" #define CONTEXTHELP_SUMMARY_ALERT_PRODUCERS "N7" #define CONTEXTHELP_SUMMARY_SERVICEGROUP_ALERT_TOTALS "N8" /************************** LIFO RETURN CODES ****************************/ #define LIFO_OK 0 #define LIFO_ERROR_MEMORY 1 #define LIFO_ERROR_FILE 2 #define LIFO_ERROR_DATA 3 /*************************** DATA STRUCTURES *****************************/ /* LIFO data structure */ typedef struct lifo_struct{ char *data; struct lifo_struct *next; }lifo; /* MMAPFILE structure - used for reading files via mmap() */ typedef struct mmapfile_struct{ char *path; int mode; int fd; unsigned long file_size; unsigned long current_position; unsigned long current_line; void *mmap_buf; }mmapfile; /******************************** FUNCTIONS *******************************/ void reset_cgi_vars(void); void free_cgi_vars(void); void free_memory(void); char * get_cgi_config_location(void); /* gets location of the CGI config file to read */ char * get_cmd_file_location(void); /* gets location of external command file to write to */ int read_cgi_config_file(char *); int read_main_config_file(char *); int read_all_object_configuration_data(char *,int); int read_all_status_data(char *,int); int hashfunc(const char *name1, const char *name2, int hashslots); int compare_hashdata(const char *,const char *,const char *,const char *); void strip(char *); /* strips newlines, carriage returns, and spaces from end of buffer */ char *unescape_newlines(char *); void sanitize_plugin_output(char *); /* strips HTML and bad characters from plugin output */ void strip_html_brackets(char *); /* strips > and < from string */ int process_macros(char *,char **,int); /* processes macros in a string */ void get_time_string(time_t *,char *,int,int); /* gets a date/time string */ void get_datetime_string(time_t *,char *,int,int); void get_interval_time_string(double,char *,int); /* gets a time string for an interval of time */ void get_expire_time_string(time_t *,char *,int); /* gets a date/time string in the format used for Expire: tags*/ char * my_strtok(char *,char *); /* replacement for strtok() function - doesn't skip multiple tokens */ char * my_strsep (char **, const char *); #ifdef REMOVED_10182007 int my_free(void **); /* my wrapper for free() */ #endif char * url_encode(char *); /* encodes a string in proper URL format */ char * html_encode(char *,int); /* encodes a string in HTML format (for what the user sees) */ char * escape_string(char *); /* escape string for html form usage */ void get_time_breakdown(unsigned long,int *,int *,int *,int *); /* given total seconds, get days, hours, minutes, seconds */ void get_log_archive_to_use(int,char *,int); /* determines the name of the log archive to use */ void determine_log_rotation_times(int); int determine_archive_to_use_from_time(time_t); void print_extra_hostgroup_url(char *,char *); void print_extra_servicegroup_url(char *,char *); void display_info_table(char *,int,authdata *); void display_nav_table(char *,int); void display_splunk_host_url(host *); void display_splunk_service_url(service *); void display_splunk_generic_url(char *,int); void strip_splunk_query_terms(char *); void include_ssi_files(char *,int); /* include user-defined SSI footers/headers */ void include_ssi_file(char *); /* include user-defined SSI footer/header */ void cgi_config_file_error(char *); void main_config_file_error(char *); void object_data_error(void); void status_data_error(void); void display_context_help(char *); /* displays context-sensitive help window */ int read_file_into_lifo(char *); /* LIFO functions */ void free_lifo_memory(void); int push_lifo(char *); char *pop_lifo(void); mmapfile *mmap_fopen(char *); /* open a file read-only using mmap() */ int mmap_fclose(mmapfile *); char *mmap_fgets(mmapfile *); char *mmap_fgets_multiline(mmapfile *); #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/nagios.h0000644001161000116100000012666112213031442015323 00000000000000/************************************************************************ * * Nagios Main Header File * Written By: Ethan Galstad (egalstad@nagios.org) * Last Modified: 12-14-2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #ifndef _NAGIOS_H #define _NAGIOS_H #ifndef __GNUC__ # define __attribute__(x) /* nothing */ #endif #include "config.h" #include "common.h" #include "locations.h" #include "objects.h" #ifdef __cplusplus extern "C" { #endif /************* MISC LENGTH/SIZE DEFINITIONS ***********/ /* NOTE: Plugin length is artificially capped at 8k to prevent runaway plugins from returning MBs/GBs of data back to Nagios. If you increase the 8k cap by modifying this value, make sure you also increase the value of MAX_EXTERNAL_COMMAND_LENGTH in common.h to allow for passive checks results received through the external command file. EG 10/19/07 */ #define MAX_PLUGIN_OUTPUT_LENGTH 8192 /* max length of plugin output (including perf data) */ /******************* DEFAULT VALUES *******************/ #define DEFAULT_LOG_LEVEL 1 /* log all events to main log file */ #define DEFAULT_USE_SYSLOG 1 /* log events to syslog? 1=yes, 0=no */ #define DEFAULT_SYSLOG_LEVEL 2 /* log only severe events to syslog */ #define DEFAULT_NOTIFICATION_LOGGING 1 /* log notification events? 1=yes, 0=no */ #define DEFAULT_INTER_CHECK_DELAY 5.0 /* seconds between initial service check scheduling */ #define DEFAULT_INTERLEAVE_FACTOR 1 /* default interleave to use when scheduling checks */ #define DEFAULT_SLEEP_TIME 0.5 /* seconds between event run checks */ #define DEFAULT_INTERVAL_LENGTH 60 /* seconds per interval unit for check scheduling */ #define DEFAULT_RETRY_INTERVAL 30 /* services are retried in 30 seconds if they're not OK */ #define DEFAULT_COMMAND_CHECK_INTERVAL -1 /* interval to check for external commands (default = as often as possible) */ #define DEFAULT_CHECK_REAPER_INTERVAL 10 /* interval in seconds to reap host and service check results */ #define DEFAULT_MAX_REAPER_TIME 30 /* maximum number of seconds to spend reaping service checks before we break out for a while */ #define DEFAULT_MAX_CHECK_RESULT_AGE 3600 /* maximum number of seconds that a check result file is considered to be valid */ #define DEFAULT_MAX_PARALLEL_SERVICE_CHECKS 0 /* maximum number of service checks we can have running at any given time (0=unlimited) */ #define DEFAULT_RETENTION_UPDATE_INTERVAL 60 /* minutes between auto-save of retention data */ #define DEFAULT_RETENTION_SCHEDULING_HORIZON 900 /* max seconds between program restarts that we will preserve scheduling information */ #define DEFAULT_STATUS_UPDATE_INTERVAL 60 /* seconds between aggregated status data updates */ #define DEFAULT_FRESHNESS_CHECK_INTERVAL 60 /* seconds between service result freshness checks */ #define DEFAULT_AUTO_RESCHEDULING_INTERVAL 30 /* seconds between host and service check rescheduling events */ #define DEFAULT_AUTO_RESCHEDULING_WINDOW 180 /* window of time (in seconds) for which we should reschedule host and service checks */ #define DEFAULT_ORPHAN_CHECK_INTERVAL 60 /* seconds between checks for orphaned hosts and services */ #define DEFAULT_NOTIFICATION_TIMEOUT 30 /* max time in seconds to wait for notification commands to complete */ #define DEFAULT_EVENT_HANDLER_TIMEOUT 30 /* max time in seconds to wait for event handler commands to complete */ #define DEFAULT_HOST_CHECK_TIMEOUT 30 /* max time in seconds to wait for host check commands to complete */ #define DEFAULT_SERVICE_CHECK_TIMEOUT 60 /* max time in seconds to wait for service check commands to complete */ #define DEFAULT_OCSP_TIMEOUT 15 /* max time in seconds to wait for obsessive compulsive processing commands to complete */ #define DEFAULT_OCHP_TIMEOUT 15 /* max time in seconds to wait for obsessive compulsive processing commands to complete */ #define DEFAULT_PERFDATA_TIMEOUT 5 /* max time in seconds to wait for performance data commands to complete */ #define DEFAULT_TIME_CHANGE_THRESHOLD 900 /* compensate for time changes of more than 15 minutes */ #define DEFAULT_LOG_HOST_RETRIES 0 /* don't log host retries */ #define DEFAULT_LOG_SERVICE_RETRIES 0 /* don't log service retries */ #define DEFAULT_LOG_EVENT_HANDLERS 1 /* log event handlers */ #define DEFAULT_LOG_INITIAL_STATES 0 /* don't log initial service and host states */ #define DEFAULT_LOG_EXTERNAL_COMMANDS 1 /* log external commands */ #define DEFAULT_LOG_PASSIVE_CHECKS 1 /* log passive service checks */ #define DEFAULT_DEBUG_LEVEL 0 /* don't log any debugging information */ #define DEFAULT_DEBUG_VERBOSITY 1 #define DEFAULT_MAX_DEBUG_FILE_SIZE 1000000 /* max size of debug log */ #define DEFAULT_AGGRESSIVE_HOST_CHECKING 0 /* don't use "aggressive" host checking */ #define DEFAULT_CHECK_EXTERNAL_COMMANDS 1 /* check for external commands */ #define DEFAULT_CHECK_ORPHANED_SERVICES 1 /* check for orphaned services */ #define DEFAULT_CHECK_ORPHANED_HOSTS 1 /* check for orphaned hosts */ #define DEFAULT_ENABLE_FLAP_DETECTION 0 /* don't enable flap detection */ #define DEFAULT_PROCESS_PERFORMANCE_DATA 0 /* don't process performance data */ #define DEFAULT_CHECK_SERVICE_FRESHNESS 1 /* check service result freshness */ #define DEFAULT_CHECK_HOST_FRESHNESS 0 /* don't check host result freshness */ #define DEFAULT_AUTO_RESCHEDULE_CHECKS 0 /* don't auto-reschedule host and service checks */ #define DEFAULT_TRANSLATE_PASSIVE_HOST_CHECKS 0 /* should we translate DOWN/UNREACHABLE passive host checks? */ #define DEFAULT_PASSIVE_HOST_CHECKS_SOFT 0 /* passive host checks are treated as HARD by default */ #define DEFAULT_LOW_SERVICE_FLAP_THRESHOLD 20.0 /* low threshold for detection of service flapping */ #define DEFAULT_HIGH_SERVICE_FLAP_THRESHOLD 30.0 /* high threshold for detection of service flapping */ #define DEFAULT_LOW_HOST_FLAP_THRESHOLD 20.0 /* low threshold for detection of host flapping */ #define DEFAULT_HIGH_HOST_FLAP_THRESHOLD 30.0 /* high threshold for detection of host flapping */ #define DEFAULT_HOST_CHECK_SPREAD 30 /* max minutes to schedule all initial host checks */ #define DEFAULT_SERVICE_CHECK_SPREAD 30 /* max minutes to schedule all initial service checks */ #define DEFAULT_CACHED_HOST_CHECK_HORIZON 15 /* max age in seconds that cached host checks can be used */ #define DEFAULT_CACHED_SERVICE_CHECK_HORIZON 15 /* max age in seconds that cached service checks can be used */ #define DEFAULT_ENABLE_PREDICTIVE_HOST_DEPENDENCY_CHECKS 1 /* should we use predictive host dependency checks? */ #define DEFAULT_ENABLE_PREDICTIVE_SERVICE_DEPENDENCY_CHECKS 1 /* should we use predictive service dependency checks? */ #define DEFAULT_USE_LARGE_INSTALLATION_TWEAKS 0 /* don't use tweaks for large Nagios installations */ #define DEFAULT_ENABLE_EMBEDDED_PERL 0 /* enable embedded Perl interpreter (if compiled in) */ #define DEFAULT_USE_EMBEDDED_PERL_IMPLICITLY 1 /* by default, embedded Perl is used for Perl plugins that don't explicitly disable it */ #define DEFAULT_ADDITIONAL_FRESHNESS_LATENCY 15 /* seconds to be added to freshness thresholds when automatically calculated by Nagios */ #define DEFAULT_CHECK_FOR_UPDATES 1 /* should we check for new Nagios releases? */ #define DEFAULT_BARE_UPDATE_CHECK 0 /* report current version and new installs */ #define MINIMUM_UPDATE_CHECK_INTERVAL 60*60*22 /* 22 hours minimum between checks - please be kind to our servers! */ #define BASE_UPDATE_CHECK_INTERVAL 60*60*22 /* 22 hours base interval */ #define UPDATE_CHECK_INTERVAL_WOBBLE 60*60*4 /* 4 hour wobble on top of base interval */ #define BASE_UPDATE_CHECK_RETRY_INTERVAL 60*60*1 /* 1 hour base retry interval */ #define UPDATE_CHECK_RETRY_INTERVAL_WOBBLE 60*60*3 /* 3 hour wobble on top of base retry interval */ /******************* LOGGING TYPES ********************/ #define NSLOG_RUNTIME_ERROR 1 #define NSLOG_RUNTIME_WARNING 2 #define NSLOG_VERIFICATION_ERROR 4 #define NSLOG_VERIFICATION_WARNING 8 #define NSLOG_CONFIG_ERROR 16 #define NSLOG_CONFIG_WARNING 32 #define NSLOG_PROCESS_INFO 64 #define NSLOG_EVENT_HANDLER 128 /*#define NSLOG_NOTIFICATION 256*/ /* NOT USED ANYMORE - CAN BE REUSED */ #define NSLOG_EXTERNAL_COMMAND 512 #define NSLOG_HOST_UP 1024 #define NSLOG_HOST_DOWN 2048 #define NSLOG_HOST_UNREACHABLE 4096 #define NSLOG_SERVICE_OK 8192 #define NSLOG_SERVICE_UNKNOWN 16384 #define NSLOG_SERVICE_WARNING 32768 #define NSLOG_SERVICE_CRITICAL 65536 #define NSLOG_PASSIVE_CHECK 131072 #define NSLOG_INFO_MESSAGE 262144 #define NSLOG_HOST_NOTIFICATION 524288 #define NSLOG_SERVICE_NOTIFICATION 1048576 /***************** DEBUGGING LEVELS *******************/ #define DEBUGL_ALL -1 #define DEBUGL_NONE 0 #define DEBUGL_FUNCTIONS 1 #define DEBUGL_CONFIG 2 #define DEBUGL_PROCESS 4 #define DEBUGL_STATUSDATA 4 #define DEBUGL_RETENTIONDATA 4 #define DEBUGL_EVENTS 8 #define DEBUGL_CHECKS 16 #define DEBUGL_IPC 16 #define DEBUGL_FLAPPING 16 #define DEBUGL_EVENTHANDLERS 16 #define DEBUGL_PERFDATA 16 #define DEBUGL_NOTIFICATIONS 32 #define DEBUGL_EVENTBROKER 64 #define DEBUGL_EXTERNALCOMMANDS 128 #define DEBUGL_COMMANDS 256 #define DEBUGL_DOWNTIME 512 #define DEBUGL_COMMENTS 1024 #define DEBUGL_MACROS 2048 #define DEBUGV_BASIC 0 #define DEBUGV_MORE 1 #define DEBUGV_MOST 2 /******************** HOST STATUS *********************/ #define HOST_UP 0 #define HOST_DOWN 1 #define HOST_UNREACHABLE 2 /******************* STATE LOGGING TYPES **************/ #define INITIAL_STATES 1 #define CURRENT_STATES 2 /************ SERVICE DEPENDENCY VALUES ***************/ #define DEPENDENCIES_OK 0 #define DEPENDENCIES_FAILED 1 /*********** ROUTE CHECK PROPAGATION TYPES ************/ #define PROPAGATE_TO_PARENT_HOSTS 1 #define PROPAGATE_TO_CHILD_HOSTS 2 /****************** SERVICE STATES ********************/ #define STATE_OK 0 #define STATE_WARNING 1 #define STATE_CRITICAL 2 #define STATE_UNKNOWN 3 /* changed from -1 on 02/24/2001 */ /****************** FLAPPING TYPES ********************/ #define HOST_FLAPPING 0 #define SERVICE_FLAPPING 1 /**************** NOTIFICATION TYPES ******************/ #define HOST_NOTIFICATION 0 #define SERVICE_NOTIFICATION 1 /************* NOTIFICATION REASON TYPES ***************/ #define NOTIFICATION_NORMAL 0 #define NOTIFICATION_ACKNOWLEDGEMENT 1 #define NOTIFICATION_FLAPPINGSTART 2 #define NOTIFICATION_FLAPPINGSTOP 3 #define NOTIFICATION_FLAPPINGDISABLED 4 #define NOTIFICATION_DOWNTIMESTART 5 #define NOTIFICATION_DOWNTIMEEND 6 #define NOTIFICATION_DOWNTIMECANCELLED 7 #define NOTIFICATION_CUSTOM 99 /**************** EVENT HANDLER TYPES *****************/ #define HOST_EVENTHANDLER 0 #define SERVICE_EVENTHANDLER 1 #define GLOBAL_HOST_EVENTHANDLER 2 #define GLOBAL_SERVICE_EVENTHANDLER 3 /***************** STATE CHANGE TYPES *****************/ #define HOST_STATECHANGE 0 #define SERVICE_STATECHANGE 1 /***************** OBJECT CHECK TYPES *****************/ #define SERVICE_CHECK 0 #define HOST_CHECK 1 /******************* EVENT TYPES **********************/ #define EVENT_SERVICE_CHECK 0 /* active service check */ #define EVENT_COMMAND_CHECK 1 /* external command check */ #define EVENT_LOG_ROTATION 2 /* log file rotation */ #define EVENT_PROGRAM_SHUTDOWN 3 /* program shutdown */ #define EVENT_PROGRAM_RESTART 4 /* program restart */ #define EVENT_CHECK_REAPER 5 /* reaps results from host and service checks */ #define EVENT_ORPHAN_CHECK 6 /* checks for orphaned hosts and services */ #define EVENT_RETENTION_SAVE 7 /* save (dump) retention data */ #define EVENT_STATUS_SAVE 8 /* save (dump) status data */ #define EVENT_SCHEDULED_DOWNTIME 9 /* scheduled host or service downtime */ #define EVENT_SFRESHNESS_CHECK 10 /* checks service result "freshness" */ #define EVENT_EXPIRE_DOWNTIME 11 /* checks for (and removes) expired scheduled downtime */ #define EVENT_HOST_CHECK 12 /* active host check */ #define EVENT_HFRESHNESS_CHECK 13 /* checks host result "freshness" */ #define EVENT_RESCHEDULE_CHECKS 14 /* adjust scheduling of host and service checks */ #define EVENT_EXPIRE_COMMENT 15 /* removes expired comments */ #define EVENT_CHECK_PROGRAM_UPDATE 16 /* checks for new version of Nagios */ #define EVENT_SLEEP 98 /* asynchronous sleep event that occurs when event queues are empty */ #define EVENT_USER_FUNCTION 99 /* USER-defined function (modules) */ /******* INTER-CHECK DELAY CALCULATION TYPES **********/ #define ICD_NONE 0 /* no inter-check delay */ #define ICD_DUMB 1 /* dumb delay of 1 second */ #define ICD_SMART 2 /* smart delay */ #define ICD_USER 3 /* user-specified delay */ /******* INTERLEAVE FACTOR CALCULATION TYPES **********/ #define ILF_USER 0 /* user-specified interleave factor */ #define ILF_SMART 1 /* smart interleave */ /************ SCHEDULED DOWNTIME TYPES ****************/ #define ACTIVE_DOWNTIME 0 /* active downtime - currently in effect */ #define PENDING_DOWNTIME 1 /* pending downtime - scheduled for the future */ /****************** DATA STRUCTURES *******************/ /* TIMED_EVENT structure */ typedef struct timed_event_struct{ int event_type; time_t run_time; int recurring; unsigned long event_interval; int compensate_for_time_change; void *timing_func; void *event_data; void *event_args; int event_options; struct timed_event_struct *next; struct timed_event_struct *prev; }timed_event; /* NOTIFY_LIST structure */ typedef struct notify_list_struct{ contact *contact; struct notify_list_struct *next; }notification; /* CHECK_RESULT structure */ typedef struct check_result_struct{ int object_check_type; /* is this a service or a host check? */ char *host_name; /* host name */ char *service_description; /* service description */ int check_type; /* was this an active or passive service check? */ int check_options; int scheduled_check; /* was this a scheduled or an on-demand check? */ int reschedule_check; /* should we reschedule the next check */ char *output_file; /* what file is the output stored in? */ FILE *output_file_fp; int output_file_fd; double latency; struct timeval start_time; /* time the service check was initiated */ struct timeval finish_time; /* time the service check was completed */ int early_timeout; /* did the service check timeout? */ int exited_ok; /* did the plugin check return okay? */ int return_code; /* plugin return code */ char *output; /* plugin output */ struct check_result_struct *next; }check_result; /* SCHED_INFO structure */ typedef struct sched_info_struct{ int total_services; int total_scheduled_services; int total_hosts; int total_scheduled_hosts; double average_services_per_host; double average_scheduled_services_per_host; unsigned long service_check_interval_total; unsigned long host_check_interval_total; double average_service_execution_time; double average_service_check_interval; double average_host_check_interval; double average_service_inter_check_delay; double average_host_inter_check_delay; double service_inter_check_delay; double host_inter_check_delay; int service_interleave_factor; int max_service_check_spread; int max_host_check_spread; time_t first_service_check; time_t last_service_check; time_t first_host_check; time_t last_host_check; }sched_info; /* PASSIVE_CHECK_RESULT structure */ typedef struct passive_check_result_struct{ int object_check_type; char *host_name; char *service_description; int return_code; char *output; time_t check_time; double latency; struct passive_check_result_struct *next; }passive_check_result; /* CIRCULAR_BUFFER structure - used by worker threads */ typedef struct circular_buffer_struct{ void **buffer; int tail; int head; int items; int high; /* highest number of items that has ever been stored in buffer */ unsigned long overflow; pthread_mutex_t buffer_lock; }circular_buffer; /* MMAPFILE structure - used for reading files via mmap() */ typedef struct mmapfile_struct{ char *path; int mode; int fd; unsigned long file_size; unsigned long current_position; unsigned long current_line; void *mmap_buf; }mmapfile; /* DBUF structure - dynamic string storage */ typedef struct dbuf_struct{ char *buf; unsigned long used_size; unsigned long allocated_size; unsigned long chunk_size; }dbuf; #define CHECK_STATS_BUCKETS 15 /* used for tracking host and service check statistics */ typedef struct check_stats_struct{ int current_bucket; int bucket[CHECK_STATS_BUCKETS]; int overflow_bucket; int minute_stats[3]; time_t last_update; }check_stats; /******************* THREAD STUFF ********************/ /* slots in circular buffers */ #define DEFAULT_EXTERNAL_COMMAND_BUFFER_SLOTS 4096 /* worker threads */ #define TOTAL_WORKER_THREADS 1 #define COMMAND_WORKER_THREAD 0 /******************** FUNCTIONS **********************/ /**** Configuration Functions ****/ int read_main_config_file(char *); /* reads the main config file (nagios.cfg) */ int read_resource_file(char *); /* processes macros in resource file */ int read_all_object_data(char *); /* reads all object config data */ /**** Setup Functions ****/ int pre_flight_check(void); /* try and verify the configuration data */ int pre_flight_object_check(int *,int *); /* verify object relationships and settings */ int pre_flight_circular_check(int *,int *); /* detects circular dependencies and paths */ void init_timing_loop(void); /* setup the initial scheduling queue */ void setup_sighandler(void); /* trap signals */ void reset_sighandler(void); /* reset signals to default action */ int daemon_init(void); /* switches to daemon mode */ int drop_privileges(char *,char *); /* drops privileges before startup */ void display_scheduling_info(void); /* displays service check scheduling information */ /**** Event Queue Functions ****/ int schedule_new_event(int,int,time_t,int,unsigned long,void *,int,void *,void *,int); /* schedules a new timed event */ void reschedule_event(timed_event *,timed_event **,timed_event **); /* reschedules an event */ void add_event(timed_event *,timed_event **,timed_event **); /* adds an event to the execution queue */ void remove_event(timed_event *,timed_event **,timed_event **); /* remove an event from the execution queue */ int event_execution_loop(void); /* main monitoring/event handler loop */ int handle_timed_event(timed_event *); /* top level handler for timed events */ void adjust_check_scheduling(void); /* auto-adjusts scheduling of host and service checks */ void compensate_for_system_time_change(unsigned long,unsigned long); /* attempts to compensate for a change in the system time */ void adjust_timestamp_for_time_change(time_t,time_t,unsigned long,time_t *); /* adjusts a timestamp variable for a system time change */ void resort_event_list(timed_event **,timed_event **); /* resorts event list by event run time for system time changes */ /**** IPC Functions ****/ int move_check_result_to_queue(char *); int process_check_result_queue(char *); int process_check_result_file(char *); int add_check_result_to_list(check_result *); check_result *read_check_result(void); /* reads a host/service check result from the list in memory */ int delete_check_result_file(char *); int free_check_result_list(void); int init_check_result(check_result *); int free_check_result(check_result *); /* frees memory associated with a host/service check result */ int parse_check_output(char *,char **,char **,char **,int,int); int open_command_file(void); /* creates the external command file as a named pipe (FIFO) and opens it for reading */ int close_command_file(void); /* closes and deletes the external command file (FIFO) */ /**** Monitoring/Event Handler Functions ****/ int check_service_dependencies(service *,int); /* checks service dependencies */ int check_host_dependencies(host *,int); /* checks host dependencies */ void check_for_orphaned_services(void); /* checks for orphaned services */ void check_for_orphaned_hosts(void); /* checks for orphaned hosts */ void check_service_result_freshness(void); /* checks the "freshness" of service check results */ int is_service_result_fresh(service *,time_t,int); /* determines if a service's check results are fresh */ void check_host_result_freshness(void); /* checks the "freshness" of host check results */ int is_host_result_fresh(host *,time_t,int); /* determines if a host's check results are fresh */ int my_system(char *,int,int *,double *,char **,int); /* executes a command via popen(), but also protects against timeouts */ /**** Flap Detection Functions ****/ void check_for_service_flapping(service *,int,int); /* determines whether or not a service is "flapping" between states */ void check_for_host_flapping(host *,int,int,int); /* determines whether or not a host is "flapping" between states */ void set_service_flap(service *,double,double,double,int); /* handles a service that is flapping */ void clear_service_flap(service *,double,double,double); /* handles a service that has stopped flapping */ void set_host_flap(host *,double,double,double,int); /* handles a host that is flapping */ void clear_host_flap(host *,double,double,double); /* handles a host that has stopped flapping */ void enable_flap_detection_routines(void); /* enables flap detection on a program-wide basis */ void disable_flap_detection_routines(void); /* disables flap detection on a program-wide basis */ void enable_host_flap_detection(host *); /* enables flap detection for a particular host */ void disable_host_flap_detection(host *); /* disables flap detection for a particular host */ void enable_service_flap_detection(service *); /* enables flap detection for a particular service */ void disable_service_flap_detection(service *); /* disables flap detection for a particular service */ void handle_host_flap_detection_disabled(host *); /* handles the details when flap detection is disabled globally or on a per-host basis */ void handle_service_flap_detection_disabled(service *); /* handles the details when flap detection is disabled globally or on a per-service basis */ /**** Route/Host Check Functions ****/ int perform_on_demand_host_check(host *,int *,int,int,unsigned long); int perform_scheduled_host_check(host *,int,double); int check_host_check_viability_3x(host *,int,int *,time_t *); int adjust_host_check_attempt_3x(host *,int); int determine_host_reachability(host *); int process_host_check_result_3x(host *,int,char *,int,int,int,unsigned long); int perform_on_demand_host_check_3x(host *,int *,int,int,unsigned long); int run_sync_host_check_3x(host *,int *,int,int,unsigned long); int execute_sync_host_check_3x(host *); int run_scheduled_host_check_3x(host *,int,double); int run_async_host_check_3x(host *,int,double,int,int,int *,time_t *); int handle_async_host_check_result_3x(host *,check_result *); /**** Service Check Functions ****/ int check_service_check_viability(service *,int,int *,time_t *); int run_scheduled_service_check(service *,int,double); int run_async_service_check(service *,int,double,int,int,int *,time_t *); int handle_async_service_check_result(service *,check_result *); /**** Event Handler Functions ****/ int handle_host_state(host *); /* top level host state handler */ /**** Common Check Fucntions *****/ int reap_check_results(void); /**** Check Statistics Functions ****/ int init_check_stats(void); int update_check_stats(int,time_t); int generate_check_stats(void); /**** Event Handler Functions ****/ int obsessive_compulsive_service_check_processor(service *); /* distributed monitoring craziness... */ int obsessive_compulsive_host_check_processor(host *); /* distributed monitoring craziness... */ int handle_service_event(service *); /* top level service event logic */ int run_service_event_handler(service *); /* runs the event handler for a specific service */ int run_global_service_event_handler(service *); /* runs the global service event handler */ int handle_host_event(host *); /* top level host event logic */ int run_host_event_handler(host *); /* runs the event handler for a specific host */ int run_global_host_event_handler(host *); /* runs the global host event handler */ /**** Notification Functions ****/ int check_service_notification_viability(service *,int,int); /* checks viability of notifying all contacts about a service */ int is_valid_escalation_for_service_notification(service *,serviceescalation *,int); /* checks if an escalation entry is valid for a particular service notification */ int should_service_notification_be_escalated(service *); /* checks if a service notification should be escalated */ int service_notification(service *,int,char *,char *,int); /* notify all contacts about a service (problem or recovery) */ int check_contact_service_notification_viability(contact *,service *,int,int); /* checks viability of notifying a contact about a service */ int notify_contact_of_service(contact *,service *,int,char *,char *,int,int); /* notify a single contact about a service */ int check_host_notification_viability(host *,int,int); /* checks viability of notifying all contacts about a host */ int is_valid_escalation_for_host_notification(host *,hostescalation *,int); /* checks if an escalation entry is valid for a particular host notification */ int should_host_notification_be_escalated(host *); /* checks if a host notification should be escalated */ int host_notification(host *,int,char *,char *,int); /* notify all contacts about a host (problem or recovery) */ int check_contact_host_notification_viability(contact *,host *,int,int); /* checks viability of notifying a contact about a host */ int notify_contact_of_host(contact *,host *,int,char *,char *,int,int); /* notify a single contact about a host */ int create_notification_list_from_host(host *,int,int *); /* given a host, create list of contacts to be notified (remove duplicates) */ int create_notification_list_from_service(service *,int,int *); /* given a service, create list of contacts to be notified (remove duplicates) */ int add_notification(contact *); /* adds a notification instance */ notification *find_notification(contact *); /* finds a notification object */ time_t get_next_host_notification_time(host *,time_t); /* calculates nex acceptable re-notification time for a host */ time_t get_next_service_notification_time(service *,time_t); /* calculates nex acceptable re-notification time for a service */ /**** Logging Functions ****/ void logit(int,int,const char *, ...) __attribute__((__format__(__printf__, 3, 4))); int write_to_logs_and_console(char *,unsigned long,int); /* writes a string to screen and logs */ int write_to_console(char *); /* writes a string to screen */ int write_to_all_logs(char *,unsigned long); /* writes a string to main log file and syslog facility */ int write_to_all_logs_with_timestamp(char *,unsigned long,time_t *); /* writes a string to main log file and syslog facility */ int write_to_log(char *,unsigned long,time_t *); /* write a string to the main log file */ int write_to_syslog(char *,unsigned long); /* write a string to the syslog facility */ int log_service_event(service *); /* logs a service event */ int log_host_event(host *); /* logs a host event */ int log_host_states(int,time_t *); /* logs initial/current host states */ int log_service_states(int,time_t *); /* logs initial/current service states */ int rotate_log_file(time_t); /* rotates the main log file */ int write_log_file_info(time_t *); /* records log file/version info */ int open_debug_log(void); int log_debug_info(int,int,const char *,...) __attribute__((__format__(__printf__, 3, 4))); int close_debug_log(void); /**** Cleanup Functions ****/ void cleanup(void); /* cleanup after ourselves (before quitting or restarting) */ void free_memory(void); /* free memory allocated to all linked lists in memory */ int reset_variables(void); /* reset all global variables */ void free_notification_list(void); /* frees all memory allocated to the notification list */ /**** Hash Functions ****/ int hashfunc(const char *name1, const char *name2, int hashslots); int compare_hashdata(const char *,const char *,const char *,const char *); /**** Miscellaneous Functions ****/ void sighandler(int); /* handles signals */ void service_check_sighandler(int); /* handles timeouts when executing service checks */ void host_check_sighandler(int); /* handles timeouts when executing host checks */ void my_system_sighandler(int); /* handles timeouts when executing commands via my_system() */ void file_lock_sighandler(int); /* handles timeouts while waiting for file locks */ void strip(char *); /* strips whitespace from string */ char *my_strtok(char *,char *); /* my replacement for strtok() function (doesn't skip consecutive tokens) */ char *my_strsep(char **,const char *); /* Solaris doesn't have strsep(), so I took this from the glibc source code */ #ifdef REMOVED_10182007 int my_free(void **); /* my wrapper for free() */ #endif char *get_next_string_from_buf(char *buf, int *start_index, int bufsize); int compare_strings(char *,char *); /* compares two strings for equality */ char *escape_newlines(char *); int contains_illegal_object_chars(char *); /* tests whether or not an object name (host, service, etc.) contains illegal characters */ int my_rename(char *,char *); /* renames a file - works across filesystems */ int my_fcopy(char *,char *); /* copies a file - works across filesystems */ int get_raw_command_line(command *,char *,char **,int); /* given a raw command line, determine the actual command to run */ int check_time_against_period(time_t,timeperiod *); /* check to see if a specific time is covered by a time period */ int is_daterange_single_day(daterange *); time_t calculate_time_from_weekday_of_month(int,int,int,int); /* calculates midnight time of specific (3rd, last, etc.) weekday of a particular month */ time_t calculate_time_from_day_of_month(int,int,int); /* calculates midnight time of specific (1st, last, etc.) day of a particular month */ void get_next_valid_time(time_t, time_t *,timeperiod *); /* get the next valid time in a time period */ void get_datetime_string(time_t *,char *,int,int); /* get a date/time string for use in output */ void get_time_breakdown(unsigned long,int *,int *,int *, int *); time_t get_next_log_rotation_time(void); /* determine the next time to schedule a log rotation */ int init_embedded_perl(char **); /* initialized embedded perl interpreter */ int deinit_embedded_perl(void); /* cleans up embedded perl */ int file_uses_embedded_perl(char *); /* tests whether or not the embedded perl interpreter should be used on a file */ int dbuf_init(dbuf *,int); int dbuf_free(dbuf *); int dbuf_strcat(dbuf *,char *); int set_environment_var(char *,char *,int); /* sets/clears and environment variable */ int check_for_nagios_updates(int,int); /* checks to see if new version of Nagios are available */ int query_update_api(void); /* checks to see if new version of Nagios are available */ /**** External Command Functions ****/ int check_for_external_commands(void); /* checks for any external commands */ int process_external_command1(char *); /* top-level external command processor */ int process_external_command2(int,time_t,char *); /* process an external command */ int process_external_commands_from_file(char *,int); /* process external commands in a file */ int process_host_command(int,time_t,char *); /* process an external host command */ int process_hostgroup_command(int,time_t,char *); /* process an external hostgroup command */ int process_service_command(int,time_t,char *); /* process an external service command */ int process_servicegroup_command(int,time_t,char *); /* process an external servicegroup command */ int process_contact_command(int,time_t,char *); /* process an external contact command */ int process_contactgroup_command(int,time_t,char *); /* process an external contactgroup command */ /**** External Command Implementations ****/ int cmd_add_comment(int,time_t,char *); /* add a service or host comment */ int cmd_delete_comment(int,char *); /* delete a service or host comment */ int cmd_delete_all_comments(int,char *); /* delete all comments associated with a host or service */ int cmd_delay_notification(int,char *); /* delay a service or host notification */ int cmd_schedule_service_check(int,char *,int); /* schedule an immediate or delayed service check */ int cmd_schedule_check(int,char *); /* schedule an immediate or delayed host check */ int cmd_schedule_host_service_checks(int,char *,int); /* schedule an immediate or delayed checks of all services on a host */ int cmd_signal_process(int,char *); /* schedules a program shutdown or restart */ int cmd_process_service_check_result(int,time_t,char *); /* processes a passive service check */ int cmd_process_host_check_result(int,time_t,char *); /* processes a passive host check */ int cmd_acknowledge_problem(int,char *); /* acknowledges a host or service problem */ int cmd_remove_acknowledgement(int,char *); /* removes a host or service acknowledgement */ int cmd_schedule_downtime(int,time_t,char *); /* schedules host or service downtime */ int cmd_delete_downtime(int,char *); /* cancels active/pending host or service scheduled downtime */ int cmd_change_object_int_var(int,char *); /* changes host/svc (int) variable */ int cmd_change_object_char_var(int,char *); /* changes host/svc (char) variable */ int cmd_change_object_custom_var(int,char *); /* changes host/svc custom variable */ int cmd_process_external_commands_from_file(int,char *); /* process external commands from a file */ int process_passive_service_check(time_t,char *,char *,int,char *); int process_passive_host_check(time_t,char *,int,char *); /**** Internal Command Implementations ****/ void disable_service_checks(service *); /* disables a service check */ void enable_service_checks(service *); /* enables a service check */ void schedule_service_check(service *,time_t,int); /* schedules an immediate or delayed service check */ void schedule_host_check(host *,time_t,int); /* schedules an immediate or delayed host check */ void enable_all_notifications(void); /* enables notifications on a program-wide basis */ void disable_all_notifications(void); /* disables notifications on a program-wide basis */ void enable_service_notifications(service *); /* enables service notifications */ void disable_service_notifications(service *); /* disables service notifications */ void enable_host_notifications(host *); /* enables host notifications */ void disable_host_notifications(host *); /* disables host notifications */ void enable_and_propagate_notifications(host *,int,int,int,int); /* enables notifications for all hosts and services beyond a given host */ void disable_and_propagate_notifications(host *,int,int,int,int); /* disables notifications for all hosts and services beyond a given host */ void schedule_and_propagate_downtime(host *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long); /* schedules downtime for all hosts beyond a given host */ void acknowledge_host_problem(host *,char *,char *,int,int,int); /* acknowledges a host problem */ void acknowledge_service_problem(service *,char *,char *,int,int,int); /* acknowledges a service problem */ void remove_host_acknowledgement(host *); /* removes a host acknowledgement */ void remove_service_acknowledgement(service *); /* removes a service acknowledgement */ void start_executing_service_checks(void); /* starts executing service checks */ void stop_executing_service_checks(void); /* stops executing service checks */ void start_accepting_passive_service_checks(void); /* starts accepting passive service check results */ void stop_accepting_passive_service_checks(void); /* stops accepting passive service check results */ void enable_passive_service_checks(service *); /* enables passive service checks for a particular service */ void disable_passive_service_checks(service *); /* disables passive service checks for a particular service */ void start_using_event_handlers(void); /* enables event handlers on a program-wide basis */ void stop_using_event_handlers(void); /* disables event handlers on a program-wide basis */ void enable_service_event_handler(service *); /* enables the event handler for a particular service */ void disable_service_event_handler(service *); /* disables the event handler for a particular service */ void enable_host_event_handler(host *); /* enables the event handler for a particular host */ void disable_host_event_handler(host *); /* disables the event handler for a particular host */ void enable_host_checks(host *); /* enables checks of a particular host */ void disable_host_checks(host *); /* disables checks of a particular host */ void start_obsessing_over_service_checks(void); /* start obsessing about service check results */ void stop_obsessing_over_service_checks(void); /* stop obsessing about service check results */ void start_obsessing_over_host_checks(void); /* start obsessing about host check results */ void stop_obsessing_over_host_checks(void); /* stop obsessing about host check results */ void enable_service_freshness_checks(void); /* enable service freshness checks */ void disable_service_freshness_checks(void); /* disable service freshness checks */ void enable_host_freshness_checks(void); /* enable host freshness checks */ void disable_host_freshness_checks(void); /* disable host freshness checks */ void process_passive_checks(void); /* processes passive host and service check results */ void enable_all_failure_prediction(void); /* enables failure prediction on a program-wide basis */ void disable_all_failure_prediction(void); /* disables failure prediction on a program-wide basis */ void enable_performance_data(void); /* enables processing of performance data on a program-wide basis */ void disable_performance_data(void); /* disables processing of performance data on a program-wide basis */ void start_executing_host_checks(void); /* starts executing host checks */ void stop_executing_host_checks(void); /* stops executing host checks */ void start_accepting_passive_host_checks(void); /* starts accepting passive host check results */ void stop_accepting_passive_host_checks(void); /* stops accepting passive host check results */ void enable_passive_host_checks(host *); /* enables passive host checks for a particular host */ void disable_passive_host_checks(host *); /* disables passive host checks for a particular host */ void start_obsessing_over_service(service *); /* start obsessing about specific service check results */ void stop_obsessing_over_service(service *); /* stop obsessing about specific service check results */ void start_obsessing_over_host(host *); /* start obsessing about specific host check results */ void stop_obsessing_over_host(host *); /* stop obsessing about specific host check results */ void set_host_notification_number(host *,int); /* sets current notification number for a specific host */ void set_service_notification_number(service *,int); /* sets current notification number for a specific service */ void enable_contact_host_notifications(contact *); /* enables host notifications for a specific contact */ void disable_contact_host_notifications(contact *); /* disables host notifications for a specific contact */ void enable_contact_service_notifications(contact *); /* enables service notifications for a specific contact */ void disable_contact_service_notifications(contact *); /* disables service notifications for a specific contact */ int init_check_result_worker_thread(void); int shutdown_check_result_worker_thread(void); void * check_result_worker_thread(void *); void cleanup_check_result_worker_thread(void *); int init_command_file_worker_thread(void); int shutdown_command_file_worker_thread(void); void * command_file_worker_thread(void *); void cleanup_command_file_worker_thread(void *); int submit_external_command(char *,int *); int submit_raw_external_command(char *,time_t *,int *); char *get_program_version(void); char *get_program_modification_date(void); mmapfile *mmap_fopen(char *); /* open a file read-only via mmap() */ int mmap_fclose(mmapfile *); char *mmap_fgets(mmapfile *); char *mmap_fgets_multiline(mmapfile *); #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/include/nagios/netutils.h0000644001161000116100000000035212213031442015676 00000000000000 #ifndef _NETUTILS_H #define _NETUTILS_H int my_tcp_connect(char *host_name, int port, int *sd, int timeout); int my_sendall(int s, char *buf, int *len, int timeout); int my_recvall(int s, char *buf, int *len, int timeout); #endif mod_gearman-1.4.14/include/result_thread.h0000644001161000116100000000251611540351111015420 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** @file * @brief header for the neb result thread * * @{ */ #include "mod_gearman.h" #include #include "nagios/nagios.h" void *result_worker(void *); int set_worker( gearman_worker_st *worker ); void *get_results( gearman_job_st *, void *, size_t *, gearman_return_t * ); #ifdef GM_DEBUG void write_debug_file(char ** text); #endif /** * @} */ mod_gearman-1.4.14/include/common.h0000644001161000116100000003643712241503656014070 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** \mainpage Mod-Gearman * * \section intro_sec Introduction * * Mod-Gearman (http://labs.consol.de/nagios/mod-gearman) is a new * way of distributing active Nagios checks (http://www.nagios.org) across your network. It * consists of two parts: There is a NEB module which resides in the * Nagios core and adds servicechecks, hostchecks and eventhandler to a * Gearman (http://gearman.org) queue. There can be multiple equal * gearman servers. The counterpart is one or more worker clients for * the checks itself. They can be bound to host and servicegroups. * * @attention Please submit bugreports or patches on https://github.com/sni/mod_gearman * @author Sven Nierlein * */ /** @file * @brief common header for all components * * @{ */ #include #include #include #include #ifndef MOD_GM_COMMON_H #define MOD_GM_COMMON_H /* constants */ #define GM_VERSION "1.4.14" #define GM_ENABLED 1 #define GM_DISABLED 0 #define GM_BUFFERSIZE 98304 #define GM_MAX_OUTPUT 65536 /* must be ~30% below GM_BUFFERSIZE for base64/encryption */ #define GM_LISTSIZE 512 #define GM_NEBTYPESSIZE 33 /* maximum number of neb types */ #define GM_MIN_LIB_GEARMAN_VERSION 0.14 #define GM_SERVER_DEFAULT_PORT 4730 #define GM_OK 0 #define GM_ERROR 1 #define GM_NO_EPN -1 /* log modes */ #define GM_LOG_ERROR -1 #define GM_LOG_INFO 0 #define GM_LOG_DEBUG 1 #define GM_LOG_TRACE 2 #define GM_LOG_TRACE2 3 #define GM_LOG_TRACE3 4 #define GM_LOG_STDOUT 5 /* 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 #define GM_JOB_PRIO_HIGH 3 #define GM_DEFAULT_JOB_TIMEOUT 60 #define GM_DEFAULT_JOB_RETRIES 1 #define GM_CHILD_SHUTDOWN_TIMEOUT 10 #define GM_DEFAULT_RESULT_QUEUE "check_results" #define GM_DEFAULT_IDLE_TIMEOUT 10 #define GM_DEFAULT_MAX_JOBS 1000 #define MAX_CMD_ARGS 4096 /* worker */ #define GM_DEFAULT_MIN_WORKER 1 /**< minumum number of worker */ #define GM_DEFAULT_MAX_WORKER 20 /**< maximum number of concurrent worker */ #define GM_DEFAULT_JOB_MAX_AGE 0 /**< discard jobs older than that */ #define GM_DEFAULT_SPAWN_RATE 1 /**< number of spawned worker per seconds */ #define GM_DEFAULT_WORKER_LOOP_SLEEP 1 /**< sleep in worker main loop */ /* transport modes */ #define GM_ENCODE_AND_ENCRYPT 1 #define GM_ENCODE_ONLY 2 #define GM_ENCODE_ACCEPT_ALL 3 /* dump config modes */ #define GM_WORKER_MODE 1 #define GM_NEB_MODE 2 #define GM_SEND_GEARMAN_MODE 3 /* worker stop modes */ #define GM_WORKER_STOP 1 #define GM_WORKER_RESTART 2 /* perfdata modes */ #define GM_PERFDATA_OVERWRITE 1 #define GM_PERFDATA_APPEND 2 #ifndef TRUE #define TRUE 1 #elif (TRUE!=1) #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #elif (FALSE!=0) #define FALSE 0 #endif #define STATE_OK 0 /**< core exit code for ok */ #define STATE_WARNING 1 /**< core exit code for warning */ #define STATE_CRITICAL 2 /**< core exit code for critical */ #define STATE_UNKNOWN 3 /**< core exit code for unknown */ #define GM_SHM_SIZE 4096 /**< size of the shared memory segment */ /** options exports structure * * structure for export definition * */ typedef struct mod_gm_export { char * name[GM_LISTSIZE]; /**< list of queue names to export into */ int return_code[GM_LISTSIZE]; /**< list of return codes which should be returned to nagios */ int elem_number; /**< number of elements */ } mod_gm_exp_t; /** server structure * * structure for server definition * */ typedef struct gm_server { char * host; /**< hostname of server */ in_port_t port; /**< port number */ } gm_server_t; /** options structure * * structure union for all components * all config files and commandline arguments are parsed * into this structure */ typedef struct mod_gm_opt_struct { int set_queues_by_hand; /**< flag whether there has been queues configured by hand */ char * crypt_key; /**< encryption key used for securing the messages sent over gearman */ char * keyfile; /**< path to a file where the crypt_key is read from */ gm_server_t * server_list[GM_LISTSIZE]; /**< list of gearmand servers */ int server_num; /**< number of gearmand servers */ gm_server_t * dupserver_list[GM_LISTSIZE]; /**< list of gearmand servers to duplicate results */ int dupserver_num; /**< number of duplicate gearmand servers */ char * hostgroups_list[GM_LISTSIZE]; /**< list of hostgroups which get own queues */ int hostgroups_num; /**< number of elements in hostgroups_list */ char * servicegroups_list[GM_LISTSIZE]; /**< list of servicegroups which get own queues */ int servicegroups_num; /**< number of elements in servicegroups_list */ int debug_level; /**< level of debug output */ int hosts; /**< flag wheter host checks are distributed or not */ int services; /**< flag wheter service checks are distributed or not */ int events; /**< flag wheter eventhandlers are distributed or not */ 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 */ int use_uniq_jobs; /**< flag whether normal jobs will be sent with/without uniq set */ /* neb module */ char * result_queue; /**< name of the result queue used by the neb module */ int result_workers; /**< number of result worker threads started */ int perfdata; /**< flag whether perfdata will be distributed or not */ int perfdata_mode; /**< flag whether perfdata will be sent with/without uniq set */ char * local_hostgroups_list[GM_LISTSIZE]; /**< list of hostgroups which will not be distributed */ int local_hostgroups_num; /**< number of elements in local_hostgroups_list */ char * local_servicegroups_list[GM_LISTSIZE]; /**< list of group which will not be distributed */ int local_servicegroups_num; /**< number of elements in local_servicegroups_list */ int do_hostchecks; /**< flag whether mod-gearman will process hostchecks at all */ int route_eventhandler_like_checks; /**< flag whether mod-gearman will route like normal checks */ char * queue_cust_var; /**< custom variable name which contains the target queue */ mod_gm_exp_t * exports[GM_NEBTYPESSIZE]; /**< list of exporter queues */ int exports_count; /**< number of export queues */ int orphan_host_checks; /**< generate fake result for orphaned host checks */ int orphan_service_checks; /**< generate fake result for orphaned service checks */ int accept_clear_results; /**< accept unencrypted results */ /* worker */ char * identifier; /**< identifier for this worker */ char * pidfile; /**< path to a pidfile */ 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 */ int min_worker; /**< minimum number of workers */ int max_worker; /**< maximum number of workers */ int fork_on_exec; /**< flag to disable additional forks for each job */ int idle_timeout; /**< number of seconds till a idle worker exits */ int max_jobs; /**< maximum number of jobs done after a worker exits */ int spawn_rate; /**< number of spawned new worker */ int show_error_output; /**< optional display the stderr output of plugins */ int timeout_return; /**< timeout return code */ int orphan_return; /**< orphan return code */ int dup_results_are_passive; /**< send duplicate results as passive checks */ double load_limit1; /**< load limit 1min for new worker */ double load_limit5; /**< load limit 5min for new worker */ double load_limit15; /**< load limit 15min for new worker */ #ifdef EMBEDDEDPERL int enable_embedded_perl; /**< enabled embedded perl */ int use_embedded_perl_implicitly; /**< use embedded perl implicitly */ int use_perl_cache; /**< cache embedded perl scripts */ char * p1_file; /**< path to p1 file, needed for embedded perl */ #endif int workaround_rc_25; /**< optional workaround for plugins returning exit code 25 */ /* send_gearman */ int timeout; /**< timeout for waiting reading on stdin */ int return_code; /**< return code */ char * message; /**< message output */ char * host; /**< hostname for this check */ char * service; /**< service description for this check */ char * delimiter; /**< delimiter to cut check results */ int active; /**< flag wheter the result is a active or a passive check */ int has_starttime; /**< flag when starttime is set */ struct timeval starttime; /**< time when the check started */ int has_finishtime; /**< flag when finishtime is set */ struct timeval finishtime; /**< time when the check finished */ int has_latency; /**< flag when latency is set */ struct timeval latency; /**< latency for this result */ } mod_gm_opt_t; /** structure for jobs to execute */ typedef struct gm_job_struct { char * host_name; /**< hostname for this job */ char * service_description; /**< service description for this job or NULL */ char * command_line; /**< command line to execute */ char * type; /**< type of this job */ char * result_queue; /**< name of the result queue */ char * output; /**< output from the executed command line (stdout) */ char * error; /**< errors from the executed command line (stderr) */ int return_code; /**< return code for this job */ int early_timeout; /**< did the check run into a timeout */ int check_options; /**< check_options given from the core */ int scheduled_check; /**< normal scheduled check? */ int reschedule_check; /**< rescheduled check? */ int exited_ok; /**< did the plugin exit normally? */ int timeout; /**< timeout for this job */ double latency; /**< latency for from this job */ struct timeval next_check; /**< next_check value of host / service */ struct timeval core_time; /**< time when the core started the job */ struct timeval start_time; /**< time when the job really started */ struct timeval finish_time; /**< time when the job was finished */ int has_been_sent; /**< flag if job has been sent back */ } gm_job_t; /** options structure */ mod_gm_opt_t *mod_gm_opt; gm_job_t * current_job; char hostname[GM_BUFFERSIZE]; /* * @} */ #endif mod_gearman-1.4.14/include/check_gearman.h0000644001161000116100000000506011722022205015320 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** * @file * @brief check_gearman nagios plugin * @addtogroup mod_gearman_check_gearman check_gearman * * check_gearman can be used as a nagios plugin to verify gearman server and worker. * It is part of the Mod-Gearman package but not limited to Mod-Gearman. * * @{ */ #define MOD_GM_CHECK_GEARMAN /**< set check_gearman mode */ #define PLUGIN_NAME "check_gearman" /**< set the name of the plugin */ #include #include #include "common.h" /** check_gearman * * main function of check_gearman * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return exits with a nagios compatible exit code */ int main (int argc, char **argv); /** * * print the usage and exit * * @return exits with a nagios compatible exit code */ void print_usage(void); /** * * print the version and exit * * @return exits with a nagios compatible exit code */ void print_version(void); /** * * signal handler for sig alarm * * @param[in] sig - signal number * * @return exits with a nagios compatible exit code */ void alarm_sighandler(int sig); /** * * check a gearmand server * * @param[in] server - server to check * * @return returns a nagios compatible exit code */ int check_server(char * server, in_port_t port); /** * * check a gearman worker * * @param[in] queue - queue name (function) * @param[in] send - put this text as job into the queue * @param[in] expect - returning text to expect * * @return returns a nagios compatible exit code */ int check_worker(char * queue, char * send, char * expect); /** * @} */ mod_gearman-1.4.14/include/worker.h0000644001161000116100000001213512234272667014105 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ #define MOD_GM_WORKER /**< set mod_gearman worker features */ #include #include #include #include #include #include #include #include #include #include "common.h" #include "config.h" /** @file * @brief Mod-Gearman Worker Client * @addtogroup mod_gearman_worker Worker * * Worker command line utility which executes the checks or eventhandler. * * @{ */ int mod_gm_shm_key; /**< key for the shared memory segment */ #define SHM_SHIFT 5 /**< nr of global counter */ #define SHM_JOBS_DONE 0 /**< shm id for jobs done counter */ #define SHM_WORKER_TOTAL 1 /**< shm id for total worker counter */ #define SHM_WORKER_RUNNING 2 /**< shm id for running worker counter */ #define SHM_STATUS_WORKER_PID 3 /**< shm id for status worker pid */ #define SHM_WORKER_LAST_CHECK 4 /**< shm time of last check executed */ /** Mod-Gearman Worker * * main function of the worker * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return when worker exits, returns exit code of worker */ #ifdef EMBEDDEDPERL int main (int argc, char **argv, char **env); #else int main (int argc, char **argv); #endif /** * store the commandline to parse it again on reloading the worker * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return TRUE on success or FALSE if not */ int store_original_comandline(int argc, char **argv); /** * parse the arguments into the global options structure * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return TRUE on success or FALSE if not */ int parse_arguments(int argc, char **argv); /** * create a new child process * * @param[in] mode - mode for the new child * * @return TRUE on success or FALSE if not */ int make_new_child(int mode); /** * print the usage and exit * * @return nothing and exits */ void print_usage(void); /** * print the version and exit * * @return nothing and exits */ void print_version(void); /** * calculate the new number of child worker * * @param[in] min - minimum number of worker * @param[in] max - maximum number of worker * @param[in] cur_workers - current number of worker * @param[in] cur_jobs - current number of running jobs * * @return new target number of workers */ int adjust_number_of_worker(int min, int max, int cur_workers, int cur_jobs); /** * creates the shared memory segments for the child communication * * @return nothing */ void setup_child_communicator(void); /** * finish and clean all children and shared memory segments, then exit. * * @param[in] sig - signal which caused the exit * * @return nothing */ void clean_exit(int sig); /** * write the current pid into the pidfile * * @return TRUE on success or FALSE if something went wrong */ int write_pid_file(void); /** * verify options structure and check for missing options * * @param[in] opt - options structure to verify * * @return TRUE on success or FALSE if something went wrong */ int verify_options(mod_gm_opt_t *opt); /** * signal handler for the HUP signal * * @param[in] sig - signal * * @return nothing */ void reload_config(int sig); /** * stop all child * * @param[in] mode - could be stop or restart * * @return nothing */ void stop_children(int mode); /** * main loop to maintain the child population * * @return nothing */ void monitor_loop(void); /** * check and start new worker children if level is too low * * @return nothing */ void check_worker_population(void); /** * returns next number of the shared memory segment for a new child * * @return nothing */ int get_next_shm_index(void); /** * count and set the current number of worker * * @param[in] restart - set to GM_ENABLED if stale worker should be replaced * * @return nothing */ void count_current_worker(int restart); /** * save kill pid from shm index * * @param[in] pid - pid to kill * @param[in] signal - signal to use * * @return nothing */ void save_kill(int pid, int sig); /** * @} */ mod_gearman-1.4.14/include/gearman_top.h0000644001161000116100000000431211740656252015063 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** * @file * @brief gearman_top command line utility * @addtogroup mod_gearman_gearman_top gearman_top * * Command line utility which connects to the admin interface of a gearman daemon. * displays current worker and queue utilization. * * @{ */ #include #include #include #include #include "common.h" /** gearman_top * * main function of gearman_top * * @param[in] argc - number of arguments * @param[in] argv - list of arguments * * @return just exits */ int main (int argc, char **argv); /** * * close all connections and exit * * @param[in] sig - signal number received * * @return just exits */ void clean_exit(int sig); /** * * print the usage and exit * * @return just exits */ void print_usage(void); /** * * print the version and exit * * @return exits with a nagios compatible exit code */ void print_version(void); /** * * print the statistics for a given hostname * * @param[in] hostname - hostname to connect to * * @return nothing */ void print_stats(char * hostname); /** * * print to window or stdout, depending on settings * * @param[in] fmt - format string * @param[in] ... - list * * @return nothing */ void my_printf(const char *fmt, ...); /** * @} */ mod_gearman-1.4.14/include/base64.h0000644001161000116100000000326411522215514013646 00000000000000#include /** @file * @brief utilities for base64 encoding * * contains all function used for encoding and decoding of * base64. * * see * http://freecode-freecode.blogspot.com/2008/02/base64c.html * for more. * @{ */ /** * encode three bytes using base64 (RFC 3548) * * @param triple three bytes that should be encoded * @param result buffer of four characters where the result is stored */ void _base64_encode_triple(unsigned char triple[3], char result[4]); /** * encode an array of bytes using Base64 (RFC 3548) * * @param source the source buffer * @param sourcelen the length of the source buffer * @param target the target buffer * @param targetlen the length of the target buffer * @return 1 on success, 0 otherwise */ int base64_encode(unsigned char *source, size_t sourcelen, char *target, size_t targetlen); /** * determine the value of a base64 encoding character * * @param base64char the character of which the value is searched * @return the value in case of success (0-63), -1 on failure */ int _base64_char_value(char base64char); /** * decode a 4 char base64 encoded byte triple * * @param quadruple the 4 characters that should be decoded * @param result the decoded data * @return lenth of the result (1, 2 or 3), 0 on failure */ int _base64_decode_triple(char quadruple[4], unsigned char *result); /** * decode base64 encoded data * * @param source the encoded data (zero terminated) * @param target pointer to the target buffer * @param targetlen length of the target buffer * @return length of converted data on success, -1 otherwise */ size_t base64_decode(char *source, unsigned char *target, size_t targetlen); /** * @} */ mod_gearman-1.4.14/include/utils.h0000644001161000116100000002112512234761054013724 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** @file * @brief utility components for all parts of mod_gearman * * @{ */ #include #include #include #include #include #include #include #include #include #include #include #include #include "polarssl/md5.h" #include "common.h" /** * escpae newlines * * @param[in] rawbuf - text to escape * @param[in] trimmed - trim string before escaping * * @return a text with all newlines escaped */ char *gm_escape_newlines(char *rawbuf, int trimmed); /** * real_exit_code * * converts a exit from wait() into real number * * @param[in] code - exit code * * @return real exit code */ int real_exit_code(int code); /** * mod_gm_crypt_init * * wrapper to initialze mod_gearman crypt module * * @param[in] key - password for encryption * * @return nothing */ void mod_gm_crypt_init(char * key); /** * mod_gm_encrypt * * wrapper to encrypt text * * @param[out] encrypted - pointer to encrypted text * @param[in] text - text to encrypt * @param[in] mode - encryption mode (base64 or aes64 with base64) * * @return base64 encoded text or aes encrypted text based on mode */ int mod_gm_encrypt(char ** encrypted, char * text, int mode); /** * mod_gm_decrypt * * @param[out] decrypted - pointer to decrypted text * @param[in] text - text to decrypt * @param[in] mode - do only base64 decoding or decryption too * * @return decrypted text */ void mod_gm_decrypt(char ** decrypted, char * text, int mode); /** * file_exists * * @param[in] fileName - path to file * * @return true if file exists */ int file_exists (char * fileName); /** * ltrim * * trim whitespace to the left * * @param[in] s - text to trim * * @return trimmed text */ char *ltrim(char *s); /** * rtrim * * trim whitespace to the right * * @param[in] s - text to trim * * @return trimmed text */ char *rtrim(char *s); /** * trim * * trim whitespace from left and right * * @param[in] s - text to trim * * @return trimmed text */ char *trim(char *s); /** * set_default_options * * fill in default options * * @param[in] opt - option structure * * @return true on success */ int set_default_options(mod_gm_opt_t *opt); /** * lc * * lowercase given text * * @param[in] str - text to lowercase * * @return lowercased text */ char *lc(char * str); /** * parse_args_line * * parse the command line arguments in our options structure * * @param[in] opt - options structure * @param[in] arg - arguments * @param[in] recursion_level - counter for the recursion level * * @return true on success */ int parse_args_line(mod_gm_opt_t *opt, char * arg, int recursion_level); /** * parse_yes_or_no * * parse a string for yes/no, on/off * * @param[in] value - string to parse * @param[in] dfl - default value if none matches * * @return parsed value */ int parse_yes_or_no(char*value, int dfl); /** * read_config_file * * read config options from a file * * @param[in] opt - options structure * @param[in] filename - file to parse * @param[in] recursion_level - counter for the recursion level * * @return true on success */ int read_config_file(mod_gm_opt_t *opt, char*filename, int recursion_level); /** * dumpconfig * * dumps config with logger * * @param[in] opt - options structure * @param[in] mode - display mode * * @return nothing */ void dumpconfig(mod_gm_opt_t *opt, int mode); /** * mod_gm_free_opt * * free options structure * * @param[in] opt - options structure * * @return nothing */ void mod_gm_free_opt(mod_gm_opt_t *opt); /** * read_keyfile * * read keyfile into options structure * * @param[in] opt - options structure * * @return true on success */ int read_keyfile(mod_gm_opt_t *opt); /** * string2timeval * * parse string into timeval * * @param[in] value - string to parse * @param[out] t - pointer to timeval structure * * @return nothing */ void string2timeval(char * value, struct timeval * t); /** * double2timeval * * parse double into timeval * * @param[in] value - double value * @param[out] t - pointer to timeval structure * * @return nothing */ void double2timeval(double value, struct timeval * t); /** * timeval2double * * convert timeval into double * * @param[in] t - timeval structure * * @return double value for this timeval structure */ double timeval2double(struct timeval * t); /** * mod_gm_time_compare * * get difference between two timeval * * @param[in] tv1 - first timeval * @param[in] tv2 - second timeval * * @return difference in seconds */ long mod_gm_time_compare(struct timeval * tv1, struct timeval * tv2); /** * * set_default_job * * fill defaults into job structure * * @param[in] job - job structure to be filled * @param[in] mod_gm_opt - options structure * * @return true on success */ int set_default_job(gm_job_t *job, mod_gm_opt_t *mod_gm_opt); /** * * free_job * * free job structure * * @param[in] job - job structure to be freed * * @return true on success */ int free_job(gm_job_t *job); /** * pid_alive * * check if a pid is alive * * @param[in] pid - pid to check * * @return true if pid is alive */ int pid_alive(int pid); /** * escapestring * * escape quotes and newlines * * @param[in] rawbuf - text to escape * * @return the escaped string */ char *escapestring(char *rawbuf); /** * escaped * * checks wheter a char has to be escaped or not * * @param[in] ch - char to check * * @return true if char has to be escaped */ int escaped(int ch); /** * escape * * return escaped variant of char * * @param[out] out - escaped char * @param[in] ch - char to escape * * @return the escaped string */ void escape(char *out, int ch); /** * nebtype2str * * get human readable name for neb type * * @param[in] i - integer to translate * * @return the human readable string */ char * nebtype2str(int i); /** * nebcallback2str * * get human readable name for nebcallback type int * * @param[in] i - integer to translate * * @return the human readable string */ char * nebcallback2str(int i); /** * eventtype2str * * get human readable name for eventtype type int * * @param[in] i - integer to translate * * @return the human readable string */ 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_core_log * * write log line with core logger * * @param[in] data - log message * * @return nothing */ void write_core_log(char *data); /** * check_param_server * * check if server is already in the list * * @param[in] new_server - server to check * @param[in] server_list - list of servers to check for duplicates * @param[in] server_num - number of server in this list * * @returns the new server name or NULL */ int check_param_server(gm_server_t * new_server, gm_server_t * server_list[GM_LISTSIZE], int server_num); /** * send_result_back * * send back result * * @param[in] exec_job - the exec job with all results * * @return nothing */ void send_result_back(gm_job_t * exec_job); /** * md5sum * * create md5 sum * * @param[in] text - char array to get md5 from * * @return md5sum (hex) */ char *md5sum(char *text); /** * add_server( * * adds parsed server to list * * @param[in] server_num - insert server at that point * @param[in] server_list - add server to this list * @param[in] servername - parse and add this server * * @return nothing */ void add_server(int * server_num, gm_server_t * server_list[GM_LISTSIZE], char * servername); /** * @} */ mod_gearman-1.4.14/include/check_utils.h0000644001161000116100000000615212212675260015063 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** @file * @brief utility components for all parts of mod_gearman * * @{ */ #include "popenRWE.h" #include "common.h" #include /** * nr2signal * * get name for a signal number * * @param[in] sig - signal number * * @return name for this signal */ char * nr2signal(int sig); /** * extract_check_result * * get result from a file pointer * * @param[in] fp - file pointer to executed command * @param[in] trimmed - trim result * * @return check result */ char *extract_check_result(FILE *fp, int trimmed); /** * parse_command_line * * parse command line into argv array * * @param[in] cmd - command line * @param[out] argv - argv array * * @return true on success */ int parse_command_line(char *cmd, char *argv[GM_LISTSIZE]); /** * run_check * * run a command * * @param[in] processed_command - command line * @param[out] plugin_output - pointer to plugin output * @param[out] plugin_error - pointer to plugin error output * * @return true on success */ int run_check(char *processed_command, char **plugin_output, char **plugin_error); /** * * execute_safe_command * * execute command and fill the exec job structure * * @param[in] exec_job - job structure * @param[in] fork_exec - fork or not before exec * @param[in] identifier - current worker identifier * * @return true on success */ int execute_safe_command(gm_job_t * exec_job, int fork_exec, char * identifier); /** * * kill_child_checks * * remove all forked check childs * * @return nothing */ void kill_child_checks(void); /** * * check_alarm_handler * * called when a check runs into the timeout * * @param[in] sig - signal number * * @return nothing */ void check_alarm_handler(int sig); /** * send_timeout_result * * send back a timeout result * * @param[in] exec_job - the exec job with all results * * @return nothing */ void send_timeout_result(gm_job_t * exec_job); /** * send_failed_result * * send back a fail result * * @param[in] exec_job - the exec job with all results * @param[in] signal - signal number why the job failed * * @return nothing */ void send_failed_result(gm_job_t * exec_job, int sig); /** * @} */ mod_gearman-1.4.14/include/epn_utils.h0000644001161000116100000000421411767461236014577 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ #include "common.h" /** @file * @brief embedded perl utility components for all parts of mod_gearman * * @{ */ /** * run_epn_check * * run a check with epn when available * * @param[in] processed_command - command line * @param[out] plugin_output - pointer to plugin output * @param[out] plugin_error - pointer to plugin error output * * @return true/false */ int run_epn_check(char *processed_command, char **ret, char **err); /** * file_uses_embedded_perl * * tests whether or not the embedded perl interpreter should be used on a file * * @param[in] file - path to file * * @return true/false */ int file_uses_embedded_perl(char *); /** * init_embedded_perl * * initialize embedded perl interpreter * * @param[in] env - environment * * @return true */ int init_embedded_perl(char **); /** * deinit_segv * * sigsegv handler during deinitialzing embedded perl * * @param[in] sig - signal number * * @returns nothing, just exits */ void deinit_segv( int ); /** * deinit_embedded_perl * * deinitialize embedded perl interpreter * * @param[in] rc - exit code in case deinitializing fails * * @return true */ int deinit_embedded_perl(int rc); /** * @} */ mod_gearman-1.4.14/include/gm_crypt.h0000644001161000116100000000362011700632412014400 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** @file * @brief crypt module * * contains the utility functions for en/decryption * * @{ */ #include #include #include "rijndael.h" #define KEYBITS 256 /**< key size */ #define BLOCKSIZE 16 /**< block size for encryption */ /** * initialize crypto module * * @param[in] password - encryption key * * @return nothing */ void mod_gm_aes_init(char * password); /** * encrypt text * * @param[out] encrypted - pointer to encrypted text * @param[in] text - text which should be encrypted * * @return size of encrypted text */ int mod_gm_aes_encrypt(unsigned char ** encrypted, char * text); /** * decrypt text * * @param[out] decrypted - pointer to decrypted text * @param[in] encrypted - text which should be decrypted * @param[in] size - size of encrypted text * * @return nothing */ void mod_gm_aes_decrypt(char ** decrypted, unsigned char * encrypted, int size); /* * @} */ mod_gearman-1.4.14/include/polarssl/0000755001161000116100000000000011660503135014325 500000000000000mod_gearman-1.4.14/include/polarssl/config.h0000644001161000116100000003014711660503135015670 00000000000000/** * \file config.h * * \brief Configuration options (set of defines) * * Copyright (C) 2006-2010, Brainspark B.V. * * This file is part of PolarSSL (http://www.polarssl.org) * Lead Maintainer: Paul Bakker * * All rights reserved. * * This program 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 2 of the License, or * (at your option) any later version. * * This program 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 this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This set of compile-time options may be used to enable * or disable features selectively, and reduce the global * memory footprint. */ #ifndef POLARSSL_CONFIG_H #define POLARSSL_CONFIG_H #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE 1 #endif /** * \name SECTION: System support * * This section sets system specific settings. * \{ */ /** * \def POLARSSL_HAVE_INT8 * * The system uses 8-bit wide native integers. * * Uncomment if native integers are 8-bit wide. #define POLARSSL_HAVE_INT8 */ /** * \def POLARSSL_HAVE_INT16 * * The system uses 16-bit wide native integers. * * Uncomment if native integers are 16-bit wide. #define POLARSSL_HAVE_INT16 */ /** * \def POLARSSL_HAVE_LONGLONG * * The compiler supports the use of long long. * * Uncomment if the compiler supports long long. #define POLARSSL_HAVE_LONGLONG */ /** * \def POLARSSL_HAVE_ASM * * The compiler has support for asm() * * Uncomment to enable the use of assembly code. * * Requires support for asm() in compiler. * * Used in: * library/timing.c * library/padlock.c * include/polarssl/bn_mul.h * */ #define POLARSSL_HAVE_ASM /** * \def POLARSSL_HAVE_SSE2 * * CPI supports SSE2 instruction set. * * Uncomment if the CPU supports SSE2 (IA-32 specific). * #define POLARSSL_HAVE_SSE2 */ /* \} name */ /** * \name SECTION: PolarSSL feature support * * This section sets support for features that are or are not needed * within the modules that are enabled. * \{ */ /** * \def POLARSSL_AES_ROM_TABLES * * Store the AES tables in ROM. * * Uncomment this macro to store the AES tables in ROM. * #define POLARSSL_AES_ROM_TABLES */ /** * \def POLARSSL_CIPHER_MODE_CFB * * Enable Cipher Feedback mode (CFB) for symmetric ciphers. */ #define POLARSSL_CIPHER_MODE_CFB /** * \def POLARSSL_CIPHER_MODE_CTR * * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. */ #define POLARSSL_CIPHER_MODE_CTR /** * \def POLARSSL_DEBUG_MSG * * Requires: POLARSSL_DEBUG_C * * Enable all SSL/TLS debugging messages. */ #define POLARSSL_DEBUG_MSG /** * \def POLARSSL_GENPRIME * * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C * * Enable the RSA prime-number generation code. */ #define POLARSSL_GENPRIME /** * \def POLARSSL_FS_IO * * Enable functions that use the filesystem. */ #define POLARSSL_FS_IO /** * \def POLARSSL_PKCS1_V21 * * Requires: POLARSSL_MD_C, POLARSSL_RSA_C * * Enable support for PKCS#1 v2.1 encoding. * This enables support for RSAES-OAEP and RSASSA-PSS operations. */ #define POLARSSL_PKCS1_V21 /** * \def POLARSSL_RSA_NO_CRT * * Do not use the Chinese Remainder Theorem for the RSA private operation. * * Uncomment this macro to disable the use of CRT in RSA. * #define POLARSSL_RSA_NO_CRT */ /** * \def POLARSSL_SELF_TEST * * Enable the checkup functions (*_self_test). */ #define POLARSSL_SELF_TEST /** * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION * * If set, the X509 parser will not break-off when parsing an X509 certificate * and encountering an unknown critical extension. * * Uncomment to prevent an error. * #define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION */ /* \} name */ /** * \name SECTION: PolarSSL modules * * This section enables or disables entire modules in PolarSSL * \{ */ /** * \def POLARSSL_AES_C * * Enable the AES block cipher. * * Module: library/aes.c * Caller: library/ssl_tls.c * library/pem.c * * This module enables the following ciphersuites: * SSL_RSA_AES_128_SHA * SSL_RSA_AES_256_SHA * SSL_EDH_RSA_AES_256_SHA */ #define POLARSSL_AES_C /** * \def POLARSSL_ARC4_C * * Enable the ARCFOUR stream cipher. * * Module: library/arc4.c * Caller: library/ssl_tls.c * * This module enables the following ciphersuites: * SSL_RSA_RC4_128_MD5 * SSL_RSA_RC4_128_SHA */ #define POLARSSL_ARC4_C /** * \def POLARSSL_BASE64_C * * Enable the Base64 module. * * Module: library/base64.c * Caller: library/pem.c * * This module is required for PEM support (required by X.509). */ #define POLARSSL_BASE64_C /** * \def POLARSSL_BIGNUM_C * * Enable the multo-precision integer library. * * Module: library/bignum.c * Caller: library/dhm.c * library/rsa.c * library/ssl_tls.c * library/x509parse.c * * This module is required for RSA and DHM support. */ #define POLARSSL_BIGNUM_C /** * \def POLARSSL_CAMELLIA_C * * Enable the Camellia block cipher. * * Module: library/camellia.c * Caller: library/ssl_tls.c * * This module enabled the following cipher suites: * SSL_RSA_CAMELLIA_128_SHA * SSL_RSA_CAMELLIA_256_SHA * SSL_EDH_RSA_CAMELLIA_256_SHA */ #define POLARSSL_CAMELLIA_C /** * \def POLARSSL_CERTS_C * * Enable the test certificates. * * Module: library/certs.c * Caller: * * This module is used for testing (ssl_client/server). */ #define POLARSSL_CERTS_C /** * \def POLARSSL_CIPHER_C * * Enable the generic cipher layer. * * Module: library/cipher.c * Caller: * * Uncomment to enable generic cipher wrappers. */ #define POLARSSL_CIPHER_C /** * \def POLARSSL_DEBUG_C * * Enable the debug functions. * * Module: library/debug.c * Caller: library/ssl_cli.c * library/ssl_srv.c * library/ssl_tls.c * * This module provides debugging functions. */ #define POLARSSL_DEBUG_C /** * \def POLARSSL_DES_C * * Enable the DES block cipher. * * Module: library/des.c * Caller: library/ssl_tls.c * * This module enables the following ciphersuites: * SSL_RSA_DES_168_SHA * SSL_EDH_RSA_DES_168_SHA */ #define POLARSSL_DES_C /** * \def POLARSSL_DHM_C * * Enable the Diffie-Hellman-Merkle key exchange. * * Module: library/dhm.c * Caller: library/ssl_cli.c * library/ssl_srv.c * * This module enables the following ciphersuites: * SSL_EDH_RSA_DES_168_SHA * SSL_EDH_RSA_AES_256_SHA * SSL_EDH_RSA_CAMELLIA_256_SHA */ #define POLARSSL_DHM_C /** * \def POLARSSL_ERROR_C * * Enable error code to error string conversion. * * Module: library/error.c * Caller: * * This module enables err_strerror(). */ #define POLARSSL_ERROR_C /** * \def POLARSSL_HAVEGE_C * * Enable the HAVEGE random generator. * * Module: library/havege.c * Caller: * * Requires: POLARSSL_TIMING_C * * This module enables the HAVEGE random number generator. */ #define POLARSSL_HAVEGE_C /** * \def POLARSSL_MD_C * * Enable the generic message digest layer. * * Module: library/md.c * Caller: * * Uncomment to enable generic message digest wrappers. */ #define POLARSSL_MD_C /** * \def POLARSSL_MD2_C * * Enable the MD2 hash algorithm * * Module: library/md2.c * Caller: library/x509parse.c * * Uncomment to enable support for (rare) MD2-signed X.509 certs. * #define POLARSSL_MD2_C */ /** * \def POLARSSL_MD4_C * * Enable the MD4 hash algorithm * * Module: library/md4.c * Caller: library/x509parse.c * * Uncomment to enable support for (rare) MD4-signed X.509 certs. * #define POLARSSL_MD4_C */ /** * \def POLARSSL_MD5_C * * Enable the MD5 hash algorithm * * Module: library/md5.c * Caller: library/ssl_tls.c * library/x509parse.c * * This module is required for SSL/TLS and X.509. */ #define POLARSSL_MD5_C /** * \def POLARSSL_NET_C * * Enable the TCP/IP networking routines. * * Module: library/net.c * Caller: * * This module provides TCP/IP networking routines. */ #define POLARSSL_NET_C /** * \def POLARSSL_PADLOCK_C * * Enable VIA Padlock support on x86. * * Module: library/padlock.c * Caller: library/aes.c * * This modules adds support for the VIA PadLock on x86. */ #define POLARSSL_PADLOCK_C /** * \def POLARSSL_PEM_C * * Enable PEM decoding * * Module: library/pem.c * Caller: library/x509parse.c * * Requires: POLARSSL_BASE64_C * * This modules adds support for decoding PEM files. */ #define POLARSSL_PEM_C /** * \def POLARSSL_PKCS11_C * * Enable support for PKCS#11 smartcard support. * * Module: library/ssl_srv.c * Caller: library/ssl_cli.c * library/ssl_srv.c * * Requires: POLARSSL_SSL_TLS_C * * This module is required for SSL/TLS PKCS #11 smartcard support. * Requires the presence of the PKCS#11 helper library (libpkcs11-helper) #define POLARSSL_PKCS11_C */ /** * \def POLARSSL_RSA_C * * Enable the RSA public-key cryptosystem. * * Module: library/rsa.c * Caller: library/ssl_cli.c * library/ssl_srv.c * library/ssl_tls.c * library/x509.c * * Requires: POLARSSL_BIGNUM_C * * This module is required for SSL/TLS and MD5-signed certificates. */ #define POLARSSL_RSA_C /** * \def POLARSSL_SHA1_C * * Enable the SHA1 cryptographic hash algorithm. * * Module: library/sha1.c * Caller: library/ssl_cli.c * library/ssl_srv.c * library/ssl_tls.c * library/x509parse.c * * This module is required for SSL/TLS and SHA1-signed certificates. */ #define POLARSSL_SHA1_C /** * \def POLARSSL_SHA2_C * * Enable the SHA-224 and SHA-256 cryptographic hash algorithms. * * Module: library/sha2.c * Caller: library/md_wrap.c * library/x509parse.c * * This module adds support for SHA-224 and SHA-256. */ #define POLARSSL_SHA2_C /** * \def POLARSSL_SHA4_C * * Enable the SHA-384 and SHA-512 cryptographic hash algorithms. * * Module: library/sha4.c * Caller: library/md_wrap.c * library/x509parse.c * * This module adds support for SHA-384 and SHA-512. */ #define POLARSSL_SHA4_C /** * \def POLARSSL_SSL_CLI_C * * Enable the SSL/TLS client code. * * Module: library/ssl_cli.c * Caller: * * Requires: POLARSSL_SSL_TLS_C * * This module is required for SSL/TLS client support. */ #define POLARSSL_SSL_CLI_C /* * \def POLARSSL_SSL_SRV_C * * Enable the SSL/TLS server code. * * Module: library/ssl_srv.c * Caller: * * Requires: POLARSSL_SSL_TLS_C * * This module is required for SSL/TLS server support. */ #define POLARSSL_SSL_SRV_C /** * \def POLARSSL_SSL_TLS_C * * Enable the generic SSL/TLS code. * * Module: library/ssl_tls.c * Caller: library/ssl_cli.c * library/ssl_srv.c * * Requires: POLARSSL_MD5_C, POLARSSL_SHA1_C, POLARSSL_X509_PARSE_C * * This module is required for SSL/TLS. */ #define POLARSSL_SSL_TLS_C /** * \def POLARSSL_TIMING_C * * Enable the portable timing interface. * * Module: library/timing.c * Caller: library/havege.c * * This module is used by the HAVEGE random number generator. */ #define POLARSSL_TIMING_C /** * \def POLARSSL_VERSION_C * * Enable run-time version information. * * Module: library/version.c * * This module provides run-time version information. */ #define POLARSSL_VERSION_C /** * \def POLARSSL_X509_PARSE_C * * Enable X.509 certificate parsing. * * Module: library/x509parse.c * Caller: library/ssl_cli.c * library/ssl_srv.c * library/ssl_tls.c * * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C * * This module is required for X.509 certificate parsing. */ #define POLARSSL_X509_PARSE_C /** * \def POLARSSL_XTEA_C * * Enable the XTEA block cipher. * * Module: library/xtea.c * Caller: */ #define POLARSSL_XTEA_C /* \} name */ #endif /* config.h */ mod_gearman-1.4.14/include/polarssl/md5.h0000644001161000116100000001013311660503135015101 00000000000000/** * \file md5.h * * \brief MD5 message digest algorithm (hash function) * * Copyright (C) 2006-2010, Brainspark B.V. * * This file is part of PolarSSL (http://www.polarssl.org) * Lead Maintainer: Paul Bakker * * All rights reserved. * * This program 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 2 of the License, or * (at your option) any later version. * * This program 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 this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef POLARSSL_MD5_H #define POLARSSL_MD5_H #include /** * \brief MD5 context structure */ typedef struct { unsigned long total[2]; /*!< number of bytes processed */ unsigned long state[4]; /*!< intermediate digest state */ unsigned char buffer[64]; /*!< data block being processed */ unsigned char ipad[64]; /*!< HMAC: inner padding */ unsigned char opad[64]; /*!< HMAC: outer padding */ } md5_context; #ifdef __cplusplus extern "C" { #endif /** * \brief MD5 context setup * * \param ctx context to be initialized */ void md5_starts( md5_context *ctx ); /** * \brief MD5 process buffer * * \param ctx MD5 context * \param input buffer holding the data * \param ilen length of the input data */ void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief MD5 final digest * * \param ctx MD5 context * \param output MD5 checksum result */ void md5_finish( md5_context *ctx, unsigned char output[16] ); /** * \brief Output = MD5( input buffer ) * * \param input buffer holding the data * \param ilen length of the input data * \param output MD5 checksum result */ void md5( const unsigned char *input, size_t ilen, unsigned char output[16] ); /** * \brief Output = MD5( file contents ) * * \param path input file name * \param output MD5 checksum result * * \return 0 if successful, 1 if fopen failed, * or 2 if fread failed */ int md5_file( const char *path, unsigned char output[16] ); /** * \brief MD5 HMAC context setup * * \param ctx HMAC context to be initialized * \param key HMAC secret key * \param keylen length of the HMAC key */ void md5_hmac_starts( md5_context *ctx, const unsigned char *key, size_t keylen ); /** * \brief MD5 HMAC process buffer * * \param ctx HMAC context * \param input buffer holding the data * \param ilen length of the input data */ void md5_hmac_update( md5_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief MD5 HMAC final digest * * \param ctx HMAC context * \param output MD5 HMAC checksum result */ void md5_hmac_finish( md5_context *ctx, unsigned char output[16] ); /** * \brief MD5 HMAC context reset * * \param ctx HMAC context to be reset */ void md5_hmac_reset( md5_context *ctx ); /** * \brief Output = HMAC-MD5( hmac key, input buffer ) * * \param key HMAC secret key * \param keylen length of the HMAC key * \param input buffer holding the data * \param ilen length of the input data * \param output HMAC-MD5 result */ void md5_hmac( const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[16] ); /** * \brief Checkup routine * * \return 0 if successful, or 1 if the test failed */ int md5_self_test( int verbose ); #ifdef __cplusplus } #endif #endif /* md5.h */ mod_gearman-1.4.14/include/mod_gearman.h0000644001161000116100000000571711552052143015040 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ #define MOD_GM_NEB /**< set mod_gearman neb features */ #define NSCORE /**< enable core features */ #include "utils.h" #include "common.h" #include #include #include #include #include #define GM_PERFDATA_QUEUE "perfdata" /**< default performance data queue */ /** @file * @brief Mod-Gearman NEB Module * @addtogroup mod_gearman_neb_module NEB Module * * The Mod-Gearman NEB module loads into the core and intercepts scheduled host * and service checks as well as eventhander jobs. * The module start a single new thread which acts as gearman client and worker. * The client is used to send new jobs into the gearman queues (functions). The * worker listens on the result queue and puts back the finished results. * Before the core reaps the result they will be merged together with the ones * from gearman. * * @{ */ /* include some Nagios stuff as well */ #include "nagios/nagios.h" #include "nagios/neberrors.h" #include "nagios/nebstructs.h" #include "nagios/nebcallbacks.h" #include "nagios/broker.h" #include "nagios/macros.h" /* include the gearman libs */ #include /** main NEB module init function * * this function gets initally called when loading the module * * @param[in] flags - module flags * @param[in] args - module arguments from the core config * @param[in] handle - our module handle * * @return Zero on success, or a non-zero error value. */ int nebmodule_init( int flags, char * args, nebmodule * handle); /** NEB module deinit function * * this function gets called before unloading the module from the core * * @param[in] flags - module flags * @param[in] reason - reason for unloading the module * * @return nothing */ int nebmodule_deinit( int flags, int reason ); /** adds check result to result list * * @param[in] newcheckresult - new checkresult structure to add to list * * @return nothing */ void mod_gm_add_result_to_list(check_result * newcheckresult); /** * @} */ mod_gearman-1.4.14/include/worker_client.h0000644001161000116100000000375712212675260015445 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /** @file * @brief header for mod-gearman worker client component * * @{ */ #include #include #include #include #include #include #define MOD_GM_WORKER #include "config.h" #include "common.h" #define GM_JOB_START 0 #define GM_JOB_END 1 #define GM_WORKER_MULTI 0 #define GM_WORKER_STANDALONE 1 #define GM_WORKER_STATUS 2 #ifdef EMBEDDEDPERL void worker_client(int worker_mode, int indx, int shid, char**env); #else void worker_client(int worker_mode, int indx, int shid); #endif void worker_loop(void); void *get_job( gearman_job_st *, void *, size_t *, gearman_return_t * ); void do_exec_job(void); int set_worker( gearman_worker_st *worker ); void exit_sighandler(int sig); void idle_sighandler(int sig); void set_state(int status); void clean_worker_exit(int sig); void *return_status( gearman_job_st *, void *, size_t *, gearman_return_t *); #ifdef GM_DEBUG void write_debug_file(char ** text); #endif /** * @} */ mod_gearman-1.4.14/common/0000755001161000116100000000000012241511662012333 500000000000000mod_gearman-1.4.14/common/md5.c0000644001161000116100000003667211660503135013122 00000000000000/* * RFC 1321 compliant MD5 implementation * * Copyright (C) 2006-2010, Brainspark B.V. * * This file is part of PolarSSL (http://www.polarssl.org) * Lead Maintainer: Paul Bakker * * All rights reserved. * * This program 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 2 of the License, or * (at your option) any later version. * * This program 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 this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * The MD5 algorithm was designed by Ron Rivest in 1991. * * http://www.ietf.org/rfc/rfc1321.txt */ #include "polarssl/config.h" #if defined(POLARSSL_MD5_C) #include "polarssl/md5.h" #if defined(POLARSSL_FS_IO) || defined(POLARSSL_SELF_TEST) #include #endif /* * 32-bit integer manipulation macros (little endian) */ #ifndef GET_ULONG_LE #define GET_ULONG_LE(n,b,i) \ { \ (n) = ( (unsigned long) (b)[(i) ] ) \ | ( (unsigned long) (b)[(i) + 1] << 8 ) \ | ( (unsigned long) (b)[(i) + 2] << 16 ) \ | ( (unsigned long) (b)[(i) + 3] << 24 ); \ } #endif #ifndef PUT_ULONG_LE #define PUT_ULONG_LE(n,b,i) \ { \ (b)[(i) ] = (unsigned char) ( (n) ); \ (b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \ (b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \ (b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \ } #endif /* * MD5 context setup */ void md5_starts( md5_context *ctx ) { ctx->total[0] = 0; ctx->total[1] = 0; ctx->state[0] = 0x67452301; ctx->state[1] = 0xEFCDAB89; ctx->state[2] = 0x98BADCFE; ctx->state[3] = 0x10325476; } static void md5_process( md5_context *ctx, const unsigned char data[64] ) { unsigned long X[16], A, B, C, D; GET_ULONG_LE( X[ 0], data, 0 ); GET_ULONG_LE( X[ 1], data, 4 ); GET_ULONG_LE( X[ 2], data, 8 ); GET_ULONG_LE( X[ 3], data, 12 ); GET_ULONG_LE( X[ 4], data, 16 ); GET_ULONG_LE( X[ 5], data, 20 ); GET_ULONG_LE( X[ 6], data, 24 ); GET_ULONG_LE( X[ 7], data, 28 ); GET_ULONG_LE( X[ 8], data, 32 ); GET_ULONG_LE( X[ 9], data, 36 ); GET_ULONG_LE( X[10], data, 40 ); GET_ULONG_LE( X[11], data, 44 ); GET_ULONG_LE( X[12], data, 48 ); GET_ULONG_LE( X[13], data, 52 ); GET_ULONG_LE( X[14], data, 56 ); GET_ULONG_LE( X[15], data, 60 ); #define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) #define P(a,b,c,d,k,s,t) \ { \ a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ } A = ctx->state[0]; B = ctx->state[1]; C = ctx->state[2]; D = ctx->state[3]; #define F(x,y,z) (z ^ (x & (y ^ z))) P( A, B, C, D, 0, 7, 0xD76AA478 ); P( D, A, B, C, 1, 12, 0xE8C7B756 ); P( C, D, A, B, 2, 17, 0x242070DB ); P( B, C, D, A, 3, 22, 0xC1BDCEEE ); P( A, B, C, D, 4, 7, 0xF57C0FAF ); P( D, A, B, C, 5, 12, 0x4787C62A ); P( C, D, A, B, 6, 17, 0xA8304613 ); P( B, C, D, A, 7, 22, 0xFD469501 ); P( A, B, C, D, 8, 7, 0x698098D8 ); P( D, A, B, C, 9, 12, 0x8B44F7AF ); P( C, D, A, B, 10, 17, 0xFFFF5BB1 ); P( B, C, D, A, 11, 22, 0x895CD7BE ); P( A, B, C, D, 12, 7, 0x6B901122 ); P( D, A, B, C, 13, 12, 0xFD987193 ); P( C, D, A, B, 14, 17, 0xA679438E ); P( B, C, D, A, 15, 22, 0x49B40821 ); #undef F #define F(x,y,z) (y ^ (z & (x ^ y))) P( A, B, C, D, 1, 5, 0xF61E2562 ); P( D, A, B, C, 6, 9, 0xC040B340 ); P( C, D, A, B, 11, 14, 0x265E5A51 ); P( B, C, D, A, 0, 20, 0xE9B6C7AA ); P( A, B, C, D, 5, 5, 0xD62F105D ); P( D, A, B, C, 10, 9, 0x02441453 ); P( C, D, A, B, 15, 14, 0xD8A1E681 ); P( B, C, D, A, 4, 20, 0xE7D3FBC8 ); P( A, B, C, D, 9, 5, 0x21E1CDE6 ); P( D, A, B, C, 14, 9, 0xC33707D6 ); P( C, D, A, B, 3, 14, 0xF4D50D87 ); P( B, C, D, A, 8, 20, 0x455A14ED ); P( A, B, C, D, 13, 5, 0xA9E3E905 ); P( D, A, B, C, 2, 9, 0xFCEFA3F8 ); P( C, D, A, B, 7, 14, 0x676F02D9 ); P( B, C, D, A, 12, 20, 0x8D2A4C8A ); #undef F #define F(x,y,z) (x ^ y ^ z) P( A, B, C, D, 5, 4, 0xFFFA3942 ); P( D, A, B, C, 8, 11, 0x8771F681 ); P( C, D, A, B, 11, 16, 0x6D9D6122 ); P( B, C, D, A, 14, 23, 0xFDE5380C ); P( A, B, C, D, 1, 4, 0xA4BEEA44 ); P( D, A, B, C, 4, 11, 0x4BDECFA9 ); P( C, D, A, B, 7, 16, 0xF6BB4B60 ); P( B, C, D, A, 10, 23, 0xBEBFBC70 ); P( A, B, C, D, 13, 4, 0x289B7EC6 ); P( D, A, B, C, 0, 11, 0xEAA127FA ); P( C, D, A, B, 3, 16, 0xD4EF3085 ); P( B, C, D, A, 6, 23, 0x04881D05 ); P( A, B, C, D, 9, 4, 0xD9D4D039 ); P( D, A, B, C, 12, 11, 0xE6DB99E5 ); P( C, D, A, B, 15, 16, 0x1FA27CF8 ); P( B, C, D, A, 2, 23, 0xC4AC5665 ); #undef F #define F(x,y,z) (y ^ (x | ~z)) P( A, B, C, D, 0, 6, 0xF4292244 ); P( D, A, B, C, 7, 10, 0x432AFF97 ); P( C, D, A, B, 14, 15, 0xAB9423A7 ); P( B, C, D, A, 5, 21, 0xFC93A039 ); P( A, B, C, D, 12, 6, 0x655B59C3 ); P( D, A, B, C, 3, 10, 0x8F0CCC92 ); P( C, D, A, B, 10, 15, 0xFFEFF47D ); P( B, C, D, A, 1, 21, 0x85845DD1 ); P( A, B, C, D, 8, 6, 0x6FA87E4F ); P( D, A, B, C, 15, 10, 0xFE2CE6E0 ); P( C, D, A, B, 6, 15, 0xA3014314 ); P( B, C, D, A, 13, 21, 0x4E0811A1 ); P( A, B, C, D, 4, 6, 0xF7537E82 ); P( D, A, B, C, 11, 10, 0xBD3AF235 ); P( C, D, A, B, 2, 15, 0x2AD7D2BB ); P( B, C, D, A, 9, 21, 0xEB86D391 ); #undef F ctx->state[0] += A; ctx->state[1] += B; ctx->state[2] += C; ctx->state[3] += D; } /* * MD5 process buffer */ void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen ) { size_t fill; unsigned long left; if( ilen <= 0 ) return; left = ctx->total[0] & 0x3F; fill = 64 - left; ctx->total[0] += (unsigned long) ilen; ctx->total[0] &= 0xFFFFFFFF; if( ctx->total[0] < (unsigned long) ilen ) ctx->total[1]++; if( left && ilen >= fill ) { memcpy( (void *) (ctx->buffer + left), (void *) input, fill ); md5_process( ctx, ctx->buffer ); input += fill; ilen -= fill; left = 0; } while( ilen >= 64 ) { md5_process( ctx, input ); input += 64; ilen -= 64; } if( ilen > 0 ) { memcpy( (void *) (ctx->buffer + left), (void *) input, ilen ); } } static const unsigned char md5_padding[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* * MD5 final digest */ void md5_finish( md5_context *ctx, unsigned char output[16] ) { unsigned long last, padn; unsigned long high, low; unsigned char msglen[8]; high = ( ctx->total[0] >> 29 ) | ( ctx->total[1] << 3 ); low = ( ctx->total[0] << 3 ); PUT_ULONG_LE( low, msglen, 0 ); PUT_ULONG_LE( high, msglen, 4 ); last = ctx->total[0] & 0x3F; padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); md5_update( ctx, (unsigned char *) md5_padding, padn ); md5_update( ctx, msglen, 8 ); PUT_ULONG_LE( ctx->state[0], output, 0 ); PUT_ULONG_LE( ctx->state[1], output, 4 ); PUT_ULONG_LE( ctx->state[2], output, 8 ); PUT_ULONG_LE( ctx->state[3], output, 12 ); } /* * output = MD5( input buffer ) */ void md5( const unsigned char *input, size_t ilen, unsigned char output[16] ) { md5_context ctx; md5_starts( &ctx ); md5_update( &ctx, input, ilen ); md5_finish( &ctx, output ); memset( &ctx, 0, sizeof( md5_context ) ); } #if defined(POLARSSL_FS_IO) /* * output = MD5( file contents ) */ int md5_file( const char *path, unsigned char output[16] ) { FILE *f; size_t n; md5_context ctx; unsigned char buf[1024]; if( ( f = fopen( path, "rb" ) ) == NULL ) return( 1 ); md5_starts( &ctx ); while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) md5_update( &ctx, buf, n ); md5_finish( &ctx, output ); memset( &ctx, 0, sizeof( md5_context ) ); if( ferror( f ) != 0 ) { fclose( f ); return( 2 ); } fclose( f ); return( 0 ); } #endif /* POLARSSL_FS_IO */ /* * MD5 HMAC context setup */ void md5_hmac_starts( md5_context *ctx, const unsigned char *key, size_t keylen ) { size_t i; unsigned char sum[16]; if( keylen > 64 ) { md5( key, keylen, sum ); keylen = 16; key = sum; } memset( ctx->ipad, 0x36, 64 ); memset( ctx->opad, 0x5C, 64 ); for( i = 0; i < keylen; i++ ) { ctx->ipad[i] = (unsigned char)( ctx->ipad[i] ^ key[i] ); ctx->opad[i] = (unsigned char)( ctx->opad[i] ^ key[i] ); } md5_starts( ctx ); md5_update( ctx, ctx->ipad, 64 ); memset( sum, 0, sizeof( sum ) ); } /* * MD5 HMAC process buffer */ void md5_hmac_update( md5_context *ctx, const unsigned char *input, size_t ilen ) { md5_update( ctx, input, ilen ); } /* * MD5 HMAC final digest */ void md5_hmac_finish( md5_context *ctx, unsigned char output[16] ) { unsigned char tmpbuf[16]; md5_finish( ctx, tmpbuf ); md5_starts( ctx ); md5_update( ctx, ctx->opad, 64 ); md5_update( ctx, tmpbuf, 16 ); md5_finish( ctx, output ); memset( tmpbuf, 0, sizeof( tmpbuf ) ); } /* * MD5 HMAC context reset */ void md5_hmac_reset( md5_context *ctx ) { md5_starts( ctx ); md5_update( ctx, ctx->ipad, 64 ); } /* * output = HMAC-MD5( hmac key, input buffer ) */ void md5_hmac( const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[16] ) { md5_context ctx; md5_hmac_starts( &ctx, key, keylen ); md5_hmac_update( &ctx, input, ilen ); md5_hmac_finish( &ctx, output ); memset( &ctx, 0, sizeof( md5_context ) ); } #if defined(POLARSSL_SELF_TEST) /* * RFC 1321 test vectors */ static unsigned char md5_test_buf[7][81] = { { "" }, { "a" }, { "abc" }, { "message digest" }, { "abcdefghijklmnopqrstuvwxyz" }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, { "12345678901234567890123456789012345678901234567890123456789012" \ "345678901234567890" } }; static const int md5_test_buflen[7] = { 0, 1, 3, 14, 26, 62, 80 }; static const unsigned char md5_test_sum[7][16] = { { 0xD4, 0x1D, 0x8C, 0xD9, 0x8F, 0x00, 0xB2, 0x04, 0xE9, 0x80, 0x09, 0x98, 0xEC, 0xF8, 0x42, 0x7E }, { 0x0C, 0xC1, 0x75, 0xB9, 0xC0, 0xF1, 0xB6, 0xA8, 0x31, 0xC3, 0x99, 0xE2, 0x69, 0x77, 0x26, 0x61 }, { 0x90, 0x01, 0x50, 0x98, 0x3C, 0xD2, 0x4F, 0xB0, 0xD6, 0x96, 0x3F, 0x7D, 0x28, 0xE1, 0x7F, 0x72 }, { 0xF9, 0x6B, 0x69, 0x7D, 0x7C, 0xB7, 0x93, 0x8D, 0x52, 0x5A, 0x2F, 0x31, 0xAA, 0xF1, 0x61, 0xD0 }, { 0xC3, 0xFC, 0xD3, 0xD7, 0x61, 0x92, 0xE4, 0x00, 0x7D, 0xFB, 0x49, 0x6C, 0xCA, 0x67, 0xE1, 0x3B }, { 0xD1, 0x74, 0xAB, 0x98, 0xD2, 0x77, 0xD9, 0xF5, 0xA5, 0x61, 0x1C, 0x2C, 0x9F, 0x41, 0x9D, 0x9F }, { 0x57, 0xED, 0xF4, 0xA2, 0x2B, 0xE3, 0xC9, 0x55, 0xAC, 0x49, 0xDA, 0x2E, 0x21, 0x07, 0xB6, 0x7A } }; /* * RFC 2202 test vectors */ static unsigned char md5_hmac_test_key[7][26] = { { "\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B" }, { "Jefe" }, { "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA" }, { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10" "\x11\x12\x13\x14\x15\x16\x17\x18\x19" }, { "\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C" }, { "" }, /* 0xAA 80 times */ { "" } }; static const int md5_hmac_test_keylen[7] = { 16, 4, 16, 25, 16, 80, 80 }; static unsigned char md5_hmac_test_buf[7][74] = { { "Hi There" }, { "what do ya want for nothing?" }, { "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" }, { "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" }, { "Test With Truncation" }, { "Test Using Larger Than Block-Size Key - Hash Key First" }, { "Test Using Larger Than Block-Size Key and Larger" " Than One Block-Size Data" } }; static const int md5_hmac_test_buflen[7] = { 8, 28, 50, 50, 20, 54, 73 }; static const unsigned char md5_hmac_test_sum[7][16] = { { 0x92, 0x94, 0x72, 0x7A, 0x36, 0x38, 0xBB, 0x1C, 0x13, 0xF4, 0x8E, 0xF8, 0x15, 0x8B, 0xFC, 0x9D }, { 0x75, 0x0C, 0x78, 0x3E, 0x6A, 0xB0, 0xB5, 0x03, 0xEA, 0xA8, 0x6E, 0x31, 0x0A, 0x5D, 0xB7, 0x38 }, { 0x56, 0xBE, 0x34, 0x52, 0x1D, 0x14, 0x4C, 0x88, 0xDB, 0xB8, 0xC7, 0x33, 0xF0, 0xE8, 0xB3, 0xF6 }, { 0x69, 0x7E, 0xAF, 0x0A, 0xCA, 0x3A, 0x3A, 0xEA, 0x3A, 0x75, 0x16, 0x47, 0x46, 0xFF, 0xAA, 0x79 }, { 0x56, 0x46, 0x1E, 0xF2, 0x34, 0x2E, 0xDC, 0x00, 0xF9, 0xBA, 0xB9, 0x95 }, { 0x6B, 0x1A, 0xB7, 0xFE, 0x4B, 0xD7, 0xBF, 0x8F, 0x0B, 0x62, 0xE6, 0xCE, 0x61, 0xB9, 0xD0, 0xCD }, { 0x6F, 0x63, 0x0F, 0xAD, 0x67, 0xCD, 0xA0, 0xEE, 0x1F, 0xB1, 0xF5, 0x62, 0xDB, 0x3A, 0xA5, 0x3E } }; /* * Checkup routine */ int md5_self_test( int verbose ) { int i, buflen; unsigned char buf[1024]; unsigned char md5sum[16]; md5_context ctx; for( i = 0; i < 7; i++ ) { if( verbose != 0 ) printf( " MD5 test #%d: ", i + 1 ); md5( md5_test_buf[i], md5_test_buflen[i], md5sum ); if( memcmp( md5sum, md5_test_sum[i], 16 ) != 0 ) { if( verbose != 0 ) printf( "failed\n" ); return( 1 ); } if( verbose != 0 ) printf( "passed\n" ); } if( verbose != 0 ) printf( "\n" ); for( i = 0; i < 7; i++ ) { if( verbose != 0 ) printf( " HMAC-MD5 test #%d: ", i + 1 ); if( i == 5 || i == 6 ) { memset( buf, '\xAA', buflen = 80 ); md5_hmac_starts( &ctx, buf, buflen ); } else md5_hmac_starts( &ctx, md5_hmac_test_key[i], md5_hmac_test_keylen[i] ); md5_hmac_update( &ctx, md5_hmac_test_buf[i], md5_hmac_test_buflen[i] ); md5_hmac_finish( &ctx, md5sum ); buflen = ( i == 4 ) ? 12 : 16; if( memcmp( md5sum, md5_hmac_test_sum[i], buflen ) != 0 ) { if( verbose != 0 ) printf( "failed\n" ); return( 1 ); } if( verbose != 0 ) printf( "passed\n" ); } if( verbose != 0 ) printf( "\n" ); return( 0 ); } #endif #endif mod_gearman-1.4.14/common/rijndael.c0000644001161000116100000015650511443652521014226 00000000000000/* * http://www.efgh.com/software/rijndael.htm */ #define FULL_UNROLL #include "rijndael.h" typedef unsigned long u32; typedef unsigned char u8; static const u32 Te0[256] = { 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU, 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU, 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU, 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU, 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU, 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU, 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U, 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU, 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU, 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU, 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU, 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U, 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU, 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU, 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U, 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U, 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU, 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U, 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU, 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U, 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U, 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU, 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U, 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U, 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U, 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U, 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U, 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU, }; static const u32 Te1[256] = { 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU, 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U, 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U, 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U, 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U, 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU, 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U, 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U, 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U, 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU, 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U, 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU, 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU, 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U, 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U, 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U, 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U, 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U, 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U, 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU, 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U, 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU, 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U, 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U, 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU, 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U, }; static const u32 Te2[256] = { 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU, 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U, 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U, 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U, 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U, 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U, 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU, 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U, 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U, 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U, 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU, 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U, 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU, 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU, 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U, 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U, 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U, 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U, 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U, 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U, 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU, 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U, 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU, 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U, 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U, 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U, 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU, 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U, }; static const u32 Te3[256] = { 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U, 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU, 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU, 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU, 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU, 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU, 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU, 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU, 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU, 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U, 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U, 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU, 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U, 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U, 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU, 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU, 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U, 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U, 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U, 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U, 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU, 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU, 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU, 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U, 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U, 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U, 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU, 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU, }; static const u32 Te4[256] = { 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU, 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U, 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU, 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U, 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU, 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U, 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU, 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U, 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U, 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU, 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U, 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U, 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U, 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU, 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U, 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U, 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU, 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U, 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U, 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U, 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU, 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU, 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U, 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU, 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU, 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U, 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU, 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U, 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU, 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U, 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U, 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U, 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU, 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U, 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU, 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U, 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU, 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U, 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U, 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU, 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU, 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU, 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U, 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U, 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU, 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U, 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU, 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U, 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU, 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U, 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU, 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU, 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U, 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU, 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U, 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU, 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U, 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U, 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U, 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU, 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU, 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U, 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, }; static const u32 Td0[256] = { 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U, 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU, 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU, 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U, 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU, 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U, 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU, 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU, 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U, 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU, 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U, 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU, 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U, 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU, 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU, 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU, 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U, 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U, 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U, 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U, 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U, 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U, 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U, 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU, 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU, 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU, 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU, 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U, 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U, 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U, }; static const u32 Td1[256] = { 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U, 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU, 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U, 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U, 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U, 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U, 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U, 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU, 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU, 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU, 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U, 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU, 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU, 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U, 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU, 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U, 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U, 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU, 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U, 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U, 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U, 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU, 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U, 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU, 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U, 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U, 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U, 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U, 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U, 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U, }; static const u32 Td2[256] = { 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U, 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U, 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U, 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U, 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU, 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U, 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U, 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U, 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U, 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U, 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU, 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U, 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU, 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU, 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU, 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U, 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U, 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU, 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U, 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U, 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U, 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U, 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U, 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U, 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U, 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U, 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U, }; static const u32 Td3[256] = { 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U, 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U, 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU, 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U, 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U, 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U, 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U, 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U, 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U, 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U, 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U, 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U, 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU, 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U, 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU, 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U, 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U, 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U, 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U, 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU, 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U, 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U, 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U, 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU, 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U, 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U, 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U, }; static const u32 Td4[256] = { 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U, 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U, 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU, 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU, 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U, 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U, 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U, 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU, 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U, 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU, 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU, 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU, 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U, 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U, 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U, 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U, 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U, 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U, 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU, 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U, 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U, 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU, 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U, 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U, 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U, 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU, 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U, 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U, 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU, 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U, 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U, 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU, 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U, 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU, 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU, 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U, 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U, 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U, 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U, 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU, 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U, 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U, 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU, 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU, 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU, 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U, 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU, 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U, 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U, 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U, 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U, 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU, 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U, 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU, 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU, 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU, 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU, 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U, 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU, 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U, 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU, 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U, 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, }; static const u32 rcon[] = { 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ }; #define GETU32(plaintext) (((u32)(plaintext)[0] << 24) ^ \ ((u32)(plaintext)[1] << 16) ^ \ ((u32)(plaintext)[2] << 8) ^ \ ((u32)(plaintext)[3])) #define PUTU32(ciphertext, st) { (ciphertext)[0] = (u8)((st) >> 24); \ (ciphertext)[1] = (u8)((st) >> 16); \ (ciphertext)[2] = (u8)((st) >> 8); \ (ciphertext)[3] = (u8)(st); } /** * Expand the cipher key into the encryption key schedule. * * @return the number of rounds for the given cipher key size. */ int rijndaelSetupEncrypt(u32 *rk, const u8 *key, int keybits) { int i = 0; u32 temp; rk[0] = GETU32(key ); rk[1] = GETU32(key + 4); rk[2] = GETU32(key + 8); rk[3] = GETU32(key + 12); if (keybits == 128) { for (;;) { temp = rk[3]; rk[4] = rk[0] ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ (Te4[(temp ) & 0xff] & 0x0000ff00) ^ (Te4[(temp >> 24) ] & 0x000000ff) ^ rcon[i]; rk[5] = rk[1] ^ rk[4]; rk[6] = rk[2] ^ rk[5]; rk[7] = rk[3] ^ rk[6]; if (++i == 10) return 10; rk += 4; } } rk[4] = GETU32(key + 16); rk[5] = GETU32(key + 20); if (keybits == 192) { for (;;) { temp = rk[ 5]; rk[ 6] = rk[ 0] ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ (Te4[(temp ) & 0xff] & 0x0000ff00) ^ (Te4[(temp >> 24) ] & 0x000000ff) ^ rcon[i]; rk[ 7] = rk[ 1] ^ rk[ 6]; rk[ 8] = rk[ 2] ^ rk[ 7]; rk[ 9] = rk[ 3] ^ rk[ 8]; if (++i == 8) return 12; rk[10] = rk[ 4] ^ rk[ 9]; rk[11] = rk[ 5] ^ rk[10]; rk += 6; } } rk[6] = GETU32(key + 24); rk[7] = GETU32(key + 28); if (keybits == 256) { for (;;) { temp = rk[ 7]; rk[ 8] = rk[ 0] ^ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ (Te4[(temp ) & 0xff] & 0x0000ff00) ^ (Te4[(temp >> 24) ] & 0x000000ff) ^ rcon[i]; rk[ 9] = rk[ 1] ^ rk[ 8]; rk[10] = rk[ 2] ^ rk[ 9]; rk[11] = rk[ 3] ^ rk[10]; if (++i == 7) return 14; temp = rk[11]; rk[12] = rk[ 4] ^ (Te4[(temp >> 24) ] & 0xff000000) ^ (Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^ (Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^ (Te4[(temp ) & 0xff] & 0x000000ff); rk[13] = rk[ 5] ^ rk[12]; rk[14] = rk[ 6] ^ rk[13]; rk[15] = rk[ 7] ^ rk[14]; rk += 8; } } return 0; } /** * Expand the cipher key into the decryption key schedule. * * @return the number of rounds for the given cipher key size. */ int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits) { int nrounds, i, j; u32 temp; /* expand the cipher key: */ nrounds = rijndaelSetupEncrypt(rk, key, keybits); /* invert the order of the round keys: */ for (i = 0, j = 4*nrounds; i < j; i += 4, j -= 4) { temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp; temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp; temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp; temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp; } /* apply the inverse MixColumn transform to all round keys but the first and the last: */ for (i = 1; i < nrounds; i++) { rk += 4; rk[0] = Td0[Te4[(rk[0] >> 24) ] & 0xff] ^ Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rk[0] ) & 0xff] & 0xff]; rk[1] = Td0[Te4[(rk[1] >> 24) ] & 0xff] ^ Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rk[1] ) & 0xff] & 0xff]; rk[2] = Td0[Te4[(rk[2] >> 24) ] & 0xff] ^ Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rk[2] ) & 0xff] & 0xff]; rk[3] = Td0[Te4[(rk[3] >> 24) ] & 0xff] ^ Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rk[3] ) & 0xff] & 0xff]; } return nrounds; } void rijndaelEncrypt(const u32 *rk, int nrounds, const u8 plaintext[16], u8 ciphertext[16]) { u32 s0, s1, s2, s3, t0, t1, t2, t3; #ifndef FULL_UNROLL int r; #endif /* ?FULL_UNROLL */ /* * map byte array block to cipher state * and add initial round key: */ s0 = GETU32(plaintext ) ^ rk[0]; s1 = GETU32(plaintext + 4) ^ rk[1]; s2 = GETU32(plaintext + 8) ^ rk[2]; s3 = GETU32(plaintext + 12) ^ rk[3]; #ifdef FULL_UNROLL /* round 1: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7]; /* round 2: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11]; /* round 3: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15]; /* round 4: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19]; /* round 5: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23]; /* round 6: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27]; /* round 7: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31]; /* round 8: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35]; /* round 9: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39]; if (nrounds > 10) { /* round 10: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43]; /* round 11: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47]; if (nrounds > 12) { /* round 12: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51]; /* round 13: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55]; } } rk += nrounds << 2; #else /* !FULL_UNROLL */ /* * nrounds - 1 full rounds: */ r = nrounds >> 1; for (;;) { t0 = Te0[(s0 >> 24) ] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[(s3 ) & 0xff] ^ rk[4]; t1 = Te0[(s1 >> 24) ] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[(s0 ) & 0xff] ^ rk[5]; t2 = Te0[(s2 >> 24) ] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[(s1 ) & 0xff] ^ rk[6]; t3 = Te0[(s3 >> 24) ] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[(s2 ) & 0xff] ^ rk[7]; rk += 8; if (--r == 0) break; s0 = Te0[(t0 >> 24) ] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[(t3 ) & 0xff] ^ rk[0]; s1 = Te0[(t1 >> 24) ] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[(t0 ) & 0xff] ^ rk[1]; s2 = Te0[(t2 >> 24) ] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[(t1 ) & 0xff] ^ rk[2]; s3 = Te0[(t3 >> 24) ] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[(t2 ) & 0xff] ^ rk[3]; } #endif /* ?FULL_UNROLL */ /* * apply last round and * map cipher state to byte array block: */ s0 = (Te4[(t0 >> 24) ] & 0xff000000) ^ (Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ (Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ (Te4[(t3 ) & 0xff] & 0x000000ff) ^ rk[0]; PUTU32(ciphertext , s0); s1 = (Te4[(t1 >> 24) ] & 0xff000000) ^ (Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ (Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ (Te4[(t0 ) & 0xff] & 0x000000ff) ^ rk[1]; PUTU32(ciphertext + 4, s1); s2 = (Te4[(t2 >> 24) ] & 0xff000000) ^ (Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ (Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ (Te4[(t1 ) & 0xff] & 0x000000ff) ^ rk[2]; PUTU32(ciphertext + 8, s2); s3 = (Te4[(t3 >> 24) ] & 0xff000000) ^ (Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ (Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ (Te4[(t2 ) & 0xff] & 0x000000ff) ^ rk[3]; PUTU32(ciphertext + 12, s3); } void rijndaelDecrypt(const u32 *rk, int nrounds, const u8 ciphertext[16], u8 plaintext[16]) { u32 s0, s1, s2, s3, t0, t1, t2, t3; #ifndef FULL_UNROLL int r; #endif /* ?FULL_UNROLL */ /* * map byte array block to cipher state * and add initial round key: */ s0 = GETU32(ciphertext ) ^ rk[0]; s1 = GETU32(ciphertext + 4) ^ rk[1]; s2 = GETU32(ciphertext + 8) ^ rk[2]; s3 = GETU32(ciphertext + 12) ^ rk[3]; #ifdef FULL_UNROLL /* round 1: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7]; /* round 2: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11]; /* round 3: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15]; /* round 4: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19]; /* round 5: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23]; /* round 6: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27]; /* round 7: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31]; /* round 8: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35]; /* round 9: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39]; if (nrounds > 10) { /* round 10: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43]; /* round 11: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47]; if (nrounds > 12) { /* round 12: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51]; /* round 13: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55]; } } rk += nrounds << 2; #else /* !FULL_UNROLL */ /* * nrounds - 1 full rounds: */ r = nrounds >> 1; for (;;) { t0 = Td0[(s0 >> 24) ] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[(s1 ) & 0xff] ^ rk[4]; t1 = Td0[(s1 >> 24) ] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[(s2 ) & 0xff] ^ rk[5]; t2 = Td0[(s2 >> 24) ] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[(s3 ) & 0xff] ^ rk[6]; t3 = Td0[(s3 >> 24) ] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[(s0 ) & 0xff] ^ rk[7]; rk += 8; if (--r == 0) break; s0 = Td0[(t0 >> 24) ] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[(t1 ) & 0xff] ^ rk[0]; s1 = Td0[(t1 >> 24) ] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[(t2 ) & 0xff] ^ rk[1]; s2 = Td0[(t2 >> 24) ] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[(t3 ) & 0xff] ^ rk[2]; s3 = Td0[(t3 >> 24) ] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[(t0 ) & 0xff] ^ rk[3]; } #endif /* ?FULL_UNROLL */ /* * apply last round and * map cipher state to byte array block: */ s0 = (Td4[(t0 >> 24) ] & 0xff000000) ^ (Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ (Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ (Td4[(t1 ) & 0xff] & 0x000000ff) ^ rk[0]; PUTU32(plaintext , s0); s1 = (Td4[(t1 >> 24) ] & 0xff000000) ^ (Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ (Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ (Td4[(t2 ) & 0xff] & 0x000000ff) ^ rk[1]; PUTU32(plaintext + 4, s1); s2 = (Td4[(t2 >> 24) ] & 0xff000000) ^ (Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ (Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ (Td4[(t3 ) & 0xff] & 0x000000ff) ^ rk[2]; PUTU32(plaintext + 8, s2); s3 = (Td4[(t3 >> 24) ] & 0xff000000) ^ (Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ (Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ (Td4[(t0 ) & 0xff] & 0x000000ff) ^ rk[3]; PUTU32(plaintext + 12, s3); } mod_gearman-1.4.14/common/popenRWE.c0000644001161000116100000000302411740656252014125 00000000000000/** * Copyright 2009-2010 Bart Trojanowski * Licensed under GPLv2, or later, at your choosing. * * bidirectional popen() call * * @param rwepipe - int array of size three * @param exe - program to run * @param argv - argument list * @return pid or -1 on error * * The caller passes in an array of three integers (rwepipe), on successful * execution it can then write to element 0 (stdin of exe), and read from * element 1 (stdout) and 2 (stderr). */ #include "popenRWE.h" int popenRWE(int *rwepipe, char *command) { int in[2]; int out[2]; int err[2]; int pid; int rc; rc = pipe(in); if (rc<0) goto error_in; rc = pipe(out); if (rc<0) goto error_out; rc = pipe(err); if (rc<0) goto error_err; pid = fork(); if (pid > 0) { /* parent */ close(in[0]); close(out[1]); close(err[1]); rwepipe[0] = in[1]; rwepipe[1] = out[0]; rwepipe[2] = err[0]; return pid; } else if (pid == 0) { /* child */ close(in[1]); close(out[0]); close(err[0]); close(0); if(!dup(in[0])) { ; } close(1); if(!dup(out[1])) { ; } close(2); if(!dup(err[1])) { ; } execl( "/bin/sh", "sh", "-c", command, NULL ); _exit(1); } else goto error_fork; return pid; error_fork: close(err[0]); close(err[1]); error_err: close(out[0]); close(out[1]); error_out: close(in[0]); close(in[1]); error_in: return -1; } int pcloseRWE(int pid, int *rwepipe) { int rc, status; close(rwepipe[0]); close(rwepipe[1]); close(rwepipe[2]); rc = waitpid(pid, &status, 0); return status; } mod_gearman-1.4.14/common/base64.c0000644001161000116100000001277611447071417013526 00000000000000#include #include #include "base64.h" /* * http://freecode-freecode.blogspot.com/2008/02/base64c.html */ /** * characters used for Base64 encoding */ const char *BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * encode three bytes using base64 (RFC 3548) * * @param triple three bytes that should be encoded * @param result buffer of four characters where the result is stored */ void _base64_encode_triple(unsigned char triple[3], char result[4]) { int tripleValue, i; tripleValue = triple[0]; tripleValue *= 256; tripleValue += triple[1]; tripleValue *= 256; tripleValue += triple[2]; for (i=0; i<4; i++) { result[3-i] = BASE64_CHARS[tripleValue%64]; tripleValue /= 64; } } /** * encode an array of bytes using Base64 (RFC 3548) * * @param source the source buffer * @param sourcelen the length of the source buffer * @param target the target buffer * @param targetlen the length of the target buffer * @return 1 on success, 0 otherwise */ int base64_encode(unsigned char *source, size_t sourcelen, char *target, size_t targetlen) { /* check if the result will fit in the target buffer */ if ((sourcelen+2)/3*4 > targetlen-1) return 0; /* encode all full triples */ while (sourcelen >= 3) { _base64_encode_triple(source, target); sourcelen -= 3; source += 3; target += 4; } /* encode the last one or two characters */ if (sourcelen > 0) { unsigned char temp[3]; memset(temp, 0, sizeof(temp)); memcpy(temp, source, sourcelen); _base64_encode_triple(temp, target); target[3] = '='; if (sourcelen == 1) target[2] = '='; target += 4; } /* terminate the string */ target[0] = 0; return 1; } /** * determine the value of a base64 encoding character * * @param base64char the character of which the value is searched * @return the value in case of success (0-63), -1 on failure */ int _base64_char_value(char base64char) { if (base64char >= 'A' && base64char <= 'Z') return base64char-'A'; if (base64char >= 'a' && base64char <= 'z') return base64char-'a'+26; if (base64char >= '0' && base64char <= '9') return base64char-'0'+2*26; if (base64char == '+') return 2*26+10; if (base64char == '/') return 2*26+11; return -1; } /** * decode a 4 char base64 encoded byte triple * * @param quadruple the 4 characters that should be decoded * @param result the decoded data * @return lenth of the result (1, 2 or 3), 0 on failure */ int _base64_decode_triple(char quadruple[4], unsigned char *result) { int i, triple_value, bytes_to_decode = 3, only_equals_yet = 1; int char_value[4]; for (i=0; i<4; i++) char_value[i] = _base64_char_value(quadruple[i]); /* check if the characters are valid */ for (i=3; i>=0; i--) { if (char_value[i]<0) { if (only_equals_yet && quadruple[i]=='=') { /* we will ignore this character anyway, make it something * that does not break our calculations */ char_value[i]=0; bytes_to_decode--; continue; } return 0; } /* after we got a real character, no other '=' are allowed anymore */ only_equals_yet = 0; } /* if we got "====" as input, bytes_to_decode is -1 */ if (bytes_to_decode < 0) bytes_to_decode = 0; /* make one big value out of the partial values */ triple_value = char_value[0]; triple_value *= 64; triple_value += char_value[1]; triple_value *= 64; triple_value += char_value[2]; triple_value *= 64; triple_value += char_value[3]; /* break the big value into bytes */ for (i=bytes_to_decode; i<3; i++) triple_value /= 256; for (i=bytes_to_decode-1; i>=0; i--) { result[i] = triple_value%256; triple_value /= 256; } return bytes_to_decode; } /** * decode base64 encoded data * * @param source the encoded data (zero terminated) * @param target pointer to the target buffer * @param targetlen length of the target buffer * @return length of converted data on success, -1 otherwise */ size_t base64_decode(char *source, unsigned char *target, size_t targetlen) { char *src, *tmpptr; char quadruple[4], tmpresult[3]; int i, tmplen = 3; size_t converted = 0; /* concatinate '===' to the source to handle unpadded base64 data */ src = (char *)malloc(strlen(source)+5); if (src == NULL) return -1; strcpy(src, source); strcat(src, "===="); tmpptr = src; /* convert as long as we get a full result */ while (tmplen == 3) { /* get 4 characters to convert */ for (i=0; i<4; i++) { /* skip invalid characters - we won't reach the end */ while (*tmpptr != '=' && _base64_char_value(*tmpptr)<0) tmpptr++; quadruple[i] = *(tmpptr++); } /* convert the characters */ tmplen = _base64_decode_triple(quadruple, (unsigned char*)tmpresult); /* check if the fit in the result buffer */ if ((int)targetlen < tmplen) { free(src); return -1; } /* put the partial result in the result buffer */ memcpy(target, tmpresult, tmplen); target += tmplen; targetlen -= tmplen; converted += tmplen; } free(src); return converted; } mod_gearman-1.4.14/common/check_utils.c0000644001161000116100000004342312234761060014723 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ #include "config.h" #include "check_utils.h" #include "utils.h" #include "epn_utils.h" #include "gearman_utils.h" #include "popenRWE.h" pid_t current_child_pid = 0; /* convert number to signal name */ char *nr2signal(int sig) { char * signame = NULL; switch(sig) { case 1: signame = "SIGHUP"; break; case 2: signame = "SIGINT"; break; case 3: signame = "SIGQUIT"; break; case 4: signame = "SIGILL"; break; case 5: signame = "SIGTRAP"; break; case 6: signame = "SIGABRT"; break; case 7: signame = "SIGBUS"; break; case 8: signame = "SIGFPE"; break; case 9: signame = "SIGKILL"; break; case 10: signame = "SIGUSR1"; break; case 11: signame = "SIGSEGV"; break; case 12: signame = "SIGUSR2"; break; case 13: signame = "SIGPIPE"; break; case 14: signame = "SIGALRM"; break; case 15: signame = "SIGTERM"; break; case 16: signame = "SIGURG"; break; default: signame = malloc(20); snprintf(signame, 20, "signal %d", sig); return signame; break; } return strdup(signame); } /* extract check result */ char *extract_check_result(FILE *fp, int trimmed) { int size; char buffer[GM_BUFFERSIZE] = ""; char output[GM_BUFFERSIZE] = ""; /* get all lines of plugin output - escape newlines */ strcpy(buffer,""); strcpy(output,""); size = GM_MAX_OUTPUT; while(size > 0 && fgets(buffer,sizeof(buffer)-1,fp)){ strncat(output, buffer, size); size -= strlen(buffer); } return(gm_escape_newlines(output, trimmed)); } /* run a check */ int run_check(char *processed_command, char **ret, char **err) { char *argv[MAX_CMD_ARGS]; FILE *fp; pid_t pid; int pipe_stdout[2], pipe_stderr[2], pipe_rwe[3]; int retval; sigset_t mask; #ifdef EMBEDDEDPERL retval = run_epn_check(processed_command, ret, err); if(retval != GM_NO_EPN) { return retval; } #endif /* check for check execution method (shell or execvp) * command line does not have to contain shell meta characters * and cmd must begin with a /. Otherwise "BLAH=BLUB cmd" would lead * to file not found errors */ if((*processed_command == '/' || *processed_command == '.') && !strpbrk(processed_command,"!$^&*()~[]\\|{};<>?`\"'")) { /* use the fast execvp when there are no shell characters */ gm_log( GM_LOG_TRACE, "using execvp, no shell characters found\n" ); parse_command_line(processed_command,argv); if(!argv[0]) _exit(STATE_UNKNOWN); if(pipe(pipe_stdout)) { gm_log( GM_LOG_ERROR, "error creating pipe: %s\n", strerror(errno)); _exit(STATE_UNKNOWN); } if(pipe(pipe_stderr)) { gm_log( GM_LOG_ERROR, "error creating pipe: %s\n", strerror(errno)); _exit(STATE_UNKNOWN); } if((pid=fork())<0){ gm_log( GM_LOG_ERROR, "fork error\n"); _exit(STATE_UNKNOWN); } else if(!pid){ /* remove all customn signal handler */ sigfillset(&mask); sigprocmask(SIG_UNBLOCK, &mask, NULL); /* child process */ if((dup2(pipe_stdout[1],STDOUT_FILENO)<0)){ gm_log( GM_LOG_ERROR, "dup2 error\n"); _exit(STATE_UNKNOWN); } if((dup2(pipe_stderr[1],STDERR_FILENO)<0)){ gm_log( GM_LOG_ERROR, "dup2 error\n"); _exit(STATE_UNKNOWN); } close(pipe_stdout[1]); close(pipe_stderr[1]); current_child_pid = getpid(); execvp(argv[0], argv); if(errno == 2) _exit(127); if(errno == 13) _exit(126); _exit(STATE_UNKNOWN); } /* parent */ /* prepare stdout pipe reading */ close(pipe_stdout[1]); fp=fdopen(pipe_stdout[0],"r"); if(!fp){ gm_log( GM_LOG_ERROR, "fdopen error\n"); _exit(STATE_UNKNOWN); } *ret = extract_check_result(fp, GM_DISABLED); fclose(fp); /* prepare stderr pipe reading */ close(pipe_stderr[1]); fp=fdopen(pipe_stderr[0],"r"); if(!fp){ gm_log( GM_LOG_ERROR, "fdopen error\n"); _exit(STATE_UNKNOWN); } *err = extract_check_result(fp, GM_ENABLED); fclose(fp); close(pipe_stdout[0]); close(pipe_stderr[0]); if(waitpid(pid,&retval,0)!=pid) retval=-1; } else { /* use the slower popen when there were shell characters */ gm_log( GM_LOG_TRACE, "using popen, found shell characters\n" ); current_child_pid = getpid(); pid = popenRWE(pipe_rwe, processed_command); /* extract check result */ fp=fdopen(pipe_rwe[1],"r"); if(!fp){ gm_log( GM_LOG_ERROR, "fdopen error\n"); _exit(STATE_UNKNOWN); } *ret = extract_check_result(fp, GM_DISABLED); fclose(fp); /* extract check stderr */ fp=fdopen(pipe_rwe[2],"r"); if(!fp){ gm_log( GM_LOG_ERROR, "fdopen error\n"); _exit(STATE_UNKNOWN); } *err = extract_check_result(fp, GM_ENABLED); fclose(fp); /* close the process */ retval=pcloseRWE(pid, pipe_rwe); } return retval; } /* execute this command with given timeout */ int execute_safe_command(gm_job_t * exec_job, int fork_exec, char * identifier) { int pipe_stdout[2] , pipe_stderr[2]; int return_code; int pclose_result; char *plugin_output, *plugin_error; char *bufdup; char buffer[GM_BUFFERSIZE], buf_error[GM_BUFFERSIZE]; struct timeval start_time,end_time; pid_t pid = 0; buffer[0] = '\x0'; buf_error[0] = '\x0'; gm_log( GM_LOG_TRACE, "execute_safe_command()\n" ); // mark all filehandles to close on exec int x; for(x = 0; x<=64; x++) fcntl(x, F_SETFD, FD_CLOEXEC); signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); if(exec_job->start_time.tv_sec == 0) { gettimeofday(&start_time,NULL); exec_job->start_time = start_time; } /* fork a child process */ if(fork_exec == GM_ENABLED) { if(pipe(pipe_stdout) != 0) perror("pipe stdout"); if(pipe(pipe_stderr) != 0) perror("pipe stderr"); pid=fork(); /*fork error */ if( pid == -1 ) { exec_job->output = strdup("(Error On Fork)"); exec_job->return_code = 3; return(GM_ERROR); } } /* we are in the child process */ if( fork_exec == GM_DISABLED || pid == 0 ) { /* become the process group leader */ setpgid(0,0); pid = getpid(); if( fork_exec == GM_ENABLED ) { close(pipe_stdout[0]); close(pipe_stderr[0]); } signal(SIGALRM, check_alarm_handler); alarm(exec_job->timeout); /* run the plugin check command */ pclose_result = run_check(exec_job->command_line, &plugin_output, &plugin_error); return_code = pclose_result; if(fork_exec == GM_ENABLED) { if(write(pipe_stdout[1], plugin_output, strlen(plugin_output)+1) <= 0) perror("write stdout"); if(write(pipe_stderr[1], plugin_error, strlen(plugin_error)+1) <= 0) perror("write"); if(pclose_result == -1) { char error[GM_BUFFERSIZE]; snprintf(error, sizeof(error), "error on %s: %s", identifier, strerror(errno)); if(write(pipe_stdout[1], error, strlen(error)+1) <= 0) perror("write"); } return_code = real_exit_code(pclose_result); free(plugin_output); free(plugin_error); _exit(return_code); } else { snprintf( buffer, sizeof( buffer )-1, "%s", plugin_output ); snprintf( buf_error, sizeof( buf_error )-1, "%s", plugin_error ); free(plugin_output); free(plugin_error); } } /* we are the parent */ if( fork_exec == GM_DISABLED || pid > 0 ){ if( fork_exec == GM_ENABLED) { gm_log( GM_LOG_TRACE, "started check with pid: %d\n", pid); close(pipe_stdout[1]); close(pipe_stderr[1]); waitpid(pid, &return_code, 0); gm_log( GM_LOG_TRACE, "finished check from pid: %d with status: %d\n", pid, return_code); /* get all lines of plugin output */ if(read(pipe_stdout[0], buffer, sizeof(buffer)-1) < 0) perror("read"); if(read(pipe_stderr[0], buf_error, sizeof(buf_error)-1) < 0) perror("read"); } return_code = real_exit_code(return_code); /* file not executable? */ if(return_code == 126) { return_code = STATE_CRITICAL; snprintf( buffer, sizeof( buffer )-1, "CRITICAL: Return code of 126 is out of bounds. Make sure the plugin you're trying to run is executable. (worker: %s)", identifier); } /* file not found errors? */ else if(return_code == 127) { return_code = STATE_CRITICAL; snprintf( buffer, sizeof( buffer )-1, "CRITICAL: Return code of 127 is out of bounds. Make sure the plugin you're trying to run actually exists. (worker: %s)", identifier); } /* signaled */ else if(return_code >= 128 && return_code < 144) { char * signame = nr2signal((int)(return_code-128)); bufdup = strdup(buffer); snprintf( buffer, sizeof( buffer )-1, "CRITICAL: Return code of %d is out of bounds. Plugin exited by signal %s. (worker: %s)\\n%s", (int)(return_code), signame, identifier, bufdup); return_code = STATE_CRITICAL; free(bufdup); free(signame); } /* other error codes > 3 */ else if(return_code > 3) { gm_log( GM_LOG_DEBUG, "check exited with exit code > 3. Exit: %d\n", (int)(return_code)); gm_log( GM_LOG_DEBUG, "stdout: %s\n", buffer); bufdup = strdup(buffer); snprintf( buffer, sizeof( buffer )-1, "CRITICAL: Return code of %d is out of bounds. (worker: %s)\\n%s", (int)(return_code), identifier, bufdup); free(bufdup); if(return_code != 25 && mod_gm_opt->workaround_rc_25 == GM_DISABLED) { return_code = STATE_CRITICAL; } } exec_job->output = strdup(buffer); exec_job->error = strdup(buf_error); exec_job->return_code = return_code; if( fork_exec == GM_ENABLED) { close(pipe_stdout[0]); close(pipe_stderr[0]); } } alarm(0); current_child_pid = 0; pid = 0; /* record check result info */ gettimeofday(&end_time, NULL); exec_job->finish_time = end_time; /* did we have a timeout? */ if(exec_job->timeout < ((int)end_time.tv_sec - (int)exec_job->start_time.tv_sec)) { exec_job->return_code = 2; exec_job->early_timeout = 1; if ( !strcmp( exec_job->type, "service" ) ) snprintf( buffer, sizeof( buffer ) -1, "(Service Check Timed Out On Worker: %s)", identifier); if ( !strcmp( exec_job->type, "host" ) ) snprintf( buffer, sizeof( buffer ) -1, "(Host Check Timed Out On Worker: %s)", identifier); free(exec_job->output); exec_job->output = strdup( buffer ); } return(GM_OK); } /* called when check runs into timeout */ void check_alarm_handler(int sig) { pid_t pid; gm_log( GM_LOG_TRACE, "check_alarm_handler(%i)\n", sig ); pid = getpid(); if(current_job != NULL && mod_gm_opt->fork_on_exec == GM_DISABLED) { /* create a useful log message*/ if ( !strcmp( current_job->type, "service" ) ) { gm_log( GM_LOG_INFO, "timeout (%is) hit for servicecheck: %s - %s\n", current_job->timeout, current_job->host_name, current_job->service_description); } else if ( !strcmp( current_job->type, "host" ) ) { gm_log( GM_LOG_INFO, "timeout (%is) hit for hostcheck: %s\n", current_job->timeout, current_job->host_name); } else if ( !strcmp( current_job->type, "eventhandler" ) ) { gm_log( GM_LOG_INFO, "timeout (%is) hit for eventhandler: %s\n", current_job->timeout, current_job->command_line); } send_timeout_result(current_job); gearman_job_send_complete(current_gearman_job, NULL, 0); } signal(SIGTERM, SIG_IGN); gm_log( GM_LOG_TRACE, "send SIGTERM to %d\n", pid); kill(-pid, SIGTERM); kill(pid, SIGTERM); signal(SIGTERM, SIG_DFL); sleep(1); signal(SIGINT, SIG_IGN); gm_log( GM_LOG_TRACE, "send SIGINT to %d\n", pid); kill(-pid, SIGINT); kill(pid, SIGINT); signal(SIGINT, SIG_DFL); sleep(1); // skip sigkill in test mode if(getenv("MODGEARMANTEST") == NULL) { gm_log( GM_LOG_TRACE, "send SIGKILL to %d\n", pid); kill(-pid, SIGKILL); kill(pid, SIGKILL); } return; } /* send kill to all forked processes */ void kill_child_checks(void) { int retval; pid_t pid; signal(SIGINT, SIG_IGN); pid = getpid(); if(current_child_pid > 0 && current_child_pid != pid) { gm_log( GM_LOG_TRACE, "kill_child_checks(): send SIGINT to %d\n", current_child_pid); kill(-current_child_pid, SIGINT); kill(current_child_pid, SIGINT); sleep(1); if(waitpid(current_child_pid,&retval,WNOHANG)!=0) { signal(SIGINT, SIG_DFL); return; } if(pid_alive(current_child_pid)) { gm_log( GM_LOG_TRACE, "kill_child_checks(): send SIGKILL to %d\n", current_child_pid); kill(current_child_pid, SIGKILL); } } gm_log( GM_LOG_TRACE, "send SIGINT to %d\n", pid); kill(0, SIGINT); signal(SIGINT, SIG_DFL); return; } void send_timeout_result(gm_job_t * exec_job) { struct timeval end_time; char buffer[GM_BUFFERSIZE]; buffer[0] = '\x0'; gm_log( GM_LOG_TRACE, "send_timeout_result()\n"); gettimeofday(&end_time, NULL); exec_job->finish_time = end_time; exec_job->return_code = mod_gm_opt->timeout_return; exec_job->early_timeout = 1; if ( !strcmp( exec_job->type, "service" ) ) snprintf( buffer, sizeof( buffer ) -1, "(Service Check Timed Out On Worker: %s)\n", mod_gm_opt->identifier); if ( !strcmp( exec_job->type, "host" ) ) snprintf( buffer, sizeof( buffer ) -1, "(Host Check Timed Out On Worker: %s)\n", mod_gm_opt->identifier); free(exec_job->output); exec_job->output = strdup( buffer ); send_result_back(exec_job); return; } /* send failed result */ void send_failed_result(gm_job_t * exec_job, int sig) { struct timeval end_time; char buffer[GM_BUFFERSIZE]; char * signame; buffer[0] = '\x0'; gm_log( GM_LOG_TRACE, "send_failed_result()\n"); gettimeofday(&end_time, NULL); exec_job->finish_time = end_time; exec_job->return_code = STATE_CRITICAL; signame = nr2signal(sig); snprintf( buffer, sizeof( buffer )-1, "(Return code of %d is out of bounds. Worker exited by signal %s on worker: %s)", sig, signame, mod_gm_opt->identifier); free(exec_job->output); exec_job->output = strdup( buffer ); free(signame); send_result_back(exec_job); return; } /* convert a command line to an array of arguments, suitable for exec* functions */ int parse_command_line(char *cmd, char *argv[MAX_CMD_ARGS]) { unsigned int argc=0; char *parsed_cmd; /* Skip initial white-space characters. */ for(parsed_cmd=cmd;isspace(*cmd);++cmd) ; /* Parse command line. */ while(*cmd&&(argc. * *****************************************************************************/ #include "config.h" #include "utils.h" #include "gm_crypt.h" #include "base64.h" #include "gearman_utils.h" #include "popenRWE.h" #include "polarssl/md5.h" char temp_buffer1[GM_BUFFERSIZE]; char temp_buffer2[GM_BUFFERSIZE]; #ifdef EMBEDDEDPERL #include "epn_utils.h" int enable_embedded_perl = GM_ENABLED; int use_embedded_perl_implicitly = GM_DISABLED; int use_perl_cache = GM_ENABLED; char *p1_file = NULL; #endif /* escapes newlines in a string */ char *gm_escape_newlines(char *rawbuf, int trimmed) { char *tmpbuf=NULL; char *tmpbuf_dup=NULL; char *newbuf=NULL; register int x,y; if(rawbuf==NULL) return NULL; tmpbuf = strdup(rawbuf); tmpbuf_dup = tmpbuf; if ( trimmed == GM_ENABLED ) { tmpbuf = trim(tmpbuf); } /* allocate enough memory to escape all chars if necessary */ if((newbuf=malloc((strlen(tmpbuf)*2)+1))==NULL) return NULL; for(x=0,y=0;tmpbuf[x]!=(char)'\x0';x++){ /* escape backslashes */ if(tmpbuf[x]=='\\'){ newbuf[y++]='\\'; newbuf[y++]='\\'; } /* escape newlines */ else if(tmpbuf[x]=='\n'){ newbuf[y++]='\\'; newbuf[y++]='n'; } else newbuf[y++]=tmpbuf[x]; } newbuf[y]='\x0'; free(tmpbuf_dup); return newbuf; } /* convert exit code to int */ int real_exit_code(int code) { if( code == -1 ){ return(3); } else { if(WIFSIGNALED( code)) { return(128 + WTERMSIG( code )); } if(WIFEXITED(code)) { return(WEXITSTATUS(code)); } } return(0); } /* initialize encryption */ void mod_gm_crypt_init(char * key) { if(strlen(key) < 8) { gm_log( GM_LOG_INFO, "encryption key should be at least 8 bytes!\n" ); } mod_gm_aes_init(key); return; } /* encrypt text with given key */ int mod_gm_encrypt(char ** encrypted, char * text, int mode) { int size; unsigned char * crypted; char * base64; if(mode == GM_ENCODE_AND_ENCRYPT) { size = mod_gm_aes_encrypt(&crypted, text); } else { crypted = (unsigned char*)strdup(text); size = strlen(text); } /* now encode in base64 */ base64 = malloc(GM_BUFFERSIZE); base64[0] = 0; base64_encode(crypted, size, base64, GM_BUFFERSIZE); free(*encrypted); free(crypted); *encrypted = base64; return strlen(base64); } /* decrypt text with given key */ void mod_gm_decrypt(char ** decrypted, char * text, int mode) { char *test; unsigned char * buffer = malloc(sizeof(unsigned char) * GM_BUFFERSIZE); /* first decode from base64 */ size_t bsize = base64_decode(text, buffer, GM_BUFFERSIZE); test = strndup(buffer, 5); if(mode == GM_ENCODE_AND_ENCRYPT || (mode == GM_ENCODE_ACCEPT_ALL && strcmp(test, "type="))) { /* then decrypt */ mod_gm_aes_decrypt(decrypted, buffer, bsize); } else { char debase64[GM_BUFFERSIZE]; strncpy(debase64, (char*)buffer, bsize); debase64[bsize] = '\0'; strcpy(*decrypted, debase64); } free(test); free(buffer); return; } /* test for file existence */ int file_exists (char * fileName) { struct stat buf; int i = stat ( fileName, &buf ); /* File found */ if( i == 0 ) { return 1; } return 0; } /* trim left spaces */ char *ltrim(char *s) { if(s == NULL) return NULL; while(isspace(*s)) s++; return s; } /* trim right spaces */ char *rtrim(char *s) { char *back; if(s == NULL) return NULL; if(strlen(s) == 0) return s; back = s + strlen(s); while(isspace(*--back)); *(back+1) = '\0'; return s; } /* trim spaces */ char *trim(char *s) { if(s == NULL) return NULL; return rtrim(ltrim(s)); } /* make string lowercase */ char * lc(char * str) { int i; if(str == NULL) return NULL; for( i = 0; str[ i ]; i++) str[ i ] = tolower( str[ i ] ); return str; } /* set empty default options */ int set_default_options(mod_gm_opt_t *opt) { int i; opt->set_queues_by_hand = 0; opt->result_workers = 1; opt->crypt_key = NULL; opt->result_queue = NULL; opt->keyfile = NULL; opt->logfile = NULL; opt->logmode = GM_LOG_MODE_AUTO; opt->logfile_fp = NULL; opt->message = NULL; opt->delimiter = strdup("\t"); opt->return_code = 0; opt->timeout = 10; opt->debug_level = GM_LOG_INFO; opt->perfdata = GM_DISABLED; opt->perfdata_mode = GM_PERFDATA_OVERWRITE; opt->use_uniq_jobs = GM_ENABLED; opt->do_hostchecks = GM_ENABLED; opt->route_eventhandler_like_checks = GM_DISABLED; opt->hosts = GM_DISABLED; opt->services = GM_DISABLED; opt->events = GM_DISABLED; opt->job_timeout = GM_DEFAULT_JOB_TIMEOUT; opt->encryption = GM_ENABLED; opt->pidfile = NULL; opt->debug_result = GM_DISABLED; opt->max_age = GM_DEFAULT_JOB_MAX_AGE; opt->min_worker = GM_DEFAULT_MIN_WORKER; opt->max_worker = GM_DEFAULT_MAX_WORKER; opt->transportmode = GM_ENCODE_AND_ENCRYPT; opt->daemon_mode = GM_DISABLED; opt->fork_on_exec = GM_DISABLED; opt->idle_timeout = GM_DEFAULT_IDLE_TIMEOUT; opt->max_jobs = GM_DEFAULT_MAX_JOBS; opt->spawn_rate = GM_DEFAULT_SPAWN_RATE; opt->timeout_return = 2; opt->identifier = NULL; opt->queue_cust_var = NULL; opt->show_error_output = GM_ENABLED; opt->dup_results_are_passive = GM_ENABLED; opt->orphan_host_checks = GM_ENABLED; opt->orphan_service_checks = GM_ENABLED; opt->orphan_return = 2; opt->accept_clear_results = GM_DISABLED; opt->has_starttime = FALSE; opt->has_finishtime = FALSE; opt->has_latency = FALSE; opt->active = GM_DISABLED; opt->workaround_rc_25 = GM_DISABLED; opt->host = NULL; opt->service = NULL; #ifdef EMBEDDEDPERL opt->enable_embedded_perl = GM_ENABLED; opt->use_embedded_perl_implicitly = GM_DISABLED; opt->use_perl_cache = GM_ENABLED; opt->p1_file = NULL; #endif opt->server_num = 0; for(i=0;i<=GM_LISTSIZE;i++) opt->server_list[i] = NULL; opt->dupserver_num = 0; for(i=0;i<=GM_LISTSIZE;i++) opt->dupserver_list[i] = NULL; opt->hostgroups_num = 0; for(i=0;i<=GM_LISTSIZE;i++) opt->hostgroups_list[i] = NULL; opt->servicegroups_num = 0; for(i=0;i<=GM_LISTSIZE;i++) opt->servicegroups_list[i] = NULL; opt->local_hostgroups_num = 0; for(i=0;i<=GM_LISTSIZE;i++) opt->local_hostgroups_list[i] = NULL; opt->local_servicegroups_num = 0; for(i=0;i<=GM_LISTSIZE;i++) opt->local_servicegroups_list[i] = NULL; for(i=0;ielem_number = 0; opt->exports[i] = mod_gm_exp; } return(GM_OK); } /* parse an option value to yes/no */ int parse_yes_or_no(char*value, int dfl) { if(value == NULL) return dfl; lc(value); if(!strcmp( value, "yes" )) return(GM_ENABLED); if(!strcmp( value, "on" )) return(GM_ENABLED); if(!strcmp( value, "true" )) return(GM_ENABLED); if(!strcmp( value, "1" )) return(GM_ENABLED); if(!strcmp( value, "no" )) return(GM_DISABLED); if(!strcmp( value, "off" )) return(GM_DISABLED); if(!strcmp( value, "false" )) return(GM_DISABLED); if(!strcmp( value, "0" )) return(GM_DISABLED); return dfl; } /* parse one line of args into the given struct */ int parse_args_line(mod_gm_opt_t *opt, char * arg, int recursion_level) { int i, x, number, callback_num; char *key; char *value; char *callback; char *export_queue; char *return_code; int return_code_num; char *callbacks; char * type; gm_log( GM_LOG_TRACE, "parse_args_line(%s, %d)\n", arg, recursion_level); key = strsep( &arg, "=" ); value = strsep( &arg, "\x0" ); if ( key == NULL ) return(GM_OK); lc(key); key = trim(key); value = trim(value); /* skip leading hyphen */ while(key[0] == '-') key++; /* daemon mode or delimiter */ if ( !strcmp( key, "daemon" ) || !strcmp( key, "d" ) ) { opt->daemon_mode = parse_yes_or_no(value, GM_ENABLED); if(value != NULL) { free(opt->delimiter); opt->delimiter = strdup( value ); } return(GM_OK); } /* perfdata */ else if ( !strcmp( key, "perfdata" ) ) { opt->set_queues_by_hand++; opt->perfdata = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* hosts */ else if ( !strcmp( key, "hosts" ) ) { opt->set_queues_by_hand++; opt->hosts = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* services */ else if ( !strcmp( key, "services" ) ) { opt->set_queues_by_hand++; opt->services = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* eventhandler */ else if ( !strcmp( key, "eventhandlers" ) || !strcmp( key, "eventhandler" ) ) { opt->set_queues_by_hand++; opt->events = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* debug-result */ else if ( !strcmp( key, "debug-result" ) || !strcmp( key, "debug_result" ) ) { opt->debug_result = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* encryption */ else if ( !strcmp( key, "encryption" ) ) { opt->encryption = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* fork_on_exec */ else if ( !strcmp( key, "fork_on_exec" ) ) { opt->fork_on_exec = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* do_hostchecks */ else if ( !strcmp( key, "do_hostchecks" ) ) { opt->do_hostchecks = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* route_eventhandler_like_checks */ else if ( !strcmp( key, "route_eventhandler_like_checks" ) ) { opt->route_eventhandler_like_checks = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* active */ else if ( !strcmp( key, "active" ) ) { opt->active = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* show_error_output */ else if ( !strcmp( key, "show_error_output" ) ) { opt->show_error_output = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* dup_results_are_passive */ else if ( !strcmp( key, "dup_results_are_passive" ) ) { opt->dup_results_are_passive = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* workaround_rc_25 */ else if ( !strcmp( key, "workaround_rc_25" ) ) { opt->workaround_rc_25 = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* orphan_host_checks */ else if ( !strcmp( key, "orphan_host_checks" ) ) { opt->orphan_host_checks = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* orphan_service_checks */ else if ( !strcmp( key, "orphan_service_checks" ) ) { opt->orphan_service_checks = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* accept_clear_results */ else if ( !strcmp( key, "accept_clear_results" ) ) { opt->accept_clear_results = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } /* enable_embedded_perl */ else if ( !strcmp( key, "enable_embedded_perl" ) ) { #ifdef EMBEDDEDPERL opt->enable_embedded_perl = parse_yes_or_no(value, GM_ENABLED); enable_embedded_perl = opt->enable_embedded_perl; #endif return(GM_OK); } /* use_embedded_perl_implicitly */ else if ( !strcmp( key, "use_embedded_perl_implicitly" ) ) { #ifdef EMBEDDEDPERL opt->use_embedded_perl_implicitly = parse_yes_or_no(value, GM_ENABLED); use_embedded_perl_implicitly = opt->use_embedded_perl_implicitly; #endif return(GM_OK); } /* use_perl_cache */ else if ( !strcmp( key, "use_perl_cache" ) ) { #ifdef EMBEDDEDPERL opt->use_perl_cache = parse_yes_or_no(value, GM_ENABLED); use_perl_cache = opt->use_perl_cache; #endif return(GM_OK); } /* use_uniq_jobs */ else if ( !strcmp( key, "use_uniq_jobs" ) ) { opt->use_uniq_jobs = parse_yes_or_no(value, GM_ENABLED); return(GM_OK); } else if ( value == NULL ) { gm_log( GM_LOG_ERROR, "unknown switch '%s'\n", key ); return(GM_OK); } if ( value == NULL ) return(GM_OK); /* debug */ if ( !strcmp( key, "debug" ) ) { opt->debug_level = atoi( value ); 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 ); if(opt->result_workers > GM_LISTSIZE) { opt->result_workers = GM_LISTSIZE; } if(opt->result_workers < 0) { opt->result_workers = 0; } } /* return code */ else if ( !strcmp( key, "returncode" ) || !strcmp( key, "r" ) ) { opt->return_code = atoi( value ); if(opt->return_code > 3) { return(GM_ERROR); } if(opt->return_code < 0) { return(GM_ERROR); } } /* result_queue */ else if ( !strcmp( key, "result_queue" ) ) { opt->result_queue = strdup( value ); } /* message */ else if ( !strcmp( key, "message" ) || !strcmp( key, "m" ) ) { opt->message = strdup( value ); } /* delimiter */ else if ( !strcmp( key, "delimiter" ) ) { free(opt->delimiter); opt->delimiter = strdup( value ); } /* host */ else if ( !strcmp( key, "host" ) ) { opt->host = strdup( value ); } /* service */ else if ( !strcmp( key, "service" ) ) { opt->service = strdup( value ); } /* latency */ else if ( !strcmp( key, "latency" ) ) { opt->has_latency = TRUE; string2timeval(value, &opt->latency); } /* start time */ else if ( !strcmp( key, "starttime" ) ) { opt->has_starttime = TRUE; string2timeval(value, &opt->starttime); } /* finish time */ else if ( !strcmp( key, "finishtime" ) ) { opt->has_finishtime = TRUE; string2timeval(value, &opt->finishtime); } /* configfile / includes */ else if ( !strcmp( key, "config" ) || !strcmp( key, "configfile" ) || !strcmp( key, "include" ) ) { if(read_config_file(opt, value, ++recursion_level) != GM_OK) { recursion_level--; return GM_ERROR; } } /* key / password */ else if ( !strcmp( key, "key" ) || !strcmp( key, "password" ) ) { opt->crypt_key = strdup( value ); } /* keyfile / passwordfile */ else if ( !strcmp( key, "keyfile" ) || !strcmp( key, "passwordfile" ) ) { opt->keyfile = strdup( value ); } /* pidfile */ else if ( !strcmp( key, "pidfile" ) ) { opt->pidfile = strdup( value ); } /* logfile */ else if ( !strcmp( key, "logfile" ) ) { opt->logfile = strdup( value ); } /* identifier */ else if ( !strcmp( key, "identifier" ) ) { opt->identifier = strdup( value ); } /* timeout */ else if ( !strcmp( key, "timeout" ) || !strcmp( key, "t" )) { opt->timeout = atoi( value ); if(opt->timeout < 0) { opt->timeout = 10; } } /* job_timeout */ else if ( !strcmp( key, "job_timeout" ) ) { opt->job_timeout = atoi( value ); if(opt->job_timeout < 1) { opt->job_timeout = 1; } } /* min-worker */ else if ( !strcmp( key, "min-worker" ) ) { opt->min_worker = atoi( value ); if(opt->min_worker <= 0) { opt->min_worker = 1; } } /* max-worker */ else if ( !strcmp( key, "max-worker" ) ) { opt->max_worker = atoi( value ); if(opt->max_worker <= 0) { opt->max_worker = 1; } } /* max-age */ else if ( !strcmp( key, "max-age" ) ) { opt->max_age = atoi( value ); if(opt->max_age < 0) { opt->max_age = GM_DEFAULT_JOB_MAX_AGE; } } /* idle-timeout */ else if ( !strcmp( key, "idle-timeout" ) ) { opt->idle_timeout = atoi( value ); if(opt->idle_timeout < 0) { opt->idle_timeout = GM_DEFAULT_IDLE_TIMEOUT; } } /* max-jobs */ else if ( !strcmp( key, "max-jobs" ) ) { opt->max_jobs = atoi( value ); if(opt->max_jobs < 0) { opt->max_jobs = GM_DEFAULT_MAX_JOBS; } } /* spawn-rate */ else if ( !strcmp( key, "spawn-rate" ) ) { opt->spawn_rate = atoi( value ); if(opt->spawn_rate < 0) { opt->spawn_rate = GM_DEFAULT_SPAWN_RATE; } } /* load limit 1min */ else if ( !strcmp( key, "load_limit1" ) ) { opt->load_limit1 = atof( value ); if(opt->load_limit1 < 0) { opt->load_limit1 = 0; } } /* load limit 5min */ else if ( !strcmp( key, "load_limit5" ) ) { opt->load_limit5 = atof( value ); if(opt->load_limit5 < 0) { opt->load_limit5 = 0; } } /* load limit 15min */ else if ( !strcmp( key, "load_limit15" ) ) { opt->load_limit15 = atof( value ); if(opt->load_limit15 < 0) { opt->load_limit15 = 0; } } /* timeout_return */ else if ( !strcmp( key, "timeout_return" ) ) { opt->timeout_return = atoi( value ); if(opt->timeout_return < 0 || opt->timeout_return > 3) { gm_log( GM_LOG_INFO, "Warning: unknown timeout_return: %d\n", opt->timeout_return ); opt->timeout_return = 2; } } /* orphan_return */ else if ( !strcmp( key, "orphan_return" ) ) { opt->orphan_return = atoi( value ); if(opt->orphan_return < 0 || opt->orphan_return > 3) { gm_log( GM_LOG_INFO, "Warning: unknown orphan_return: %d\n", opt->orphan_return ); opt->orphan_return = 2; } } /* perfdata_mode */ else if ( !strcmp( key, "perfdata_mode" ) ) { opt->perfdata_mode = atoi( value ); if(opt->perfdata_mode < 0 || opt->perfdata_mode > 2) { gm_log( GM_LOG_INFO, "Warning: unknown perfdata_mode: %d\n", opt->perfdata_mode ); opt->perfdata_mode = GM_PERFDATA_OVERWRITE; } } /* server */ else if ( !strcmp( key, "server" ) ) { char *servername; while ( (servername = strsep( &value, "," )) != NULL ) { add_server(&opt->server_num, opt->server_list, servername); } } /* duplicate server */ else if ( !strcmp( key, "dupserver" ) ) { char *servername; while ( (servername = strsep( &value, "," )) != NULL ) { add_server(&opt->dupserver_num, opt->dupserver_list, servername); } } /* servicegroups */ else if ( !strcmp( key, "servicegroups" ) || !strcmp( key, "servicegroup" ) ) { char *groupname; while ( (groupname = strsep( &value, "," )) != NULL ) { groupname = trim(groupname); if ( strcmp( groupname, "" ) ) { if(strlen(groupname) > 50) { gm_log( GM_LOG_ERROR, "servicegroup name '%s' is too long, please use a maximum of 50 characters\n", groupname ); } else { opt->servicegroups_list[opt->servicegroups_num] = strdup(groupname); opt->servicegroups_num++; opt->set_queues_by_hand++; } } } } /* hostgroups */ else if ( !strcmp( key, "hostgroups" ) || !strcmp( key, "hostgroup" ) ) { char *groupname; while ( (groupname = strsep( &value, "," )) != NULL ) { groupname = trim(groupname); if ( strcmp( groupname, "" ) ) { if(strlen(groupname) > 50) { gm_log( GM_LOG_ERROR, "hostgroup name '%s' is too long, please use a maximum of 50 characters\n", groupname ); } else { opt->hostgroups_list[opt->hostgroups_num] = strdup(groupname); opt->hostgroups_num++; opt->set_queues_by_hand++; } } } } /* local servicegroups */ else if ( !strcmp( key, "localservicegroups" ) || !strcmp( key, "localservicegroup" ) ) { char *groupname; while ( (groupname = strsep( &value, "," )) != NULL ) { groupname = trim(groupname); if ( strcmp( groupname, "" ) ) { opt->local_servicegroups_list[opt->local_servicegroups_num] = strdup(groupname); opt->local_servicegroups_num++; } } } /* local hostgroups */ else if ( !strcmp( key, "localhostgroups" ) || !strcmp( key, "localhostgroup" ) ) { char *groupname; while ( (groupname = strsep( &value, "," )) != NULL ) { groupname = trim(groupname); if ( strcmp( groupname, "" ) ) { opt->local_hostgroups_list[opt->local_hostgroups_num] = strdup(groupname); opt->local_hostgroups_num++; } } } /* queue_custom_variable */ else if ( !strcmp( key, "queue_custom_variable" ) ) { /* uppercase custom variable name */ for(x = 0; value[x] != '\x0'; x++) { value[x] = toupper(value[x]); } opt->queue_cust_var = strdup( value ); } /* export queues */ else if ( !strcmp( key, "export" ) ) { export_queue = strsep( &value, ":" ); export_queue = trim(export_queue); return_code = strsep( &value, ":" ); return_code_num = atoi(return_code); callbacks = strsep( &value, ":" ); if(strlen(export_queue) > 50) { gm_log( GM_LOG_ERROR, "export queue name '%s' is too long, please use a maximum of 50 characters\n", export_queue ); } else { while ( (callback = strsep( &callbacks, "," )) != NULL ) { callback_num = atoi(trim(callback)); if(index(callback, 'N') != NULL) { callback_num = -1; /* get neb callback number by name */ for(i=0;iexports[callback_num]->elem_number; opt->exports[callback_num]->name[number] = strdup(export_queue); opt->exports[callback_num]->return_code[number] = return_code_num; opt->exports[callback_num]->elem_number++; } opt->exports_count++; } } /* p1_file */ else if ( !strcmp( key, "p1_file" ) ) { #ifdef EMBEDDEDPERL opt->p1_file = strdup( value ); free(p1_file); p1_file = strdup(opt->p1_file); #endif } else { gm_log( GM_LOG_ERROR, "unknown option '%s'\n", key ); } return(GM_OK); } /* read an entire config file */ int read_config_file(mod_gm_opt_t *opt, char*filename, int recursion_level) { FILE * fp; int errors = 0; char *line; char *line_c; gm_log( GM_LOG_TRACE, "read_config_file(%s, %d)\n", filename, recursion_level ); if(recursion_level > 10) { gm_log( GM_LOG_ERROR, "deep recursion in config files!\n" ); return GM_ERROR; } fp = fopen(filename, "r"); if(fp == NULL) { perror(filename); return GM_ERROR; } line = malloc(GM_BUFFERSIZE); line_c = line; line[0] = '\0'; while(fgets(line, GM_BUFFERSIZE, fp) != NULL) { /* trim comments */ int pos = -1; if(index(line, '#') != NULL) { pos = strcspn(line, "#"); if(pos == 0) continue; line[pos] = '\0'; } line = trim(line); if(line[0] == 0) continue; if(parse_args_line(opt, line, recursion_level) != GM_OK) { errors++; break; } } fclose(fp); free(line_c); if(errors > 0) return(GM_ERROR); return(GM_OK); } /* dump config */ void dumpconfig(mod_gm_opt_t *opt, int mode) { int i=0; int j=0; 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); gm_log( GM_LOG_DEBUG, "logfile: %s\n", opt->logfile == NULL ? "no" : opt->logfile); gm_log( GM_LOG_DEBUG, "job max num: %d\n", opt->max_jobs); gm_log( GM_LOG_DEBUG, "job max age: %d\n", opt->max_age); gm_log( GM_LOG_DEBUG, "job timeout: %d\n", opt->job_timeout); gm_log( GM_LOG_DEBUG, "min worker: %d\n", opt->min_worker); gm_log( GM_LOG_DEBUG, "max worker: %d\n", opt->max_worker); gm_log( GM_LOG_DEBUG, "spawn rate: %d\n", opt->spawn_rate); gm_log( GM_LOG_DEBUG, "fork on exec: %s\n", opt->fork_on_exec == GM_ENABLED ? "yes" : "no"); #ifndef EMBEDDEDPERL gm_log( GM_LOG_DEBUG, "embedded perl: not compiled\n"); #endif #ifdef EMBEDDEDPERL gm_log( GM_LOG_DEBUG, "\n" ); gm_log( GM_LOG_DEBUG, "embedded perl: %s\n", opt->enable_embedded_perl == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "use_epn_implicitly: %s\n", opt->use_embedded_perl_implicitly == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "use_perl_cache: %s\n", opt->use_perl_cache == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "p1_file: %s\n", opt->p1_file == NULL ? "not set" : opt->p1_file ); #endif } if(mode == GM_NEB_MODE) { gm_log( GM_LOG_DEBUG, "queue by cust var: %s\n", opt->queue_cust_var == NULL ? "no" : opt->queue_cust_var); gm_log( GM_LOG_DEBUG, "debug result: %s\n", opt->debug_result == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "result_worker: %d\n", opt->result_workers); gm_log( GM_LOG_DEBUG, "do_hostchecks: %s\n", opt->do_hostchecks == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "route_eventhandler_like_checks: %s\n", opt->route_eventhandler_like_checks == GM_ENABLED ? "yes" : "no"); } if(mode == GM_NEB_MODE || mode == GM_SEND_GEARMAN_MODE) { gm_log( GM_LOG_DEBUG, "result_queue: %s\n", opt->result_queue); } gm_log( GM_LOG_DEBUG, "\n" ); /* server && queues */ for(i=0;iserver_num;i++) gm_log( GM_LOG_DEBUG, "server: %s:%i\n", opt->server_list[i]->host, opt->server_list[i]->port); gm_log( GM_LOG_DEBUG, "\n" ); for(i=0;idupserver_num;i++) gm_log( GM_LOG_DEBUG, "dupserver: %s:%i\n", opt->dupserver_list[i]->host, opt->dupserver_list[i]->port); gm_log( GM_LOG_DEBUG, "\n" ); if(mode == GM_NEB_MODE) { gm_log( GM_LOG_DEBUG, "perfdata: %s\n", opt->perfdata == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "perfdata mode: %s\n", opt->perfdata_mode == GM_PERFDATA_OVERWRITE ? "overwrite" : "append"); } if(mode == GM_NEB_MODE || mode == GM_WORKER_MODE) { gm_log( GM_LOG_DEBUG, "hosts: %s\n", opt->hosts == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "services: %s\n", opt->services == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "eventhandler: %s\n", opt->events == GM_ENABLED ? "yes" : "no"); for(i=0;ihostgroups_num;i++) gm_log( GM_LOG_DEBUG, "hostgroups: %s\n", opt->hostgroups_list[i]); for(i=0;iservicegroups_num;i++) gm_log( GM_LOG_DEBUG, "servicegroups: %s\n", opt->servicegroups_list[i]); } if(mode == GM_NEB_MODE) { for(i=0;ilocal_hostgroups_num;i++) gm_log( GM_LOG_DEBUG, "local_hostgroups: %s\n", opt->local_hostgroups_list[i]); for(i=0;ilocal_servicegroups_num;i++) gm_log( GM_LOG_DEBUG, "local_servicegroups: %s\n", opt->local_servicegroups_list[i]); /* export queues*/ for(i=0;iexports[i]->elem_number;j++) gm_log( GM_LOG_DEBUG, "export: %-45s -> %s\n", type, opt->exports[i]->name[j]); free(type); } } /* encryption */ gm_log( GM_LOG_DEBUG, "\n" ); gm_log( GM_LOG_DEBUG, "encryption: %s\n", opt->encryption == GM_ENABLED ? "yes" : "no"); if(opt->encryption == GM_ENABLED) { gm_log( GM_LOG_DEBUG, "keyfile: %s\n", opt->keyfile == NULL ? "no" : opt->keyfile); if(opt->crypt_key != NULL) { gm_log( GM_LOG_DEBUG, "encryption key: set\n" ); } else { gm_log( GM_LOG_DEBUG, "encryption key: not set\n" ); } } if(mode == GM_NEB_MODE) { gm_log( GM_LOG_DEBUG, "accept clear result: %s\n", opt->accept_clear_results == GM_ENABLED ? "yes" : "no"); } gm_log( GM_LOG_DEBUG, "transport mode: %s\n", opt->encryption == GM_ENABLED ? "aes-256+base64" : "base64 only"); gm_log( GM_LOG_DEBUG, "use uniq jobs: %s\n", opt->use_uniq_jobs == GM_ENABLED ? "yes" : "no"); gm_log( GM_LOG_DEBUG, "--------------------------------\n" ); return; } /* free options structure */ void mod_gm_free_opt(mod_gm_opt_t *opt) { int i,j; if(opt == NULL) return; for(i=0;iserver_num;i++) { free(opt->server_list[i]->host); free(opt->server_list[i]); } for(i=0;idupserver_num;i++) { free(opt->dupserver_list[i]->host); free(opt->dupserver_list[i]); } for(i=0;ihostgroups_num;i++) free(opt->hostgroups_list[i]); for(i=0;iservicegroups_num;i++) free(opt->servicegroups_list[i]); for(i=0;ilocal_hostgroups_num;i++) free(opt->local_hostgroups_list[i]); for(i=0;ilocal_servicegroups_num;i++) free(opt->local_servicegroups_list[i]); for(i=0;iexports[i]->elem_number;j++) { free(opt->exports[i]->name[j]); } free(opt->exports[i]); } free(opt->crypt_key); free(opt->keyfile); free(opt->message); free(opt->delimiter); free(opt->pidfile); free(opt->logfile); free(opt->host); free(opt->service); free(opt->identifier); free(opt->queue_cust_var); #ifdef EMBEDDEDPERL free(opt->p1_file); #endif free(opt); opt=NULL; return; } /* read keyfile */ int read_keyfile(mod_gm_opt_t *opt) { FILE *fp; if(opt->keyfile == NULL) return(GM_ERROR); fp = fopen(opt->keyfile,"rb"); if(fp == NULL) { perror(opt->keyfile); return(GM_ERROR); } if(opt->crypt_key != NULL) free(opt->crypt_key); opt->crypt_key = malloc(GM_BUFFERSIZE); if(!fgets(opt->crypt_key, 33, fp)) return(GM_ERROR); fclose(fp); rtrim(opt->crypt_key); return(GM_OK); } /* convert to time */ void string2timeval(char * value, struct timeval *t) { char * v; char * v_c; char * s; char * u; t->tv_sec = 0; t->tv_usec = 0; if(value == NULL) return; v = strdup(value); v_c = v; s = strsep( &v, "." ); if(s == NULL) { free(v_c); return; } t->tv_sec = strtoul(s,NULL,0); u = strsep( &v, "\x0" ); if(u == NULL) { free(v_c); return; } t->tv_usec = strtoul(u,NULL,0); free(v_c); } /* convert to time */ void double2timeval(double value, struct timeval *t) { t->tv_sec = (int)value; t->tv_usec = (int)((value - (double)t->tv_sec) * 1000000); } /* convert a timeval to double */ double timeval2double(struct timeval * t) { double val = 0.0; if(t != NULL) { val = (double)t->tv_sec + ((double)t->tv_usec / 1000000); } return val; } /* compare 2 timestructs */ long mod_gm_time_compare(struct timeval * tv1, struct timeval * tv2) { long secdiff = (long)(tv1->tv_sec - tv2->tv_sec); long usecdiff = (long)(tv1->tv_usec - tv2->tv_usec); return secdiff? secdiff: usecdiff; } /* set empty default job */ int set_default_job(gm_job_t *job, mod_gm_opt_t *opt) { job->type = NULL; job->host_name = NULL; job->service_description = NULL; job->result_queue = NULL; job->command_line = NULL; job->output = NULL; job->error = NULL; job->exited_ok = TRUE; job->scheduled_check = TRUE; job->reschedule_check = TRUE; job->return_code = STATE_OK; job->latency = 0.0; job->timeout = opt->job_timeout; job->start_time.tv_sec = 0L; job->start_time.tv_usec = 0L; job->has_been_sent = FALSE; return(GM_OK); } /* free the job structure */ int free_job(gm_job_t *job) { free(job->type); free(job->host_name); free(job->service_description); free(job->result_queue); free(job->command_line); free(job->output); if(job->error != NULL) free(job->error); free(job); return(GM_OK); } /* verify if a pid is alive */ int pid_alive(int pid) { int status; if(pid < 0) { pid = -pid; } /* 1/-1 are undefined pids in our case */ if(pid == 1) return FALSE; /* send kill 0 to verify the process still exists */ if(kill(pid, 0) == 0) { return TRUE; } return FALSE; } /* escapes newlines in a string */ char *escapestring(char *rawbuf) { char *newbuf=NULL; char buff[64]; register int x,y; if(rawbuf==NULL) return NULL; /* allocate enough memory to escape all chars if necessary */ if((newbuf=malloc((strlen(rawbuf)*2)+1))==NULL) return NULL; for(x=0,y=0;rawbuf[x]!=(char)'\x0';x++){ if(escaped(rawbuf[x])) { escape(buff, rawbuf[x]); newbuf[y++]=buff[0]; if(buff[1] != 0) newbuf[y++]=buff[1]; } else newbuf[y++]=rawbuf[x]; } newbuf[y]='\x0'; return newbuf; } /* is a character escaped? Params: ch - character to test Returns: 1 if escaped, 0 if normal */ int escaped(int ch) { return strchr("\\\a\b\n\r\t\"\f\v", ch) ? 1 : 0; } /* get the escape sequence for a character Params: out - output buffer (currently max 2 + nul but allow for more) ch - the character to escape */ void escape(char *out, int ch) { switch(ch) { case '\n': strcpy(out, "\\n"); break; case '\t': strcpy(out, "\\t"); break; case '\v': strcpy(out, "\\v"); break; case '\b': strcpy(out, "\\b"); break; case '\r': strcpy(out, "\\r"); break; case '\f': strcpy(out, "\\f"); break; case '\a': strcpy(out, "\\a"); break; case '\\': strcpy(out, "\\\\"); break; case '\"': strcpy(out, "\\\""); break; default: out[0] = (char) ch; break; out[1] = 0; } } /* return human readable name for neb type */ char * nebtype2str(int i) { switch(i) { case 0: return strdup("NEBTYPE_NONE"); break; case 1: return strdup("NEBTYPE_HELLO"); break; case 2: return strdup("NEBTYPE_GOODBYE"); break; case 3: return strdup("NEBTYPE_INFO"); break; case 100: return strdup("NEBTYPE_PROCESS_START"); break; case 101: return strdup("NEBTYPE_PROCESS_DAEMONIZE"); break; case 102: return strdup("NEBTYPE_PROCESS_RESTART"); break; case 103: return strdup("NEBTYPE_PROCESS_SHUTDOWN"); break; case 104: return strdup("NEBTYPE_PROCESS_PRELAUNCH"); break; case 105: return strdup("NEBTYPE_PROCESS_EVENTLOOPSTART"); break; case 106: return strdup("NEBTYPE_PROCESS_EVENTLOOPEND"); break; case 200: return strdup("NEBTYPE_TIMEDEVENT_ADD"); break; case 201: return strdup("NEBTYPE_TIMEDEVENT_REMOVE"); break; case 202: return strdup("NEBTYPE_TIMEDEVENT_EXECUTE"); break; case 203: return strdup("NEBTYPE_TIMEDEVENT_DELAY"); break; case 204: return strdup("NEBTYPE_TIMEDEVENT_SKIP"); break; case 205: return strdup("NEBTYPE_TIMEDEVENT_SLEEP"); break; case 300: return strdup("NEBTYPE_LOG_DATA"); break; case 301: return strdup("NEBTYPE_LOG_ROTATION"); break; case 400: return strdup("NEBTYPE_SYSTEM_COMMAND_START"); break; case 401: return strdup("NEBTYPE_SYSTEM_COMMAND_END"); break; case 500: return strdup("NEBTYPE_EVENTHANDLER_START"); break; case 501: return strdup("NEBTYPE_EVENTHANDLER_END"); break; case 600: return strdup("NEBTYPE_NOTIFICATION_START"); break; case 601: return strdup("NEBTYPE_NOTIFICATION_END"); break; case 602: return strdup("NEBTYPE_CONTACTNOTIFICATION_START"); break; case 603: return strdup("NEBTYPE_CONTACTNOTIFICATION_END"); break; case 604: return strdup("NEBTYPE_CONTACTNOTIFICATIONMETHOD_START"); break; case 605: return strdup("NEBTYPE_CONTACTNOTIFICATIONMETHOD_END"); break; case 700: return strdup("NEBTYPE_SERVICECHECK_INITIATE"); break; case 701: return strdup("NEBTYPE_SERVICECHECK_PROCESSED"); break; case 702: return strdup("NEBTYPE_SERVICECHECK_RAW_START"); break; case 703: return strdup("NEBTYPE_SERVICECHECK_RAW_END"); break; case 704: return strdup("NEBTYPE_SERVICECHECK_ASYNC_PRECHECK"); break; case 800: return strdup("NEBTYPE_HOSTCHECK_INITIATE"); break; case 801: return strdup("NEBTYPE_HOSTCHECK_PROCESSED"); break; case 802: return strdup("NEBTYPE_HOSTCHECK_RAW_START"); break; case 803: return strdup("NEBTYPE_HOSTCHECK_RAW_END"); break; case 804: return strdup("NEBTYPE_HOSTCHECK_ASYNC_PRECHECK"); break; case 805: return strdup("NEBTYPE_HOSTCHECK_SYNC_PRECHECK"); break; case 900: return strdup("NEBTYPE_COMMENT_ADD"); break; case 901: return strdup("NEBTYPE_COMMENT_DELETE"); break; case 902: return strdup("NEBTYPE_COMMENT_LOAD"); break; case 1000: return strdup("NEBTYPE_FLAPPING_START"); break; case 1001: return strdup("NEBTYPE_FLAPPING_STOP"); break; case 1100: return strdup("NEBTYPE_DOWNTIME_ADD"); break; case 1101: return strdup("NEBTYPE_DOWNTIME_DELETE"); break; case 1102: return strdup("NEBTYPE_DOWNTIME_LOAD"); break; case 1103: return strdup("NEBTYPE_DOWNTIME_START"); break; case 1104: return strdup("NEBTYPE_DOWNTIME_STOP"); break; case 1200: return strdup("NEBTYPE_PROGRAMSTATUS_UPDATE"); break; case 1201: return strdup("NEBTYPE_HOSTSTATUS_UPDATE"); break; case 1202: return strdup("NEBTYPE_SERVICESTATUS_UPDATE"); break; case 1203: return strdup("NEBTYPE_CONTACTSTATUS_UPDATE"); break; case 1300: return strdup("NEBTYPE_ADAPTIVEPROGRAM_UPDATE"); break; case 1301: return strdup("NEBTYPE_ADAPTIVEHOST_UPDATE"); break; case 1302: return strdup("NEBTYPE_ADAPTIVESERVICE_UPDATE"); break; case 1303: return strdup("NEBTYPE_ADAPTIVECONTACT_UPDATE"); break; case 1400: return strdup("NEBTYPE_EXTERNALCOMMAND_START"); break; case 1401: return strdup("NEBTYPE_EXTERNALCOMMAND_END"); break; case 1500: return strdup("NEBTYPE_AGGREGATEDSTATUS_STARTDUMP"); break; case 1501: return strdup("NEBTYPE_AGGREGATEDSTATUS_ENDDUMP"); break; case 1600: return strdup("NEBTYPE_RETENTIONDATA_STARTLOAD"); break; case 1601: return strdup("NEBTYPE_RETENTIONDATA_ENDLOAD"); break; case 1602: return strdup("NEBTYPE_RETENTIONDATA_STARTSAVE"); break; case 1603: return strdup("NEBTYPE_RETENTIONDATA_ENDSAVE"); break; case 1700: return strdup("NEBTYPE_ACKNOWLEDGEMENT_ADD"); break; case 1701: return strdup("NEBTYPE_ACKNOWLEDGEMENT_REMOVE"); break; case 1702: return strdup("NEBTYPE_ACKNOWLEDGEMENT_LOAD"); break; case 1800: return strdup("NEBTYPE_STATECHANGE_START"); break; case 1801: return strdup("NEBTYPE_STATECHANGE_END"); break; } return strdup("UNKNOWN"); } /* return human readable name for nebcallback */ char * nebcallback2str(int i) { switch(i) { case 0: return strdup("NEBCALLBACK_RESERVED0"); break; case 1: return strdup("NEBCALLBACK_RESERVED1"); break; case 2: return strdup("NEBCALLBACK_RESERVED2"); break; case 3: return strdup("NEBCALLBACK_RESERVED3"); break; case 4: return strdup("NEBCALLBACK_RESERVED4"); break; case 5: return strdup("NEBCALLBACK_RAW_DATA"); break; case 6: return strdup("NEBCALLBACK_NEB_DATA"); break; case 7: return strdup("NEBCALLBACK_PROCESS_DATA"); break; case 8: return strdup("NEBCALLBACK_TIMED_EVENT_DATA"); break; case 9: return strdup("NEBCALLBACK_LOG_DATA"); break; case 10: return strdup("NEBCALLBACK_SYSTEM_COMMAND_DATA"); break; case 11: return strdup("NEBCALLBACK_EVENT_HANDLER_DATA"); break; case 12: return strdup("NEBCALLBACK_NOTIFICATION_DATA"); break; case 13: return strdup("NEBCALLBACK_SERVICE_CHECK_DATA"); break; case 14: return strdup("NEBCALLBACK_HOST_CHECK_DATA"); break; case 15: return strdup("NEBCALLBACK_COMMENT_DATA"); break; case 16: return strdup("NEBCALLBACK_DOWNTIME_DATA"); break; case 17: return strdup("NEBCALLBACK_FLAPPING_DATA"); break; case 18: return strdup("NEBCALLBACK_PROGRAM_STATUS_DATA"); break; case 19: return strdup("NEBCALLBACK_HOST_STATUS_DATA"); break; case 20: return strdup("NEBCALLBACK_SERVICE_STATUS_DATA"); break; case 21: return strdup("NEBCALLBACK_ADAPTIVE_PROGRAM_DATA"); break; case 22: return strdup("NEBCALLBACK_ADAPTIVE_HOST_DATA"); break; case 23: return strdup("NEBCALLBACK_ADAPTIVE_SERVICE_DATA"); break; case 24: return strdup("NEBCALLBACK_EXTERNAL_COMMAND_DATA"); break; case 25: return strdup("NEBCALLBACK_AGGREGATED_STATUS_DATA"); break; case 26: return strdup("NEBCALLBACK_RETENTION_DATA"); break; case 27: return strdup("NEBCALLBACK_CONTACT_NOTIFICATION_DATA"); break; case 28: return strdup("NEBCALLBACK_CONTACT_NOTIFICATION_METHOD_DATA"); break; case 29: return strdup("NEBCALLBACK_ACKNOWLEDGEMENT_DATA"); break; case 30: return strdup("NEBCALLBACK_STATE_CHANGE_DATA"); break; case 31: return strdup("NEBCALLBACK_CONTACT_STATUS_DATA"); break; case 32: return strdup("NEBCALLBACK_ADAPTIVE_CONTACT_DATA"); break; } return strdup("UNKNOWN"); } /* return human readable name for eventtype */ char * eventtype2str(int i) { switch(i) { case 0: return strdup("EVENT_SERVICE_CHECK"); break; case 1: return strdup("EVENT_COMMAND_CHECK"); break; case 2: return strdup("EVENT_LOG_ROTATION"); break; case 3: return strdup("EVENT_PROGRAM_SHUTDOWN"); break; case 4: return strdup("EVENT_PROGRAM_RESTART"); break; case 5: return strdup("EVENT_CHECK_REAPER"); break; case 6: return strdup("EVENT_ORPHAN_CHECK"); break; case 7: return strdup("EVENT_RETENTION_SAVE"); break; case 8: return strdup("EVENT_STATUS_SAVE"); break; case 9: return strdup("EVENT_SCHEDULED_DOWNTIME"); break; case 10: return strdup("EVENT_SFRESHNESS_CHECK"); break; case 11: return strdup("EVENT_EXPIRE_DOWNTIME"); break; case 12: return strdup("EVENT_HOST_CHECK"); break; case 13: return strdup("EVENT_HFRESHNESS_CHECK"); break; case 14: return strdup("EVENT_RESCHEDULE_CHECKS"); break; case 15: return strdup("EVENT_EXPIRE_COMMENT"); break; case 16: return strdup("EVENT_CHECK_PROGRAM_UPDATE"); break; case 98: return strdup("EVENT_SLEEP"); break; case 99: return strdup("EVENT_USER_FUNCTION"); break; } 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; } /* check server for duplicates */ int check_param_server(gm_server_t * new_server, gm_server_t * server_list[GM_LISTSIZE], int server_num) { int i; for(i=0;ihost, server_list[i]->host ) && new_server->port == server_list[i]->port ) { gm_log( GM_LOG_ERROR, "duplicate definition of server: %s:%i\n", new_server->host, new_server->port); return GM_ERROR; } } return GM_OK; } /* send results back */ void send_result_back(gm_job_t * exec_job) { gm_log( GM_LOG_TRACE, "send_result_back()\n" ); /* avoid duplicate returned results */ if(exec_job->has_been_sent == TRUE) { return; } exec_job->has_been_sent = TRUE; if(exec_job->result_queue == NULL) { return; } if(exec_job->output == NULL) { return; } /* workaround for rc 25 bug * duplicate jobs from gearmand result in exit code 25 of plugins * because they are executed twice and get killed because of using * the same ressource. * Sending results (when exit code is 25 ) will be skipped with this * enabled. */ if( exec_job->return_code == 25 && mod_gm_opt->workaround_rc_25 == GM_ENABLED ) { return; } gm_log( GM_LOG_TRACE, "queue: %s\n", exec_job->result_queue ); temp_buffer1[0]='\x0'; snprintf( temp_buffer1, sizeof( temp_buffer1 )-1, "host_name=%s\ncore_start_time=%i.%i\nstart_time=%i.%i\nfinish_time=%i.%i\nreturn_code=%i\nexited_ok=%i\n", exec_job->host_name, ( int )exec_job->next_check.tv_sec, ( int )exec_job->next_check.tv_usec, ( int )exec_job->start_time.tv_sec, ( int )exec_job->start_time.tv_usec, ( int )exec_job->finish_time.tv_sec, ( int )exec_job->finish_time.tv_usec, exec_job->return_code, exec_job->exited_ok ); temp_buffer1[sizeof( temp_buffer1 )-1]='\x0'; if(exec_job->service_description != NULL) { temp_buffer2[0]='\x0'; strncat(temp_buffer2, "service_description=", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, exec_job->service_description, (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, "\n", (sizeof(temp_buffer2)-1)); strncat(temp_buffer1, temp_buffer2, (sizeof(temp_buffer1)-1)); } temp_buffer1[sizeof( temp_buffer1 )-1]='\x0'; if(exec_job->output != NULL) { temp_buffer2[0]='\x0'; strncat(temp_buffer2, "output=", (sizeof(temp_buffer2)-1)); if(mod_gm_opt->debug_result) { strncat(temp_buffer2, "(", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, hostname, (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, ") - ", (sizeof(temp_buffer2)-1)); } strncat(temp_buffer2, exec_job->output, (sizeof(temp_buffer2)-1)); if(mod_gm_opt->show_error_output && exec_job->error != NULL && strlen(exec_job->error) > 0) { if(strlen(exec_job->output) > 0) strncat(temp_buffer2, "\\n", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, "[", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, exec_job->error, (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, "] ", (sizeof(temp_buffer2)-1)); } strncat(temp_buffer2, "\n\n\n", (sizeof(temp_buffer2)-1)); strncat(temp_buffer1, temp_buffer2, (sizeof(temp_buffer1)-1)); } strncat(temp_buffer1, "\n", (sizeof(temp_buffer1)-2)); temp_buffer1[sizeof( temp_buffer1 )-1]='\x0'; gm_log( GM_LOG_TRACE, "data:\n%s\n", temp_buffer1); if(add_job_to_queue( current_client, mod_gm_opt->server_list, exec_job->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\n" ); } else { gm_log( GM_LOG_TRACE, "send_result_back() finished unsuccessfully\n" ); } if( mod_gm_opt->dupserver_num ) { if(mod_gm_opt->dup_results_are_passive) { strncpy(temp_buffer2, "type=passive\n", (sizeof(temp_buffer1)-2)); } strncat(temp_buffer2, temp_buffer1, (sizeof(temp_buffer2)-2)); temp_buffer2[sizeof( temp_buffer2 )-1]='\x0'; if( add_job_to_queue( current_client_dup, mod_gm_opt->dupserver_list, exec_job->result_queue, NULL, temp_buffer2, 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() has no duplicate servers to send to.\n" ); } return; } /* create md5 sum for char[] */ char *md5sum(char *text) { unsigned char sum[16]; char *result=NULL; /* allocate enough memory to escape all chars if necessary */ if((result=malloc(33))==NULL) return NULL; md5((unsigned char *)text, strlen(text), sum); snprintf(result, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", sum[0],sum[1],sum[2],sum[3],sum[4],sum[5],sum[6],sum[7],sum[8],sum[9],sum[10],sum[11],sum[12],sum[13],sum[14],sum[15]); return result; } /* add parsed server to list */ void add_server(int * server_num, gm_server_t * server_list[GM_LISTSIZE], char * servername) { gm_server_t *new_server; char * server = strdup( servername ); char * server_c = server; char * host = strsep( &server, ":" ); char * port_val = strsep( &server, "\x0" ); in_port_t port = GM_SERVER_DEFAULT_PORT; if(port_val != NULL) { port = ( in_port_t ) atoi( port_val ); } new_server = malloc(sizeof(gm_server_t)); if(!strcmp(host, "")) { new_server->host = strdup("localhost"); } else { new_server->host = strdup(host); } new_server->port = port; if(check_param_server(new_server, server_list, *server_num) == GM_OK) { server_list[*server_num] = new_server; *server_num = *server_num + 1; } else { free(new_server->host); free(new_server); } free(server_c); return; } mod_gearman-1.4.14/common/perlxsi.c0000644001161000116100000000043412135326306014107 00000000000000#include #include EXTERN_C void xs_init (pTHX); EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); EXTERN_C void xs_init(pTHX) { char *file = __FILE__; dXSUB_SYS; /* DynaLoader is a special case */ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); } mod_gearman-1.4.14/common/gearman_utils.c0000644001161000116100000003320212026024631015245 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ #include "common.h" #include "utils.h" #include "gearman_utils.h" int mod_gm_con_errors = 0; struct timeval mod_gm_error_time; /* create the gearman worker */ int create_worker( gm_server_t * server_list[GM_LISTSIZE], gearman_worker_st *worker ) { int x = 0; gearman_return_t ret; signal(SIGPIPE, SIG_IGN); gearman_worker_create( worker ); if ( worker == NULL ) { gm_log( GM_LOG_ERROR, "Memory allocation failure on worker creation\n" ); return GM_ERROR; } while ( server_list[x] != NULL ) { ret = gearman_worker_add_server( worker, server_list[x]->host, server_list[x]->port ); if ( ret != GEARMAN_SUCCESS ) { gm_log( GM_LOG_ERROR, "worker error: %s\n", gearman_worker_error( worker ) ); return GM_ERROR; } x++; } assert(x != 0); return GM_OK; } /* register function on worker */ int worker_add_function( gearman_worker_st * worker, char * queue, gearman_worker_fn *function) { gearman_return_t ret; ret = gearman_worker_add_function( worker, queue, 0, function, NULL ); if ( ret != GEARMAN_SUCCESS ) { gm_log( GM_LOG_ERROR, "worker error: %s\n", gearman_worker_error( worker ) ); return GM_ERROR; } return GM_OK; } /* create the gearman duplicate client */ int create_client_dup( gm_server_t * server_list[GM_LISTSIZE], gearman_client_st *client ) { gearman_return_t ret; int x = 0; gm_log( GM_LOG_TRACE, "create_client_dup()\n" ); signal(SIGPIPE, SIG_IGN); client = gearman_client_create(client); if ( client == NULL ) { gm_log( GM_LOG_ERROR, "Memory allocation failure on client creation\n" ); return GM_ERROR; } while ( server_list[x] != NULL ) { ret = gearman_client_add_server( client, server_list[x]->host, server_list[x]->port ); if ( ret != GEARMAN_SUCCESS ) { gm_log( GM_LOG_ERROR, "client error: %s\n", gearman_client_error( client ) ); return GM_ERROR; } x++; } current_client_dup = client; return GM_OK; } /* create the gearman client */ int create_client( gm_server_t * server_list[GM_LISTSIZE], gearman_client_st *client ) { gearman_return_t ret; int x = 0; gm_log( GM_LOG_TRACE, "create_client()\n" ); signal(SIGPIPE, SIG_IGN); client = gearman_client_create(client); if ( client == NULL ) { gm_log( GM_LOG_ERROR, "Memory allocation failure on client creation\n" ); return GM_ERROR; } while ( server_list[x] != NULL ) { ret = gearman_client_add_server( client, server_list[x]->host, server_list[x]->port ); if ( ret != GEARMAN_SUCCESS ) { gm_log( GM_LOG_ERROR, "client error: %s\n", gearman_client_error( client ) ); return GM_ERROR; } x++; } assert(x != 0); current_client = client; return GM_OK; } /* create a task and send it */ int add_job_to_queue( gearman_client_st *client, gm_server_t * server_list[GM_LISTSIZE], char * queue, char * uniq, char * data, int priority, int retries, int transport_mode, int send_now ) { gearman_task_st *task = NULL; gearman_return_t ret1, ret2; char * crypted_data; int size, free_uniq; struct timeval now; /* check too long queue names */ if(strlen(queue) > 63) { gm_log( GM_LOG_ERROR, "queue name too long: '%s'\n", queue ); return GM_ERROR; } /* cut off to long uniq ids */ free_uniq = 0; if(uniq != NULL && strlen(uniq) > 63) { uniq = md5sum(uniq); free_uniq = 1; } signal(SIGPIPE, SIG_IGN); gm_log( GM_LOG_TRACE, "add_job_to_queue(%s, %s, %d, %d, %d, %d)\n", queue, uniq, priority, retries, transport_mode, send_now ); gm_log( GM_LOG_TRACE, "%d --->%s<---\n", strlen(data), data ); crypted_data = malloc(GM_BUFFERSIZE); size = mod_gm_encrypt(&crypted_data, data, transport_mode); gm_log( GM_LOG_TRACE, "%d +++>\n%s\n<+++\n", size, crypted_data ); #ifdef GM_DEBUG /* verify decrypted string is equal to the original */ char * test; test = malloc(GM_BUFFERSIZE); mod_gm_decrypt(&test, crypted_data, transport_mode); gm_log( GM_LOG_TRACE, "%d ===>\n%s\n<===\n", size, test ); if(strcmp(test, data)) { gm_log( GM_LOG_ERROR, "%d --->%s<---\n", strlen(data), data ); gm_log( GM_LOG_ERROR, "%d ===>\n%s\n<===\n", size, test ); fprintf(stderr, "encrypted string does not match\n"); exit(EXIT_FAILURE); } #endif if( priority == GM_JOB_PRIO_LOW ) { task = gearman_client_add_task_low_background( client, NULL, NULL, queue, uniq, ( void * )crypted_data, ( size_t )size, &ret1 ); gearman_task_give_workload(task,crypted_data,size); } else if( priority == GM_JOB_PRIO_NORMAL ) { task = gearman_client_add_task_background( client, NULL, NULL, queue, uniq, ( void * )crypted_data, ( size_t )size, &ret1 ); gearman_task_give_workload(task,crypted_data,size); } else if( priority == GM_JOB_PRIO_HIGH ) { task = gearman_client_add_task_high_background( client, NULL, NULL, queue, uniq, ( void * )crypted_data, ( size_t )size, &ret1 ); gearman_task_give_workload(task,crypted_data,size); } else { gm_log( GM_LOG_ERROR, "add_job_to_queue() wrong priority: %d\n", priority ); } if(send_now != TRUE) return GM_OK; ret2 = gearman_client_run_tasks( client ); gearman_client_task_free_all( client ); if( ret1 != GEARMAN_SUCCESS || ret2 != GEARMAN_SUCCESS || task == NULL || ( gearman_client_error(client) != NULL && atof(gearman_version()) == 0.14 ) ) { /* log the error */ if(retries == 0) { gettimeofday(&now,NULL); /* only log the first error, otherwise we would fill the log very quickly */ if( mod_gm_con_errors == 0 ) { gettimeofday(&mod_gm_error_time,NULL); gm_log( GM_LOG_ERROR, "sending job to gearmand failed: %s\n", gearman_client_error(client) ); } /* or every minute to give an update */ else if( now.tv_sec >= mod_gm_error_time.tv_sec + 60) { gettimeofday(&mod_gm_error_time,NULL); gm_log( GM_LOG_ERROR, "sending job to gearmand failed: %s (%i lost jobs so far)\n", gearman_client_error(client), mod_gm_con_errors ); } mod_gm_con_errors++; } /* recreate client, otherwise gearman sigsegvs */ gearman_client_free( client ); create_client( server_list, client ); /* retry as long as we have retries */ if(retries > 0) { retries--; gm_log( GM_LOG_TRACE, "add_job_to_queue() retrying... %d\n", retries ); return(add_job_to_queue( client, server_list, queue, uniq, data, priority, retries, transport_mode, send_now )); } /* no more retries... */ else { gm_log( GM_LOG_TRACE, "add_job_to_queue() finished with errors: %d %d\n", ret1, ret2 ); return GM_ERROR; } } /* reset error counter */ mod_gm_con_errors = 0; if(free_uniq) free(uniq); gm_log( GM_LOG_TRACE, "add_job_to_queue() finished successfully: %d %d\n", ret1, ret2 ); return GM_OK; } void *dummy( gearman_job_st *job, void *context, size_t *result_size, gearman_return_t *ret_ptr ) { /* avoid "unused parameter" warning */ job = job; context = context; result_size = 0; ret_ptr = ret_ptr; return NULL; } /* free client structure */ void free_client(gearman_client_st *client) { gearman_client_free( client ); return; } /* free worker structure */ void free_worker(gearman_worker_st *worker) { gearman_worker_free( worker ); return; } /* get worker/jobs data from gearman server */ int get_gearman_server_data(mod_gm_server_status_t *stats, char ** message, char ** version, char * hostnam, int port) { int rc; char *total, *running, *worker, *output, *output_c, *line, *name; mod_gm_status_function_t *func; *version = malloc(GM_BUFFERSIZE); snprintf(*version, GM_BUFFERSIZE, "%s", "" ); rc = send2gearmandadmin("status\nversion\n", hostnam, port, &output, message); if(rc != STATE_OK) { return rc; } output_c = output; while ( (line = strsep( &output, "\n" )) != NULL ) { gm_log( GM_LOG_TRACE, "%s\n", line ); if(!strcmp( line, ".")) { if((line = strsep( &output, "\n" )) != NULL) { gm_log( GM_LOG_TRACE, "%s\n", line ); if(line[0] == 'O') { strncpy(*version, line+3, 10); } else { snprintf(*version, GM_BUFFERSIZE, "%s", line); } gm_log( GM_LOG_TRACE, "extracted version: '%s'\n", *version ); } /* sort our array by queue name */ qsort(stats->function, stats->function_num, sizeof(mod_gm_status_function_t*), struct_cmp_by_queue); free(output_c); return( STATE_OK ); } name = strsep(&line, "\t"); if(name == NULL) break; total = strsep(&line, "\t"); if(total == NULL) break; running = strsep(&line, "\t"); if(running == NULL) break; worker = strsep(&line, "\x0"); if(worker == NULL) break; func = malloc(sizeof(mod_gm_status_function_t)); func->queue = strdup(name); func->running = atoi(running); func->total = atoi(total); func->worker = atoi(worker); func->waiting = func->total - func->running; /* skip the dummy queue if its empty */ if(!strcmp( name, "dummy") && func->total == 0) { free(func->queue); free(func); continue; } stats->function[stats->function_num++] = func; gm_log( GM_LOG_DEBUG, "%i: name:%-20s worker:%-5i waiting:%-5i running:%-5i\n", stats->function_num, func->queue, func->worker, func->waiting, func->running ); } snprintf(*message, GM_BUFFERSIZE, "got no valid data from %s:%i\n", hostnam, (int)port); free(output_c); return(rc); } /* send gearman admin */ int send2gearmandadmin(char * cmd, char * hostnam, int port, char ** output, char ** error) { int sockfd, n; struct sockaddr_in serv_addr; struct hostent *server; char buf[GM_BUFFERSIZE]; *error = malloc(GM_BUFFERSIZE); snprintf(*error, GM_BUFFERSIZE, "%s", "" ); *output = malloc(GM_BUFFERSIZE); snprintf(*output, GM_BUFFERSIZE, "%s", "" ); sockfd = socket(AF_INET, SOCK_STREAM, 0); if( sockfd < 0 ) { snprintf(*error, GM_BUFFERSIZE, "failed to open socket: %s\n", strerror(errno)); return( STATE_CRITICAL ); } server = gethostbyname(hostnam); if( server == NULL ) { snprintf(*error, GM_BUFFERSIZE, "failed to resolve %s\n", hostnam); return( STATE_CRITICAL ); } serv_addr.sin_family = AF_INET; bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); if (connect(sockfd,(const struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) { snprintf(*error, GM_BUFFERSIZE, "failed to connect to %s:%i - %s\n", hostnam, (int)port, strerror(errno)); close(sockfd); return( STATE_CRITICAL ); } n = write(sockfd,cmd,strlen(cmd)); if (n < 0) { snprintf(*error, GM_BUFFERSIZE, "failed to send to %s:%i - %s\n", hostnam, (int)port, strerror(errno)); close(sockfd); return( STATE_CRITICAL ); } n = read( sockfd, buf, GM_BUFFERSIZE-1 ); buf[n] = '\x0'; if (n < 0) { snprintf(*error, GM_BUFFERSIZE, "error reading from %s:%i - %s\n", hostnam, (int)port, strerror(errno)); close(sockfd); return( STATE_CRITICAL ); } free(*output); *output = strdup(buf); close(sockfd); return( STATE_OK ); } /* free a status structure */ void free_mod_gm_status_server(mod_gm_server_status_t *stats) { int x; for(x=0; xfunction_num;x++) { free(stats->function[x]->queue); free(stats->function[x]); } for(x=0; xworker_num;x++) { free(stats->worker[x]->ip); free(stats->worker[x]->id); free(stats->worker[x]); } free(stats); } /* qsort struct comparision function for queue name */ int struct_cmp_by_queue(const void *a, const void *b) { mod_gm_status_function_t **pa = (mod_gm_status_function_t **)a; mod_gm_status_function_t *ia = (mod_gm_status_function_t *)*pa; mod_gm_status_function_t **pb = (mod_gm_status_function_t **)b; mod_gm_status_function_t *ib = (mod_gm_status_function_t *)*pb; return strcmp(ia->queue, ib->queue); } mod_gearman-1.4.14/common/epn_utils.c0000644001161000116100000002313112213031442014411 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ #include "config.h" #include "utils.h" #include "check_utils.h" #include "epn_utils.h" #include "worker_client.h" #include "gearman_utils.h" #ifdef EMBEDDEDPERL #include #include #include "include/nagios/epn_nagios.h" int use_embedded_perl = TRUE; int deinit_rc = 0; static PerlInterpreter *my_perl = NULL; extern int current_child_pid; extern int enable_embedded_perl; extern int use_embedded_perl_implicitly; extern int use_perl_cache; extern char *p1_file; #endif int run_epn_check(char *processed_command, char **ret, char **err) { #ifdef EMBEDDEDPERL int retval; int pipe_stdout[2], pipe_stderr[2]; char fname[512]=""; char *args[5]={"",NULL, "", "", NULL }; char *perl_plugin_output=NULL; SV *plugin_hndlr_cr; int count; FILE *fp; pid_t pid; sigset_t mask; int use_epn=FALSE; if(my_perl == NULL) { gm_log(GM_LOG_ERROR, "Embedded Perl has to be initialized before running the first check\n"); _exit(STATE_UNKNOWN); } #ifdef aTHX dTHX; #endif dSP; /* get filename component of command */ strncpy(fname,processed_command,strcspn(processed_command," ")); fname[strcspn(processed_command," ")]='\x0'; /* should we use the embedded Perl interpreter to run this script? */ use_epn=file_uses_embedded_perl(fname); if(use_epn == FALSE) return GM_NO_EPN; gm_log(GM_LOG_DEBUG, "Using Embedded Perl interpreter for: %s\n", fname); args[0]=fname; args[1]=use_perl_cache==GM_ENABLED ? "0" : "1"; args[2]=""; if(strchr(processed_command,' ')==NULL) args[3]=""; else args[3]=processed_command+strlen(fname)+1; ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVpv(args[0],0))); XPUSHs(sv_2mortal(newSVpv(args[1],0))); XPUSHs(sv_2mortal(newSVpv(args[2],0))); XPUSHs(sv_2mortal(newSVpv(args[3],0))); PUTBACK; /* call our perl interpreter to compile and optionally cache the command */ call_pv("Embed::Persistent::eval_file", G_SCALAR | G_EVAL); SPAGAIN ; /* compile failed */ if( SvTRUE(ERRSV) ){ /* remove the top element of the Perl stack (undef) */ (void) POPs ; perl_plugin_output=SvPVX(ERRSV); if(perl_plugin_output == NULL) *ret = strdup("(Embedded Perl failed to compile)"); else *ret = gm_escape_newlines(perl_plugin_output, GM_ENABLED); *err = strdup(""); gm_log( GM_LOG_TRACE, "Embedded Perl failed to compile %s, compile error %s - skipping plugin\n", fname, perl_plugin_output); return 768; } else { plugin_hndlr_cr=newSVsv(POPs); PUTBACK; FREETMPS; LEAVE; gm_log( GM_LOG_TRACE, "Embedded Perl successfully compiled %s and returned code ref to plugin handler\n", fname ); } /* now run run the check */ if(pipe(pipe_stdout)) { gm_log( GM_LOG_ERROR, "error creating pipe: %s\n", strerror(errno)); _exit(STATE_UNKNOWN); } if(pipe(pipe_stderr)) { gm_log( GM_LOG_ERROR, "error creating pipe: %s\n", strerror(errno)); _exit(STATE_UNKNOWN); } if((pid=fork())<0){ gm_log( GM_LOG_ERROR, "fork error\n"); _exit(STATE_UNKNOWN); } else if(!pid) { /* child process */ /* remove all customn signal handler */ sigfillset(&mask); sigprocmask(SIG_UNBLOCK, &mask, NULL); gm_log( GM_LOG_TRACE, "Embedded Perl Child\n" ); if((dup2(pipe_stderr[1],STDERR_FILENO)<0)){ gm_log( GM_LOG_ERROR, "dup2 error\n"); _exit(STATE_UNKNOWN); } close(pipe_stdout[0]); close(pipe_stderr[1]); current_child_pid = getpid(); /* remove parents signal handler */ signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); signal(SIGHUP, SIG_DFL); signal(SIGPIPE, SIG_DFL); /* run the perl script */ ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVpv(args[0],0))); XPUSHs(sv_2mortal(newSVpv(args[1],0))); XPUSHs(plugin_hndlr_cr); XPUSHs(sv_2mortal(newSVpv(args[3],0))); PUTBACK; count=call_pv("Embed::Persistent::run_package", G_ARRAY); SPAGAIN; perl_plugin_output = POPpx; retval = POPi; if(perl_plugin_output!=NULL) { if(write(pipe_stdout[1], perl_plugin_output, strlen(perl_plugin_output)+1) <= 0) perror("write stdout"); } PUTBACK; FREETMPS; LEAVE; /* free structures */ mod_gm_free_opt(mod_gm_opt); deinit_embedded_perl(retval); _exit(retval); } /* parent */ else { /* prepare stdout pipe reading */ close(pipe_stdout[1]); fp=fdopen(pipe_stdout[0],"r"); if(!fp){ gm_log( GM_LOG_ERROR, "fdopen error\n"); _exit(STATE_UNKNOWN); } *ret = extract_check_result(fp, GM_DISABLED); fclose(fp); /* prepare stderr pipe reading */ close(pipe_stderr[1]); fp=fdopen(pipe_stderr[0],"r"); if(!fp){ gm_log( GM_LOG_ERROR, "fdopen error\n"); _exit(STATE_UNKNOWN); } *err = extract_check_result(fp, GM_ENABLED); fclose(fp); close(pipe_stdout[0]); close(pipe_stderr[0]); if(waitpid(pid,&retval,0)!=pid) retval=STATE_UNKNOWN; return retval; } #endif return GM_NO_EPN; } /* checks to see if we should run a script using the embedded Perl interpreter */ int file_uses_embedded_perl(char *fname) { #ifndef EMBEDDEDPERL return FALSE; #else int line; FILE *fp = NULL; char buf[256] = ""; if(enable_embedded_perl != TRUE) return FALSE; /* open the file, check if its a Perl script and see if we can use epn */ fp = fopen(fname, "r"); if(fp == NULL) return FALSE; /* grab the first line - we should see Perl. go home if not */ if (fgets(buf, 80, fp) == NULL || strstr(buf, "/bin/perl") == NULL) { fclose(fp); return FALSE; } /* epn directives must be found in first ten lines of plugin */ for(line = 1; line < 10; line++) { if(fgets(buf, sizeof(buf) - 1, fp) == NULL) break; buf[sizeof(buf) - 1] = '\0'; /* skip lines not containing 'epn' directives */ if(strstr(buf, "# nagios:") || strstr(buf, "# icinga:")) { char *p; p = strstr(buf + 8, "epn"); if (!p) continue; /* * we found it, so close the file and return * whatever it shows. '+epn' means yes. everything * else means no */ fclose(fp); return *(p - 1) == '+' ? TRUE : FALSE; } } fclose(fp); return use_embedded_perl_implicitly; #endif } /* initializes embedded perl interpreter */ int init_embedded_perl(char **env){ #ifdef EMBEDDEDPERL void **embedding; int exitstatus=0; int argc=2; argc=argc; struct stat stat_buf; /* make sure the P1 file exists... */ if(p1_file==NULL || stat(p1_file,&stat_buf)!=0){ use_embedded_perl=FALSE; gm_log(GM_LOG_ERROR,"Error: p1.pl file (%s) required for embedded Perl interpreter is missing!\n", p1_file); } else{ embedding=(void **)malloc(2*sizeof(char *)); if(embedding==NULL) return GM_ERROR; *embedding=strdup(""); *(embedding+1)=strdup(p1_file); use_embedded_perl=TRUE; PERL_SYS_INIT3(&argc,&embedding,&env); if((my_perl=perl_alloc())==NULL){ use_embedded_perl=FALSE; gm_log(GM_LOG_ERROR,"Error: Could not allocate memory for embedded Perl interpreter!\n"); } } /* a fatal error occurred... */ if(use_embedded_perl==FALSE){ gm_log(GM_LOG_ERROR,"Bailing out due to errors encountered while initializing the embedded Perl interpreter.\n"); return GM_ERROR; } perl_construct(my_perl); exitstatus=perl_parse(my_perl,xs_init,2,(char **)embedding,env); if(!exitstatus) exitstatus=perl_run(my_perl); free(*embedding); free(*(embedding+1)); #endif return GM_OK; } #ifdef EMBEDDEDPERL /* catch sigsegv during deinitialzing and just exit */ void deinit_segv( int sig ) { _exit(deinit_rc); } #endif /* closes embedded perl interpreter */ int deinit_embedded_perl(int rc) { #ifdef EMBEDDEDPERL deinit_rc = rc; signal(SIGSEGV, deinit_segv); PL_perl_destruct_level=0; perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); free(p1_file); signal(SIGSEGV, SIG_DFL); #endif return GM_OK; } mod_gearman-1.4.14/common/gm_crypt.c0000644001161000116100000000646411700632412014251 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ #include #include #include #include #include #include "common.h" int encryption_initialized = 0; unsigned char key[KEYLENGTH(KEYBITS)]; /* initialize encryption */ void mod_gm_aes_init(char * password) { /* pad key till keysize */ int i; for (i = 0; i < 32; i++) key[i] = *password != 0 ? *password++ : 0; encryption_initialized = 1; return; } /* encrypt text with given key */ int mod_gm_aes_encrypt(unsigned char ** encrypted, char * text) { unsigned long rk[RKLENGTH(KEYBITS)]; int nrounds; int i = 0; int k = 0; unsigned char *enc; int size; int totalsize; assert(encryption_initialized == 1); nrounds = rijndaelSetupEncrypt(rk, key, KEYBITS); size = strlen(text); totalsize = size + BLOCKSIZE-size%BLOCKSIZE; if(size%BLOCKSIZE == 0) { size += BLOCKSIZE; } enc = (unsigned char *) malloc(sizeof(unsigned char)*totalsize); while(size > 0) { unsigned char plaintext[BLOCKSIZE]; unsigned char ciphertext[BLOCKSIZE]; int j; for (j = 0; j < BLOCKSIZE; j++) { int c = text[i]; if(c == 0) break; plaintext[j] = c; i++; } for (; j < BLOCKSIZE; j++) plaintext[j] = '\x0'; rijndaelEncrypt(rk, nrounds, plaintext, ciphertext); for (j = 0; j < BLOCKSIZE; j++) enc[k++] = ciphertext[j]; size -=BLOCKSIZE; } *encrypted = enc; return totalsize; } /* decrypt text with given key */ void mod_gm_aes_decrypt(char ** text, unsigned char * encrypted, int size) { char decr[GM_BUFFERSIZE]; unsigned long rk[RKLENGTH(KEYBITS)]; int nrounds; int i = 0; assert(encryption_initialized == 1); nrounds = rijndaelSetupDecrypt(rk, key, KEYBITS); decr[0] = '\0'; while(1) { unsigned char plaintext[BLOCKSIZE]; unsigned char ciphertext[BLOCKSIZE]; int j; for (j = 0; j < BLOCKSIZE; j++) { int c = encrypted[i]; ciphertext[j] = c; i++; } rijndaelDecrypt(rk, nrounds, ciphertext, plaintext); strncat(decr, (char*)plaintext, BLOCKSIZE); size -= BLOCKSIZE; if(size < BLOCKSIZE) break; } strcpy(*text, decr); return; } mod_gearman-1.4.14/INSTALL0000644001161000116100000000071612111650145012014 00000000000000Installation ============ Use Packages ------------ There are packages for Debian, Ubuntu, SLES, Redhat and Centos. Use them if possible. - https://labs.consol.de/repo/ Prerequirements --------------- You will need libgearman with at least version 0.14. Building libgearman needs the uuid-dev and libevent-dev package. Building -------- %> ./autogen.sh %> ./configure %> make %> make test %> make install see the README for configuration examples. mod_gearman-1.4.14/install-sh0000755001161000116100000003253712005170750012776 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mod_gearman-1.4.14/Makefile.in0000644001161000116100000014424412241511643013040 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # vim:ft=automake noexpandtab ############################################################################### # # mod_gearman - distribute checks with gearman # # Copyright (c) 2010 Sven Nierlein # ############################################################################### VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : 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) \ 04_log$(EXEEXT) 05_neb$(EXEEXT) 06_exec$(EXEEXT) \ 07_epn$(EXEEXT) DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/contrib/Makefile.am $(top_srcdir)/configure COPYING \ INSTALL THANKS TODO compile depcomp install-sh missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" LIBRARIES = $(pkglib_LIBRARIES) AR = ar ARFLAGS = cru mod_gearman_so_AR = $(AR) $(ARFLAGS) mod_gearman_so_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = common/base64.$(OBJEXT) common/gm_crypt.$(OBJEXT) \ common/rijndael.$(OBJEXT) common/gearman_utils.$(OBJEXT) \ common/utils.$(OBJEXT) common/md5.$(OBJEXT) am_mod_gearman_so_OBJECTS = $(am__objects_1) \ neb_module/result_thread.$(OBJEXT) \ neb_module/mod_gearman.$(OBJEXT) mod_gearman_so_OBJECTS = $(am_mod_gearman_so_OBJECTS) PROGRAMS = $(bin_PROGRAMS) am__objects_2 = common/check_utils.$(OBJEXT) common/popenRWE.$(OBJEXT) \ worker/worker_client.$(OBJEXT) am_01_utils_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \ t/01-utils.$(OBJEXT) $(am__objects_2) am__EXTRA_01_utils_SOURCES_DIST = common/perlxsi.c common/epn_utils.c 01_utils_OBJECTS = $(am_01_utils_OBJECTS) 01_utils_LDADD = $(LDADD) am_02_full_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \ t/02-full.$(OBJEXT) $(am__objects_2) am__EXTRA_02_full_SOURCES_DIST = common/perlxsi.c common/epn_utils.c 02_full_OBJECTS = $(am_02_full_OBJECTS) 02_full_LDADD = $(LDADD) am_03_exec_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \ t/03-exec_checks.$(OBJEXT) $(am__objects_2) am__EXTRA_03_exec_SOURCES_DIST = common/perlxsi.c common/epn_utils.c 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_05_neb_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \ t/05-neb.$(OBJEXT) 05_neb_OBJECTS = $(am_05_neb_OBJECTS) 05_neb_DEPENDENCIES = 05_neb_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(05_neb_LDFLAGS) \ $(LDFLAGS) -o $@ am_06_exec_OBJECTS = $(am__objects_1) t/06-execvp_vs_popen.$(OBJEXT) \ $(am__objects_2) am__EXTRA_06_exec_SOURCES_DIST = common/perlxsi.c common/epn_utils.c 06_exec_OBJECTS = $(am_06_exec_OBJECTS) 06_exec_LDADD = $(LDADD) am_07_epn_OBJECTS = $(am__objects_1) t/tap.$(OBJEXT) \ t/07-epn.$(OBJEXT) $(am__objects_2) am__EXTRA_07_epn_SOURCES_DIST = common/perlxsi.c common/epn_utils.c 07_epn_OBJECTS = $(am_07_epn_OBJECTS) 07_epn_LDADD = $(LDADD) am_check_gearman_OBJECTS = $(am__objects_1) \ tools/check_gearman.$(OBJEXT) check_gearman_OBJECTS = $(am_check_gearman_OBJECTS) check_gearman_LDADD = $(LDADD) am_gearman_top_OBJECTS = $(am__objects_1) tools/gearman_top.$(OBJEXT) gearman_top_OBJECTS = $(am_gearman_top_OBJECTS) gearman_top_DEPENDENCIES = am_mod_gearman_worker_OBJECTS = $(am__objects_1) $(am__objects_2) \ worker/worker.$(OBJEXT) am__EXTRA_mod_gearman_worker_SOURCES_DIST = common/perlxsi.c \ common/epn_utils.c mod_gearman_worker_OBJECTS = $(am_mod_gearman_worker_OBJECTS) mod_gearman_worker_LDADD = $(LDADD) am_send_gearman_OBJECTS = $(am__objects_1) \ tools/send_gearman.$(OBJEXT) send_gearman_OBJECTS = $(am_send_gearman_OBJECTS) send_gearman_LDADD = $(LDADD) 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@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(mod_gearman_so_SOURCES) $(01_utils_SOURCES) \ $(EXTRA_01_utils_SOURCES) $(02_full_SOURCES) \ $(EXTRA_02_full_SOURCES) $(03_exec_SOURCES) \ $(EXTRA_03_exec_SOURCES) $(04_log_SOURCES) $(05_neb_SOURCES) \ $(06_exec_SOURCES) $(EXTRA_06_exec_SOURCES) $(07_epn_SOURCES) \ $(EXTRA_07_epn_SOURCES) $(check_gearman_SOURCES) \ $(gearman_top_SOURCES) $(mod_gearman_worker_SOURCES) \ $(EXTRA_mod_gearman_worker_SOURCES) $(send_gearman_SOURCES) \ $(send_multi_SOURCES) DIST_SOURCES = $(mod_gearman_so_SOURCES) $(01_utils_SOURCES) \ $(am__EXTRA_01_utils_SOURCES_DIST) $(02_full_SOURCES) \ $(am__EXTRA_02_full_SOURCES_DIST) $(03_exec_SOURCES) \ $(am__EXTRA_03_exec_SOURCES_DIST) $(04_log_SOURCES) \ $(05_neb_SOURCES) $(06_exec_SOURCES) \ $(am__EXTRA_06_exec_SOURCES_DIST) $(07_epn_SOURCES) \ $(am__EXTRA_07_epn_SOURCES_DIST) $(check_gearman_SOURCES) \ $(gearman_top_SOURCES) $(mod_gearman_worker_SOURCES) \ $(am__EXTRA_mod_gearman_worker_SOURCES_DIST) \ $(send_gearman_SOURCES) $(send_multi_SOURCES) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -DDATADIR='"$(datadir)"' CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERLLIBS = @PERLLIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ initrddir = @initrddir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ user = @user@ RPM_TOPDIR = $$(pwd)/rpm.topdir DOS2UNIX = $(shell which dos2unix || which fromdos) AM_CPPFLAGS = -Iinclude OS = $(shell uname) @USEPERL_FALSE@P1FILE = @USEPERL_TRUE@P1FILE = worker/mod_gearman_p1.pl @USEPERL_FALSE@PERLLIB = @USEPERL_TRUE@PERLLIB = @PERLLIBS@ @USEPERL_FALSE@perl_objects = @USEPERL_TRUE@perl_objects = common/perlxsi.o common/epn_utils.o @USEPERL_FALSE@install_epnfiles = @USEPERL_TRUE@install_epnfiles = install_epnfiles @USEPERL_TRUE@EXTRA_mod_gearman_worker_SOURCES = common/perlxsi.c common/epn_utils.c @USEPERL_TRUE@EXTRA_01_utils_SOURCES = common/perlxsi.c common/epn_utils.c @USEPERL_TRUE@EXTRA_02_full_SOURCES = common/perlxsi.c common/epn_utils.c @USEPERL_TRUE@EXTRA_03_exec_SOURCES = common/perlxsi.c common/epn_utils.c @USEPERL_TRUE@EXTRA_06_exec_SOURCES = common/perlxsi.c common/epn_utils.c @USEPERL_TRUE@EXTRA_07_epn_SOURCES = common/perlxsi.c common/epn_utils.c @USEPERL_FALSE@EPN_BIN = @USEPERL_TRUE@EPN_BIN = mod_gearman_mini_epn # source definitions common_SOURCES = common/base64.c \ common/gm_crypt.c \ common/rijndael.c \ common/gearman_utils.c \ common/utils.c \ common/md5.c common_check_SOURCES = common/check_utils.c \ common/popenRWE.c \ worker/worker_client.c pkglib_LIBRARIES = mod_gearman.so mod_gearman_so_SOURCES = $(common_SOURCES) \ neb_module/result_thread.c \ neb_module/mod_gearman.c mod_gearman_worker_SOURCES = $(common_SOURCES) \ $(common_check_SOURCES) \ worker/worker.c send_gearman_SOURCES = $(common_SOURCES) \ tools/send_gearman.c send_multi_SOURCES = $(common_SOURCES) \ tools/send_multi.c check_gearman_SOURCES = $(common_SOURCES) \ tools/check_gearman.c gearman_top_SOURCES = $(common_SOURCES) \ tools/gearman_top.c gearman_top_LDADD = -lncurses 01_utils_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/01-utils.c $(common_check_SOURCES) 02_full_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/02-full.c $(common_check_SOURCES) 03_exec_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/03-exec_checks.c $(common_check_SOURCES) 04_log_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/04-log.c 05_neb_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/05-neb.c @USEBSD_FALSE@05_neb_LDADD = -ldl @USEBSD_TRUE@05_neb_LDADD = 05_neb_LDFLAGS = -Wl,--export-dynamic -rdynamic 07_epn_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/07-epn.c $(common_check_SOURCES) # only used for performance tests 06_exec_SOURCES = $(common_SOURCES) t/06-execvp_vs_popen.c $(common_check_SOURCES) TESTS = $(check_PROGRAMS) t/benchmark.t GEARMANDS = /usr/sbin/gearmand /opt/sbin/gearmand replace_vars = sed -e 's:%CONFIG_WORKER%:$(sysconfdir)/mod_gearman/mod_gearman_worker.conf:g' \ -e 's:%PIDFILE%:$(localstatedir)/mod_gearman/mod_gearman_worker.pid:g' \ -e 's:%LOGFILE_NEB%:$(localstatedir)/log/mod_gearman/mod_gearman_neb.log:g' \ -e 's:%LOGFILE_WORKER%:$(localstatedir)/log/mod_gearman/mod_gearman_worker.log:g' \ -e 's:%P1FILE%:$(datadir)/mod_gearman/mod_gearman_p1.pl:g' \ -e 's:%GPIDFILE%:$(localstatedir)/mod_gearman/gearmand.pid:g' \ -e 's:%GLOGFILE%:$(localstatedir)/mod_gearman/gearmand.log:g' \ -e 's:%WORKERBIN%:$(bindir)/mod_gearman_worker:g' \ -e 's:%USER%:$(user):g' EXTRA_DIST = COPYING etc/*.in extras include \ THANKS README docs/README.html Changes worker/initscript.in \ support/mod_gearman.spec \ t/data/* t/rc t/both t/killer t/sleep t/*.pl t/*.t \ worker/mod_gearman_p1.pl t/test_all.pl t/valgrind_suppress.cfg contrib \ etc/mod_gearman_logrotate all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/contrib/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-pkglibLIBRARIES: $(pkglib_LIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(pkglibdir)" || exit $$?; } @$(POST_INSTALL) @list='$(pkglib_LIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ if test -f $$p; then \ $(am__strip_dir) \ echo " ( cd '$(DESTDIR)$(pkglibdir)' && $(RANLIB) $$f )"; \ ( cd "$(DESTDIR)$(pkglibdir)" && $(RANLIB) $$f ) || exit $$?; \ else :; fi; \ done uninstall-pkglibLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LIBRARIES)'; test -n "$(pkglibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibdir)' && rm -f "$$files" )"; \ cd "$(DESTDIR)$(pkglibdir)" && rm -f $$files clean-pkglibLIBRARIES: -test -z "$(pkglib_LIBRARIES)" || rm -f $(pkglib_LIBRARIES) common/$(am__dirstamp): @$(MKDIR_P) common @: > common/$(am__dirstamp) common/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) common/$(DEPDIR) @: > common/$(DEPDIR)/$(am__dirstamp) common/base64.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) common/gm_crypt.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) common/rijndael.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) common/gearman_utils.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) common/utils.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) common/md5.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) neb_module/$(am__dirstamp): @$(MKDIR_P) neb_module @: > neb_module/$(am__dirstamp) neb_module/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) neb_module/$(DEPDIR) @: > 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) \ neb_module/$(DEPDIR)/$(am__dirstamp) mod_gearman.so: $(mod_gearman_so_OBJECTS) $(mod_gearman_so_DEPENDENCIES) -rm -f mod_gearman.so $(mod_gearman_so_AR) mod_gearman.so $(mod_gearman_so_OBJECTS) $(mod_gearman_so_LIBADD) $(RANLIB) mod_gearman.so install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) t/$(am__dirstamp): @$(MKDIR_P) t @: > t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) t/$(DEPDIR) @: > t/$(DEPDIR)/$(am__dirstamp) t/tap.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp) t/01-utils.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp) common/check_utils.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) common/popenRWE.$(OBJEXT): common/$(am__dirstamp) \ common/$(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_client.$(OBJEXT): worker/$(am__dirstamp) \ worker/$(DEPDIR)/$(am__dirstamp) common/perlxsi.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) common/epn_utils.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) t/02-full.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp) t/03-exec_checks.$(OBJEXT): t/$(am__dirstamp) \ t/$(DEPDIR)/$(am__dirstamp) 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) t/05-neb.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp) 05_neb$(EXEEXT): $(05_neb_OBJECTS) $(05_neb_DEPENDENCIES) @rm -f 05_neb$(EXEEXT) $(05_neb_LINK) $(05_neb_OBJECTS) $(05_neb_LDADD) $(LIBS) t/06-execvp_vs_popen.$(OBJEXT): t/$(am__dirstamp) \ t/$(DEPDIR)/$(am__dirstamp) t/07-epn.$(OBJEXT): t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp) tools/$(am__dirstamp): @$(MKDIR_P) tools @: > tools/$(am__dirstamp) tools/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tools/$(DEPDIR) @: > tools/$(DEPDIR)/$(am__dirstamp) tools/check_gearman.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) check_gearman$(EXEEXT): $(check_gearman_OBJECTS) $(check_gearman_DEPENDENCIES) @rm -f check_gearman$(EXEEXT) $(LINK) $(check_gearman_OBJECTS) $(check_gearman_LDADD) $(LIBS) tools/gearman_top.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) gearman_top$(EXEEXT): $(gearman_top_OBJECTS) $(gearman_top_DEPENDENCIES) @rm -f gearman_top$(EXEEXT) $(LINK) $(gearman_top_OBJECTS) $(gearman_top_LDADD) $(LIBS) worker/worker.$(OBJEXT): worker/$(am__dirstamp) \ worker/$(DEPDIR)/$(am__dirstamp) tools/send_gearman.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) send_gearman$(EXEEXT): $(send_gearman_OBJECTS) $(send_gearman_DEPENDENCIES) @rm -f send_gearman$(EXEEXT) $(LINK) $(send_gearman_OBJECTS) $(send_gearman_LDADD) $(LIBS) tools/send_multi.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) send_multi$(EXEEXT): $(send_multi_OBJECTS) $(send_multi_DEPENDENCIES) @rm -f send_multi$(EXEEXT) $(LINK) $(send_multi_OBJECTS) $(send_multi_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f common/base64.$(OBJEXT) -rm -f common/check_utils.$(OBJEXT) -rm -f common/epn_utils.$(OBJEXT) -rm -f common/gearman_utils.$(OBJEXT) -rm -f common/gm_crypt.$(OBJEXT) -rm -f common/md5.$(OBJEXT) -rm -f common/perlxsi.$(OBJEXT) -rm -f common/popenRWE.$(OBJEXT) -rm -f common/rijndael.$(OBJEXT) -rm -f common/utils.$(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/05-neb.$(OBJEXT) -rm -f t/06-execvp_vs_popen.$(OBJEXT) -rm -f t/07-epn.$(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 worker/worker.$(OBJEXT) -rm -f worker/worker_client.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/check_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/epn_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/gearman_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/gm_crypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/perlxsi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/popenRWE.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)/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)/05-neb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@t/$(DEPDIR)/06-execvp_vs_popen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@t/$(DEPDIR)/07-epn.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@worker/$(DEPDIR)/worker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@worker/$(DEPDIR)/worker_client.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) config.h all-local installdirs: for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f common/$(DEPDIR)/$(am__dirstamp) -rm -f common/$(am__dirstamp) -rm -f neb_module/$(DEPDIR)/$(am__dirstamp) -rm -f neb_module/$(am__dirstamp) -rm -f t/$(DEPDIR)/$(am__dirstamp) -rm -f t/$(am__dirstamp) -rm -f tools/$(DEPDIR)/$(am__dirstamp) -rm -f tools/$(am__dirstamp) -rm -f worker/$(DEPDIR)/$(am__dirstamp) -rm -f worker/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-local clean-pkglibLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf common/$(DEPDIR) neb_module/$(DEPDIR) t/$(DEPDIR) tools/$(DEPDIR) worker/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-local distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-exec-local \ install-pkglibLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf common/$(DEPDIR) neb_module/$(DEPDIR) t/$(DEPDIR) tools/$(DEPDIR) worker/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-pkglibLIBRARIES .MAKE: all check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local am--refresh check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ clean-generic clean-local clean-pkglibLIBRARIES ctags dist \ dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-local distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-exec-local \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkglibLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-pkglibLIBRARIES .PHONY: docs mod_gearman_mini_epn: contrib/mod_gearman_mini_epn.c perl -MExtUtils::Embed -e xsinit $(CC) $(CFLAGS) -c perlxsi.c `perl -MExtUtils::Embed -e ccopts` $(CC) $(CFLAGS) -c contrib/mod_gearman_mini_epn.c `perl -MExtUtils::Embed -e ccopts` $(CC) $(CFLAGS) $(LDFLAGS) perlxsi.o mod_gearman_mini_epn.o `perl -MExtUtils::Embed -e ccopts -e ldopts` -o $@ # other targets mod_gearman.o: $(mod_gearman_so_OBJECTS) $(mod_gearman_so_DEPENDENCIES) @echo ' $$(CC) $<' @if [ "$(OS)" = "Darwin" ]; then \ $(CXX) $(LDFLAGS) -dynamiclib -single_module -undefined dynamic_lookup $(mod_gearman_so_OBJECTS) -o $@ -lpthread -lgearman; \ else \ $(CXX) $(LDFLAGS) -fPIC -shared $(mod_gearman_so_OBJECTS) -o $@ -lpthread -lgearman; \ fi chmod 644 mod_gearman.o @$(RM) mod_gearman.so common/perlxsi.o: @echo ' $$(CC) $<' @depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ $(COMPILE) `perl -MExtUtils::Embed -e ccopts` -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ common/perlxsi.c &&\ $(am__mv) $$depbase.Tpo $$depbase.Po common/epn_utils.o: @echo ' $$(CC) $<' @depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ $(COMPILE) `perl -MExtUtils::Embed -e ccopts` -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ common/epn_utils.c &&\ $(am__mv) $$depbase.Tpo $$depbase.Po mod_gearman_neb.conf-local: @$(replace_vars) etc/mod_gearman_neb.conf.in > etc/mod_gearman_neb.conf mod_gearman_worker.conf-local: @$(replace_vars) etc/mod_gearman_worker.conf.in > etc/mod_gearman_worker.conf initscript-local: @$(replace_vars) worker/initscript.in > worker/initscript gearmand-init-local: @$(replace_vars) extras/gearmand-init.in > extras/gearmand-init @if [ ! -z $$(which gearmand 2>/dev/null) ]; then \ sed -i -e "s:%GEARMAND%:$$(which gearmand 2>/dev/null):g" extras/gearmand-init; \ fi @for gearm in $(GEARMANDS); do \ test -f $$gearm && sed -i -e "s:%GEARMAND%:$$gearm:g" extras/gearmand-init ; \ done; echo done @sed -i -e 's:%GEARMAND%:/usr/sbin/gearmand:g' extras/gearmand-init @chmod 755 extras/gearmand-init all-local: mod_gearman.o initscript-local mod_gearman_neb.conf-local mod_gearman_worker.conf-local gearmand-init-local $(EPN_BIN) @echo "" @echo "################################################################" @echo "" @echo " the following files have been created:" @echo "" @echo " mod_gearman.o" @echo " mod_gearman_worker" @echo " worker/initscript" @echo " etc/mod_gearman_neb.conf" @echo " etc/mod_gearman_worker.conf" @[ "$(P1FILE)" = "" ] || echo " $(P1FILE)" @[ "$(EPN_BIN)" = "" ] || echo " $(EPN_BIN)" @echo "" @echo " read the README for configuration details" @echo "" @echo " for a normal installation continue with" @echo " make install" @echo "" @echo "################################################################" distclean-local: clean $(RM) -rf .deps/ Makefile.in aclocal.m4 autom4te.cache config.* configure depcomp install-sh missing *.gz contrib/.deps/ contrib/.dirstamp clean-local: $(RM) -f worker.static worker/initscript etc/mod_gearman.conf rpm.topdir *.o */*.o extras/gearmand-init etc/mod_gearman_neb.conf etc/mod_gearman_worker.conf mod_gearman_mini_epn perlxsi.c worker.static: worker @echo "################################################################" @echo "" @echo " if the static compiler complains about 'cannot find -lgearman', you have to" @echo " compile libgearman with -static" @echo "" @echo "################################################################" cd worker && $(CC) $(LDFLAGS) $(CFLAGS) -static -o worker.static $(worker_OBJECTS) -lgearman -lpthread -luuid @echo "" @echo " worker.static created." @echo "" install-exec-local: install-local-state-dir $(install_sh_PROGRAM) -m 644 mod_gearman.o $(DESTDIR)$(pkglibdir)/mod_gearman.o $(install_sh_PROGRAM) -m 755 worker/initscript $(DESTDIR)$(initrddir)/mod_gearman_worker $(install_sh_PROGRAM) -m 755 extras/gearmand-init $(DESTDIR)$(initrddir)/gearmand install-local-state-dir: $(install_sh_PROGRAM) -d $(DESTDIR)$(localstatedir)/mod_gearman/ install_epnfiles: $(install_sh_PROGRAM) -m 755 $(P1FILE) $(DESTDIR)$(datadir)/mod_gearman/mod_gearman_p1.pl $(install_sh_PROGRAM) -m 755 $(EPN_BIN) $(DESTDIR)$(bindir)/mod_gearman_mini_epn @echo "################################################################" @echo " Installation completed:" @echo " p1file: $(DESTDIR)$(datadir)/mod_gearman/mod_gearman_p1.pl" @echo "################################################################" install-data-local: install-local-state-dir $(install_epnfiles) $(install_sh_PROGRAM) -d $(DESTDIR)$(localstatedir)/log/mod_gearman $(install_sh_PROGRAM) -m 644 extras/shared.conf $(DESTDIR)$(datadir)/mod_gearman/shared.conf $(install_sh_PROGRAM) -m 644 extras/standalone_worker.conf $(DESTDIR)$(datadir)/mod_gearman/standalone_worker.conf $(install_sh_PROGRAM) -m 644 contrib/gearman_proxy.pl $(DESTDIR)$(datadir)/mod_gearman/gearman_proxy.pl @echo "" @echo "################################################################" @echo "" @echo " Installation completed:" @echo " neb module: $(DESTDIR)$(pkglibdir)/mod_gearman.o" @echo "" @echo " worker: $(DESTDIR)$(bindir)/mod_gearman_worker" @echo " init script: $(DESTDIR)$(initrddir)/mod_gearman_worker" @[ "$(EPN_BIN)" = "" ] || echo " mini-epn: $(DESTDIR)$(bindir)/mod_gearman_mini_epn" @echo "" @echo " check bin: $(DESTDIR)$(bindir)/check_gearman" @echo " send bin: $(DESTDIR)$(bindir)/send_gearman" @echo " send multi bin: $(DESTDIR)$(bindir)/send_multi" @echo "" @echo "just add the broker line to your nagios.cfg:" @echo "broker_module=$(DESTDIR)$(pkglibdir)/mod_gearman.o config=$(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf" @echo "" @if [ -e $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf -o -e $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_worker.conf ]; then \ echo " install default config with"; \ echo ""; \ echo " make install-config"; \ echo ""; \ else \ make install-config; \ fi $(RM) $(DESTDIR)$(pkglibdir)/mod_gearman.so install-config: $(install_sh_PROGRAM) -m 644 etc/mod_gearman_neb.conf $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf $(install_sh_PROGRAM) -m 644 etc/mod_gearman_worker.conf $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_worker.conf $(install_sh_PROGRAM) -m 644 etc/mod_gearman_logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/mod_gearman @echo "################################################################" @echo "" @echo " configuration:" @echo " neb module: $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf" @echo " worker: $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_worker.conf" @echo " logrotate.d: $(DESTDIR)$(sysconfdir)/logrotate.d/mod_gearman" @echo "" @echo "################################################################" test: check @echo "################################################################" @echo "" @echo " All tests completed successfully" @echo "" @echo "################################################################" fulltest: ./t/test_all.pl @echo "################################################################" @echo "" @echo " Full tests completed successfully" @echo "" @echo "################################################################" docs: @if [ -z "$(DOS2UNIX)" ]; then \ printf "\n\n**** please install dos2unix or tofrodos package ****\n\n"; \ exit 1; \ fi @if [ `type doxygen > /dev/null 2>&1` ]; then \ doxygen Doxyfile; \ else \ printf "\n\n**** please install doxygen to generate doxygen docs ****\n\n"; \ fi; $(RM) docs/images cd docs && ln -s /usr/share/asciidoc/images . cp -p README.asciidoc docs/README && cd docs && asciidoc --unsafe -a toc -a toclevels=2 -a max-width=800 README chmod 644 docs/README.html $(DOS2UNIX) docs/README.html ./replace_doc_toc.pl docs/README.html $(RM) -f docs/README rpm: dist mkdir -p $(RPM_TOPDIR)/{SOURCES,BUILD,RPMS,SRPMS,SPECS} cp mod_gearman-$(VERSION).tar.gz $(RPM_TOPDIR)/SOURCES rpmbuild -ba --define "_topdir $(RPM_TOPDIR)" \ --buildroot=$$(pwd)/rpm.buildroot support/mod_gearman.spec mv -v $(RPM_TOPDIR)/RPMS/*/*.rpm . mv -v $(RPM_TOPDIR)/SRPMS/*.src.rpm . $(RM) -f $(RPM_TOPDIR) rpm.buildroot deb: dpkg-buildpackage -us -uc mrproper: git clean -xfd version: if [ -z "$$NEWVERSION" ]; then NEWVERSION=$$(dialog --stdout --inputbox "New Version:" 0 0 "$(VERSION)"); fi; \ if [ -n "$$NEWVERSION" ] && [ "$$NEWVERSION" != "$(VERSION)" ]; then \ sed -ri "s/$(VERSION)/$$NEWVERSION/" include/common.h configure.ac support/mod_gearman.spec; \ sed -i Changes -e "s/$(VERSION)/$$NEWVERSION $(shell date)\n - ...\n\n$(VERSION)/"; \ $(MAKE) docs; \ fi; # order does matter for perl libs/includes (at least on centos 5) mod_gearman_worker$(EXEEXT): $(mod_gearman_worker_OBJECTS) $(perl_objects) $(mod_gearman_worker_DEPENDENCIES) @rm -f mod_gearman_worker$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(mod_gearman_worker_OBJECTS) $(perl_objects) $(mod_gearman_worker_LDADD) $(LIBS) $(PERLLIB) 01_utils$(EXEEXT): $(01_utils_OBJECTS) $(perl_objects) $(01_utils_DEPENDENCIES) @rm -f 01_utils$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(01_utils_OBJECTS) $(perl_objects) $(01_utils_LDADD) $(LIBS) $(PERLLIB) 02_full$(EXEEXT): $(02_full_OBJECTS) $(perl_objects) $(02_full_DEPENDENCIES) @rm -f 02_full$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(02_full_OBJECTS) $(perl_objects) $(02_full_LDADD) $(LIBS) $(PERLLIB) 03_exec$(EXEEXT): $(03_exec_OBJECTS) $(perl_objects) $(03_exec_DEPENDENCIES) @rm -f 03_exec$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(03_exec_OBJECTS) $(perl_objects) $(03_exec_LDADD) $(LIBS) $(PERLLIB) 06_exec$(EXEEXT): $(06_exec_OBJECTS) $(perl_objects) $(06_exec_DEPENDENCIES) @rm -f 06_exec$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(06_exec_OBJECTS) $(perl_objects) $(06_exec_LDADD) $(LIBS) $(PERLLIB) 07_epn$(EXEEXT): $(07_epn_OBJECTS) $(perl_objects) $(07_epn_DEPENDENCIES) @rm -f 07_epn$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(07_epn_OBJECTS) $(perl_objects) $(07_epn_LDADD) $(LIBS) $(PERLLIB) # 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: mod_gearman-1.4.14/configure.ac0000644001161000116100000001175112241503656013262 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. ############################################## # autoconf really does not work with 2.59 or older AC_PREREQ([2.60]) AC_INIT([mod_gearman], [1.4.14], [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]) CFLAGS="-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -O -fPIC -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64" ############################################## AC_ARG_ENABLE(debug,--enable-debug will enable debugging symbols,[ CFLAGS="${CFLAGS} -pedantic -Wfatal-errors -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -g3" ], CFLAGS="${CFLAGS} -s" ) ############################################## # Checks for programs. AC_PROG_CXX AC_PROG_CC AM_PROG_CC_C_O AC_PROG_RANLIB ############################################## # gearman wants this AC_C_INLINE AC_FUNC_MALLOC AC_FUNC_FORK AC_HEADER_STDBOOL ############################################## # Checks for libraries. AC_CHECK_LIB([pthread], [pthread_create]) ############################################## # Checks for header files. AC_CHECK_HEADERS([stdlib.h string.h unistd.h pthread.h arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h sys/socket.h sys/time.h sys/timeb.h syslog.h],,AC_MSG_ERROR([Compiling Mod-Gearman requires standard unix headers files])) AC_CHECK_HEADERS([ltdl.h],,AC_MSG_ERROR([Compiling Mod-Gearman requires ltdl.h])) AC_CHECK_HEADERS([curses.h],,AC_MSG_ERROR([Compiling Mod-Gearman requires curses.h])) AC_ARG_WITH(gearman, [ --with-gearman=DIR Specify the path to your gearman library], [ found=0 libgm_1_0=0 for d in libgearman/.libs lib .; do test -e "$withval/$d/libgearman.so" && LDFLAGS="${LDFLAGS} -L$withval/$d" && CFLAGS="${CFLAGS} -L$withval/$d" && found=1 && break; done test $found -eq 1 || { echo 'did not find libgearman.so under your specified path!' && exit 1; } found=0 for d in libgearman-1.0 include .; do test -e "$withval/$d/libgearman-1.0/gearman.h" && CFLAGS="${CFLAGS} -I$withval/$d" && found=1 && libgm_1_0=1 && break; test -e "$withval/$d/libgearman/gearman.h" && CFLAGS="${CFLAGS} -I$withval/$d" && found=1 && break; done test $found -eq 1 || { echo 'did not find gearman.h under your specified path!' && exit 1; } test $libgm_1_0 -eq 1 && { AC_DEFINE_UNQUOTED(LIBGEARMAN_1_0,,[libgearman 1.0 uses different header name. introduced with libgearman 0.25 ]) } ]) ############################################## # Checks for additional libraries. AC_CHECK_LIB([gearman], [gearman_client_create],,AC_MSG_ERROR([Compiling Mod-Gearman requires libgearman. You may specify the path by --with-gearman=path...])) ############################################## # Determine the system init.d directory AC_ARG_WITH([init-dir], [AS_HELP_STRING([--with-init-dir], [specify the system init script directory @<:@default="${sysconfdir}/init.d"@:>@])], [], [with_init_dir="${sysconfdir}/init.d"]) initrddir="$with_init_dir" AC_SUBST(initrddir) ############################################## # Determine the user AC_ARG_WITH([user], [AS_HELP_STRING([--with-user], [specify the user @<:@default="nagios"@:>@])], [], [with_user="nagios"]) user="$with_user" AC_SUBST(user) ############################################## USEPERL=no; AC_ARG_ENABLE(embedded-perl,--enable-embedded-perl will enable embedded Perl interpreter,[ USEPERL=$enableval ] ,USEPERL=no) dnl Is embedded Perl being compiled in? AM_CONDITIONAL(USEPERL, test "$USEPERL" = "yes") if test "$USEPERL" = "yes"; then tmp=$LIBS AC_CHECK_LIB([perl],[perl_alloc],,AC_MSG_ERROR([Compiling Mod-Gearman with embedded Perl requires libperl.]),[`perl -MExtUtils::Embed -e ccopts -e ldopts`]) # save libs, as we do not want to add -lperl to all LIBS LIBS=$tmp AC_DEFINE_UNQUOTED(EMBEDDEDPERL,,[Is embedded Perl being compiled in?]) echo "creating common/perlxsi.c" perl -MExtUtils::Embed -e xsinit -- -o common/perlxsi.c echo "Embedded Perl interpreter will be compiled in..." PERLLIBS="`perl -MExtUtils::Embed -e ccopts -e ldopts | tr -d '\n'`" AC_SUBST(PERLLIBS) fi ############################################## AM_CONDITIONAL(USEBSD, test "$(uname)" = "FreeBSD") ############################################## # Check some functions 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 ############################################## # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_TYPE_PID_T ############################################## # add a "make install" target AC_PROG_INSTALL ############################################## # write out files AC_CONFIG_FILES([Makefile]) AC_OUTPUT mod_gearman-1.4.14/config.h.in0000644001161000116100000001267312241504063013014 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Is embedded Perl being compiled in? */ #undef EMBEDDEDPERL /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the 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 header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `gearman' library (-lgearman). */ #undef HAVE_LIBGEARMAN /* Define to 1 if you have the `perl' library (-lperl). */ #undef HAVE_LIBPERL /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the 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 header file. */ #undef HAVE_LTDL_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 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 header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcspn' function. */ #undef HAVE_STRCSPN /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the 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 /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* libgearman 1.0 uses different header name. introduced with libgearman 0.25 */ #undef LIBGEARMAN_1_0 /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define as `fork' if `vfork' does not work. */ #undef vfork mod_gearman-1.4.14/missing0000755001161000116100000002623312005170750012365 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program 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 2, or (at your option) # any later version. # This program 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 this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mod_gearman-1.4.14/tools/0000755001161000116100000000000012241511662012203 500000000000000mod_gearman-1.4.14/tools/send_gearman.c0000644001161000116100000003231112213031442014702 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /* include header */ #include "send_gearman.h" #include "utils.h" #include "gearman_utils.h" gearman_client_st client; gearman_client_st client_dup; int results_sent = 0; /* work starts here */ int main (int argc, char **argv) { int rc; /* * allocate options structure * and parse command line */ if(parse_arguments(argc, argv) != GM_OK) { print_usage(); exit( STATE_UNKNOWN ); } /* 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); } else { mod_gm_opt->transportmode = GM_ENCODE_ONLY; } /* create client */ if ( create_client( mod_gm_opt->server_list, &client ) != GM_OK ) { printf( "send_gearman UNKNOWN: cannot start client\n" ); exit( STATE_UNKNOWN ); } /* create duplicate client */ if ( create_client_dup( mod_gm_opt->dupserver_list, &client_dup ) != GM_OK ) { printf( "send_gearman UNKNOWN: cannot start client for duplicate server\n" ); exit( STATE_UNKNOWN ); } /* 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 ); } /* parse command line arguments */ int parse_arguments(int argc, char **argv) { int i; int verify; int errors = 0; mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); /* special default: encryption disabled */ mod_gm_opt->encryption = GM_DISABLED; for(i=1;ikeyfile != NULL && read_keyfile(mod_gm_opt) != GM_OK) { errors++; } if(errors > 0 || verify != GM_OK) { return(GM_ERROR); } return(GM_OK); } /* verify our option */ int verify_options(mod_gm_opt_t *opt) { /* did we get any server? */ if(opt->server_num == 0) { printf("please specify at least one server\n" ); return(GM_ERROR); } /* encryption without key? */ if(opt->encryption == GM_ENABLED) { if(opt->crypt_key == NULL && opt->keyfile == NULL) { printf("no encryption key provided, please use --key=... or keyfile=... or disable encryption\n"); return(GM_ERROR); } } 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); } /* print usage */ void print_usage() { printf("usage:\n"); printf("\n"); printf("send_gearman [ --debug= ]\n"); printf(" [ --help|-h ]\n"); printf("\n"); printf(" [ --config= ]\n"); printf("\n"); printf(" [ --server= ]\n"); printf("\n"); printf(" [ --timeout|-t= ]\n"); printf(" [ --delimiter|-d= ]\n"); printf("\n"); printf(" [ --encryption= ]\n"); printf(" [ --key= ]\n"); printf(" [ --keyfile= ]\n"); printf("\n"); printf(" [ --host= ]\n"); printf(" [ --service= ]\n"); printf(" [ --result_queue= ]\n"); printf(" [ --message|-m= ]\n"); printf(" [ --returncode|-r= ]\n"); printf("\n"); printf("for sending active checks:\n"); printf(" [ --active ]\n"); printf(" [ --starttime= ]\n"); printf(" [ --finishtime= ]\n"); printf(" [ --latency= ]\n"); printf("\n"); printf("plugin output is read from stdin unless --message is used.\n"); printf("Use this mode when plugin has multiple lines of plugin output.\n"); printf("\n"); printf("Note: When using a delimiter (-d) you may also submit one result\n"); printf(" for each line.\n"); printf(" Service Checks:\n"); printf(" [tab][tab][tab][newline]\n"); printf("\n"); printf(" Host Checks:\n"); printf(" [tab][tab][newline]\n"); printf("\n"); printf("see README for a detailed explaination of all options.\n"); printf("\n"); mod_gm_free_opt(mod_gm_opt); exit( STATE_UNKNOWN ); } /* send message to job server */ int send_result() { char buffer[GM_BUFFERSIZE] = ""; int size; char *ptr1, *ptr2, *ptr3, *ptr4; gm_log( GM_LOG_TRACE, "send_result()\n" ); if(mod_gm_opt->result_queue == NULL) { printf( "got no result queue, please use --result_queue=...\n" ); return( STATE_UNKNOWN ); } /* multiple results */ if(mod_gm_opt->host == NULL) { while(fgets(buffer,sizeof(buffer)-1,stdin)) { if(feof(stdin)) break; /* disable alarm */ alarm(0); /* read host_name */ ptr1=strtok(buffer,mod_gm_opt->delimiter); if(ptr1==NULL) continue; /* get the service description or return code */ ptr2=strtok(NULL,mod_gm_opt->delimiter); if(ptr2==NULL) continue; /* get the return code or plugin output */ ptr3=strtok(NULL,mod_gm_opt->delimiter); if(ptr3==NULL) continue; /* get the plugin output - if NULL, this is a host check result */ ptr4=strtok(NULL,"\n"); free(mod_gm_opt->host); if(mod_gm_opt->service != NULL) { free(mod_gm_opt->service); mod_gm_opt->service = NULL; } free(mod_gm_opt->message); /* host result */ if(ptr4 == NULL) { mod_gm_opt->host = strdup(ptr1); mod_gm_opt->return_code = atoi(ptr2); mod_gm_opt->message = strdup(ptr3); } else { /* service result */ mod_gm_opt->host = strdup(ptr1); mod_gm_opt->service = strdup(ptr2); mod_gm_opt->return_code = atoi(ptr3); mod_gm_opt->message = strdup(ptr4); } if(submit_result() == STATE_OK) { results_sent++; } else { printf("failed to send result!\n"); return(STATE_UNKNOWN); } } printf("%d data packet(s) sent to host successfully.\n",results_sent); return(STATE_OK); } /* multi line plugin output */ else if(mod_gm_opt->message == NULL) { /* get all lines from stdin */ alarm(mod_gm_opt->timeout); mod_gm_opt->message = malloc(GM_BUFFERSIZE); strcpy(buffer,""); size = GM_MAX_OUTPUT; while(size > 0 && fgets(buffer,sizeof(buffer)-1,stdin)){ alarm(0); strncat(mod_gm_opt->message, buffer, size); size -= strlen(buffer); } alarm(0); } return(submit_result()); } /* submit result */ int submit_result() { char * buf; char temp_buffer1[GM_BUFFERSIZE]; char temp_buffer2[GM_BUFFERSIZE]; struct timeval now; struct timeval starttime; struct timeval finishtime; gettimeofday(&now, NULL); if(mod_gm_opt->has_starttime == FALSE) { starttime = now; } else { starttime = mod_gm_opt->starttime; } if(mod_gm_opt->has_finishtime == FALSE) { finishtime = now; } else { finishtime = mod_gm_opt->finishtime; } if(mod_gm_opt->has_latency == FALSE) { mod_gm_opt->latency.tv_sec = 0; mod_gm_opt->latency.tv_usec = 0; } /* escape newline */ buf = gm_escape_newlines(mod_gm_opt->message, GM_DISABLED); free(mod_gm_opt->message); mod_gm_opt->message = strdup(buf); free(buf); gm_log( GM_LOG_TRACE, "queue: %s\n", mod_gm_opt->result_queue ); temp_buffer1[0]='\x0'; snprintf( temp_buffer1, sizeof( temp_buffer1 )-1, "type=%s\nhost_name=%s\nstart_time=%i.%i\nfinish_time=%i.%i\nlatency=%i.%i\nreturn_code=%i\n", mod_gm_opt->active == GM_ENABLED ? "active" : "passive", mod_gm_opt->host, (int)starttime.tv_sec, (int)starttime.tv_usec, (int)finishtime.tv_sec, (int)finishtime.tv_usec, ( int )mod_gm_opt->latency.tv_sec, ( int )mod_gm_opt->latency.tv_usec, mod_gm_opt->return_code ); if(mod_gm_opt->service != NULL) { temp_buffer2[0]='\x0'; strncat(temp_buffer2, "service_description=", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, mod_gm_opt->service, (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, "\n", (sizeof(temp_buffer2)-1)); strncat(temp_buffer1, temp_buffer2, (sizeof(temp_buffer1)-1)); } if(mod_gm_opt->message != NULL) { temp_buffer2[0]='\x0'; strncat(temp_buffer2, "output=", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, mod_gm_opt->message, (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, "\n", (sizeof(temp_buffer2)-1)); strncat(temp_buffer1, temp_buffer2, (sizeof(temp_buffer1)-1)); } strncat(temp_buffer1, "\n", (sizeof(temp_buffer1)-2)); gm_log( GM_LOG_TRACE, "data:\n%s\n", temp_buffer1); if(add_job_to_queue( &client, mod_gm_opt->server_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\n" ); if( mod_gm_opt->dupserver_num ) { if(add_job_to_queue( &client_dup, 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" ); return( STATE_UNKNOWN ); } return( STATE_OK ); } /* called when check runs into timeout */ void alarm_sighandler(int sig) { gm_log( GM_LOG_TRACE, "alarm_sighandler(%i)\n", sig ); printf("got no input after %i seconds! Either send plugin output to stdin or use --message=...\n", mod_gm_opt->timeout); exit( STATE_UNKNOWN ); } /* print version */ void print_version() { printf("send_gearman: version %s running on libgearman %s\n", GM_VERSION, gearman_version()); 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; } mod_gearman-1.4.14/tools/check_gearman.c0000644001161000116100000003424712064652156015057 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /* include header */ #include "check_gearman.h" #include "utils.h" #include "gearman_utils.h" int opt_verbose = 0; int opt_timeout = 10; int opt_job_warning = 10; int opt_job_critical = 100; int opt_worker_warning = 25; int opt_worker_critical = 50; char * opt_queue = NULL; char * opt_send = NULL; char * opt_expect = NULL; char * opt_unique_id = NULL; int send_async = 0; gm_server_t * server_list[GM_LISTSIZE]; int server_list_num = 0; gearman_client_st client; /* work starts here */ int main (int argc, char **argv) { int opt; int result; mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); /* * and parse command line */ while((opt = getopt(argc, argv, "vVhaH:t:w:c:W:C:q:s:e:p:u:")) != -1) { switch(opt) { case 'h': print_usage(); break; case 'v': opt_verbose++; break; case 'V': print_version(); break; case 't': opt_timeout = atoi(optarg); break; case 'w': opt_job_warning = atoi(optarg); break; case 'c': opt_job_critical = atoi(optarg); break; case 'W': opt_worker_warning = atoi(optarg); break; case 'C': opt_worker_critical = atoi(optarg); break; case 'H': add_server(&server_list_num, server_list, optarg); break; case 's': opt_send = optarg; break; case 'a': send_async = 1; break; case 'e': opt_expect = optarg; break; case 'q': opt_queue = optarg; break; case 'u': opt_unique_id = optarg; break; case '?': printf("Error - No such option: `%c'\n\n", optopt); print_usage(); break; } } mod_gm_opt->debug_level = opt_verbose; mod_gm_opt->logmode = GM_LOG_MODE_TOOLS; if(server_list_num == 0) { printf("Error - no hostname given\n\n"); print_usage(); } if(opt_send != NULL && opt_queue == NULL) { printf("Error - need queue (-q) when sending job\n\n"); print_usage(); } /* set alarm signal handler */ signal(SIGALRM, alarm_sighandler); if(opt_send != NULL ) { alarm(opt_timeout); result = check_worker(opt_queue, opt_send, opt_expect); } else { /* get gearman server statistics */ alarm(opt_timeout); result = check_server(server_list[server_list_num-1]->host, server_list[server_list_num-1]->port); } alarm(0); exit( result ); } /* print version */ void print_version() { printf("check_gearman: version %s running on libgearman %s\n", GM_VERSION, gearman_version()); printf("\n"); exit( STATE_UNKNOWN ); } /* print usage */ void print_usage() { printf("usage:\n"); printf("\n"); printf("check_gearman [ -H=[:port] ]\n"); printf(" [ -t= ]\n"); printf(" [ -w= ] default: %i\n", opt_job_warning); printf(" [ -c= ] default: %i\n", opt_job_critical); printf(" [ -W= ] default: %i\n", opt_worker_warning); printf(" [ -C= ] default: %i\n", opt_worker_critical); printf(" [ -q= ]\n"); printf("\n"); printf("\n"); printf("to send a test job:\n"); printf(" [ -u= ] default: check\n"); printf(" [ -s= ]\n"); printf(" [ -e= ]\n"); printf(" [ -a send async ] will ignore -e\n"); printf("\n"); printf(" [ -h print help ]\n"); printf(" [ -v verbose output ]\n"); printf(" [ -V print version ]\n"); printf("\n"); printf(" - You may set thresholds to 0 to disable them.\n"); printf(" - Thresholds are only for server checks, worker checks are availability only\n"); printf("\n"); printf("perfdata format when checking job server:\n"); printf(" 'queue waiting'=current waiting jobs;warn;crit;0 'queue running'=current running jobs 'queue worker'=current num worker;warn;crit;0\n"); printf("\n"); printf("Note: set your pnp RRD_STORAGE_TYPE to MULTIPLE to support changeing numbers of queues.\n"); printf(" see http://docs.pnp4nagios.org/de/pnp-0.6/tpl_custom for detailed information\n"); printf("\n"); printf("perfdata format when checking mod gearman worker:\n"); printf(" worker=10 jobs=1508c\n"); printf("\n"); printf("Note: Job thresholds are per queue not totals.\n"); printf("\n"); printf("Examples:\n"); printf("\n"); printf("Check job server:\n"); printf("\n"); printf("%%>./check_gearman -H localhost -q host\n"); printf("check_gearman OK - 0 jobs running and 0 jobs waiting. Version: 0.14\n"); printf("\n"); printf("Check worker:\n"); printf("\n"); printf("%%> ./check_gearman -H -q worker_ -t 10 -s check\n"); printf("check_gearman OK - host has 5 worker and is working on 0 jobs\n"); printf("\n"); exit( STATE_UNKNOWN ); } /* called when check runs into timeout */ void alarm_sighandler(int sig) { gm_log( GM_LOG_TRACE, "alarm_sighandler(%i)\n", sig ); printf("timeout while waiting for %s:%i\n", server_list[server_list_num-1]->host, server_list[server_list_num-1]->port); exit( STATE_CRITICAL ); } /* check gearman server */ int check_server(char * server, in_port_t port) { mod_gm_server_status_t *stats; int x; char * message = NULL; char * version = NULL; int total_running = 0; int total_waiting = 0; int checked = 0; int rc; char *buf; stats = malloc(sizeof(mod_gm_server_status_t)); rc = get_gearman_server_data(stats, &message, &version, server, port); if( rc == STATE_OK ) { for(x=0; xfunction_num;x++) { if(opt_queue != NULL && strcmp(opt_queue, stats->function[x]->queue)) continue; checked++; total_running += stats->function[x]->running; total_waiting += stats->function[x]->waiting; if(stats->function[x]->waiting > 0 && stats->function[x]->worker == 0) { rc = STATE_CRITICAL; buf = malloc(GM_BUFFERSIZE); snprintf(buf, GM_BUFFERSIZE, "Queue %s has %i job%s without any worker. ", stats->function[x]->queue, stats->function[x]->waiting, stats->function[x]->waiting > 1 ? "s":"" ); strncat(message, buf, GM_BUFFERSIZE); } else if(opt_job_critical > 0 && stats->function[x]->waiting >= opt_job_critical) { rc = STATE_CRITICAL; buf = malloc(GM_BUFFERSIZE); snprintf(buf, GM_BUFFERSIZE, "Queue %s has %i waiting job%s. ", stats->function[x]->queue, stats->function[x]->waiting, stats->function[x]->waiting > 1 ? "s":"" ); strncat(message, buf, GM_BUFFERSIZE); } else if(opt_worker_critical > 0 && stats->function[x]->worker >= opt_worker_critical) { rc = STATE_CRITICAL; buf = malloc(GM_BUFFERSIZE); snprintf(buf, GM_BUFFERSIZE, "Queue %s has %i worker. ", stats->function[x]->queue, stats->function[x]->worker ); strncat(message, buf, GM_BUFFERSIZE); } else if(opt_job_warning > 0 && stats->function[x]->waiting >= opt_job_warning) { rc = STATE_WARNING; buf = malloc(GM_BUFFERSIZE); snprintf(buf, GM_BUFFERSIZE, "Queue %s has %i waiting job%s. ", stats->function[x]->queue, stats->function[x]->waiting, stats->function[x]->waiting > 1 ? "s":"" ); strncat(message, buf, GM_BUFFERSIZE); } else if(opt_worker_warning > 0 && stats->function[x]->worker >= opt_worker_warning) { rc = STATE_WARNING; buf = malloc(GM_BUFFERSIZE); snprintf(buf, GM_BUFFERSIZE, "Queue %s has %i worker. ", stats->function[x]->queue, stats->function[x]->worker ); strncat(message, buf, GM_BUFFERSIZE); } } } if(opt_queue != NULL && checked == 0) { buf = malloc(GM_BUFFERSIZE); snprintf(buf, GM_BUFFERSIZE, "Queue %s not found", opt_queue ); strncat(message, buf, GM_BUFFERSIZE); rc = STATE_WARNING; } /* print plugin name and state */ printf("%s ", PLUGIN_NAME); if(rc == STATE_OK) printf("OK - %i job%s running and %i job%s waiting. Version: %s", total_running, total_running==1?"":"s", total_waiting, total_waiting==1?"":"s", version); if(rc == STATE_WARNING) printf("WARNING - "); if(rc == STATE_CRITICAL) printf("CRITICAL - "); if(rc == STATE_UNKNOWN) printf("UNKNOWN - "); printf("%s", message); /* print performance data */ if(stats->function_num > 0) { printf("|"); for(x=0; xfunction_num;x++) { if(opt_queue != NULL && strcmp(opt_queue, stats->function[x]->queue)) continue; printf( "'%s_waiting'=%i;%i;%i;0 '%s_running'=%i '%s_worker'=%i;%i;%i;0 ", stats->function[x]->queue, stats->function[x]->waiting, opt_job_warning, opt_job_critical, stats->function[x]->queue, stats->function[x]->running, stats->function[x]->queue, stats->function[x]->worker, opt_worker_warning, opt_worker_critical ); } } printf("\n"); free(message); free(version); free_mod_gm_status_server(stats); return( rc ); } /* send job to worker and check result */ int check_worker(char * queue, char * to_send, char * expect) { gearman_return_t ret; char * result; size_t result_size; char * job_handle; const char * unique_job_id; if (opt_unique_id == NULL) { unique_job_id = "check"; } else { unique_job_id = opt_unique_id; } /* create client */ if ( create_client( server_list, &client ) != GM_OK ) { printf("%s UNKNOWN - cannot create gearman client\n", PLUGIN_NAME); return( STATE_UNKNOWN ); } gearman_client_set_timeout(&client, (opt_timeout-1)*1000/server_list_num); while (1) { if (send_async) { result = "sending background job succeded"; job_handle = malloc(GEARMAN_JOB_HANDLE_SIZE * sizeof(char)); ret= gearman_client_do_high_background( &client, queue, unique_job_id, (void *)to_send, (size_t)strlen(to_send), job_handle); free(job_handle); } else { result= (char *)gearman_client_do_high( &client, queue, unique_job_id, (void *)to_send, (size_t)strlen(to_send), &result_size, &ret); } if (ret == GEARMAN_WORK_DATA) { free(result); continue; } else if (ret == GEARMAN_WORK_STATUS) { continue; } else if (ret == GEARMAN_SUCCESS) { gearman_client_free(&client); } else if (ret == GEARMAN_WORK_FAIL) { printf("%s CRITICAL - Job failed\n", PLUGIN_NAME); gearman_client_free(&client); return( STATE_CRITICAL ); } else { printf("%s CRITICAL - Job failed: %s\n", PLUGIN_NAME, gearman_client_error(&client)); gearman_client_free(&client); return( STATE_CRITICAL ); } break; } if( !send_async && expect != NULL && result != NULL ) { if( strstr(result, expect) != NULL) { printf("%s OK - send worker '%s' response: '%s'\n", PLUGIN_NAME, to_send, result); return( STATE_OK ); } else { printf("%s CRITICAL - send worker: '%s' response: '%s', expected '%s'\n", PLUGIN_NAME, to_send, result, expect); return( STATE_CRITICAL ); } } 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; } mod_gearman-1.4.14/tools/gearman_top.c0000644001161000116100000002012212141667303014563 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /* include header */ #include "gearman_top.h" #include "utils.h" #include "gearman_utils.h" int opt_verbose = GM_DISABLED; int opt_quiet = GM_DISABLED; int opt_batch = GM_DISABLED; int con_timeout = 10; double opt_interval = 0; char * server_list[GM_LISTSIZE]; int server_list_num = 0; char * version_saved = NULL; WINDOW *w; void catcher( int ); void catcher( int sig ) { gm_log( GM_LOG_DEBUG, "catcher(%d)\n", sig ); return; } /* work starts here */ int main (int argc, char **argv) { int opt; int i; struct sigaction sact; mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); sigemptyset( &sact.sa_mask ); sact.sa_flags = 0; sact.sa_handler = catcher; sigaction( SIGALRM, &sact, NULL ); /* * and parse command line */ while((opt = getopt(argc, argv, "qvVhH:s:i:b")) != -1) { switch(opt) { case 'h': print_usage(); break; case 'v': opt_verbose++; break; case 'V': print_version(); break; case 's': case 'H': server_list[server_list_num++] = optarg; break; case 'q': opt_quiet = GM_ENABLED; break; case 'i': opt_interval = atof(optarg) * 1000000; break; case 'b': opt_batch = GM_ENABLED; break; case '?': printf("Error - No such option: `%c'\n\n", optopt); print_usage(); break; } } 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; signal(SIGINT, clean_exit); signal(SIGTERM,clean_exit); /* in batch mode, print stats once and exit */ if(opt_batch == GM_ENABLED) { if(opt_interval > 0) { while(1) { for(i=0;i[:port] ]\n"); printf(" [ -i seconds ]\n"); printf(" [ -q quiet mode ]\n"); printf(" [ -b batch mode ]\n"); printf("\n"); printf(" [ -h print help ]\n"); printf(" [ -v verbose output ]\n"); printf(" [ -V print version ]\n"); printf("\n"); exit( EXIT_SUCCESS ); } /* print stats */ void print_stats(char * hostnam) { char * hst = strdup(hostnam); char * hst_c = hst; char * server = NULL; char * port_c = NULL; char * message = NULL; char * version = NULL; char format1[GM_BUFFERSIZE]; char format2[GM_BUFFERSIZE]; char cur_time[GM_BUFFERSIZE]; mod_gm_server_status_t *stats; int port = GM_SERVER_DEFAULT_PORT; int rc; int x; int max_length = 12; int found = 0; struct tm now; time_t t; gm_log( GM_LOG_DEBUG, "print_stats()\n"); server = strsep(&hst, ":"); port_c = strsep(&hst, "\x0"); if(port_c != NULL) port = atoi(port_c); /* get stats */ stats = malloc(sizeof(mod_gm_server_status_t)); stats->function_num = 0; stats->worker_num = 0; rc = get_gearman_server_data(stats, &message, &version, server, port); t = time(NULL); now = *(localtime(&t)); strftime(cur_time, sizeof(cur_time), "%Y-%m-%d %H:%M:%S", &now ); my_printf("%s - %s:%i", cur_time, server, port ); if(version != NULL && strcmp(version, "") != 0) { if(version_saved != NULL) free(version_saved); version_saved = strdup(version); } if(version_saved != NULL && strcmp(version_saved, "") != 0) my_printf(" - v%s", version_saved ); my_printf("\n\n"); if( rc == STATE_OK ) { for(x=0; xfunction_num;x++) { if(opt_quiet == GM_ENABLED && stats->function[x]->worker == 0 && stats->function[x]->total == 0) continue; if((int)strlen(stats->function[x]->queue) > max_length) { max_length = (int)strlen(stats->function[x]->queue); } } snprintf(format1, sizeof(format1), " %%-%is | %%16s | %%12s | %%12s\n", max_length); snprintf(format2, sizeof(format2), " %%-%is |%%16i |%%12i |%%12i \n", max_length); my_printf(format1, "Queue Name", "Worker Available", "Jobs Waiting", "Jobs Running"); for(x=0; x < max_length + 51; x++) my_printf("-"); my_printf("\n"); for(x=0; xfunction_num;x++) { if(opt_quiet == GM_ENABLED && stats->function[x]->worker == 0 && stats->function[x]->total == 0) continue; my_printf(format2, stats->function[x]->queue, stats->function[x]->worker, stats->function[x]->waiting, stats->function[x]->running); found++; } if(found == 0) { for(x=0; x < max_length + 25; x++) { my_printf(" "); } my_printf("no queues found\n"); } for(x=0; x < max_length + 51; x++) my_printf("-"); my_printf("\n"); } else { my_printf(" %s\n", message); } refresh(); free(hst_c); free(message); free(version); free_mod_gm_status_server(stats); return; } /* print curses or normal depending on batch mode setting */ void my_printf(const char *fmt, ...) { va_list ap; va_start( ap, fmt ); if(opt_batch == GM_ENABLED) { vprintf(fmt, ap); } else { vw_printw(w, fmt, ap); } va_end( ap ); return; } /* core log wrapper */ void write_core_log(char *data) { printf("core logger is not available for tools: %s", data); return; } mod_gearman-1.4.14/tools/send_multi.c0000644001161000116100000004420312213031442014425 00000000000000/****************************************************************************** * * mod_gearman - distribute checks with gearman * * Copyright (c) 2010 Sven Nierlein - sven.nierlein@consol.de * Copyright (c) 2010 Matthias Flacke - matthias.flacke@gmx.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 . * *****************************************************************************/ /* include header */ #include "send_multi.h" #include "utils.h" #include "gearman_utils.h" gearman_client_st client; gearman_client_st client_dup; /* work starts here */ int main (int argc, char **argv) { int rc; /* * allocate options structure * and parse command line */ if(parse_arguments(argc, argv) != GM_OK) { print_usage(); exit( STATE_UNKNOWN ); } /* 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); } else { mod_gm_opt->transportmode = GM_ENCODE_ONLY; } /* create client */ if ( create_client( mod_gm_opt->server_list, &client ) != GM_OK ) { printf( "send_multi UNKNOWN: cannot start client\n" ); exit( STATE_UNKNOWN ); } /* create duplicate client */ if ( create_client_dup( mod_gm_opt->dupserver_list, &client_dup ) != GM_OK ) { printf( "send_multi UNKNOWN: cannot start client for duplicate server\n" ); exit( STATE_UNKNOWN ); } /* send result message */ signal(SIGALRM, alarm_sighandler); rc = read_multi_stream(stdin); /* if rc > 0, it contains the number of checks being submitted, otherwise its an error code (-1 - WARNING, -2 - CRITICAL, -3 - UNKNOWN) */ if (rc == 0) { printf( "send_multi UNKNOWN: %d check_multi child checks submitted\n", rc ); rc=STATE_UNKNOWN; } else if (rc > 0) { printf( "send_multi OK: %d check_multi child check%s submitted\n", rc, (rc>1)?"s":"" ); rc=STATE_OK; } else { rc*=-1; } gearman_client_free( &client ); if( mod_gm_opt->dupserver_num ) gearman_client_free( &client_dup ); mod_gm_free_opt(mod_gm_opt); exit( rc ); } /* parse command line arguments */ int parse_arguments(int argc, char **argv) { int i; int verify; int errors = 0; mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); /* special default: encryption disabled */ mod_gm_opt->encryption = GM_DISABLED; for(i=1;ikeyfile != NULL && read_keyfile(mod_gm_opt) != GM_OK) { errors++; } if(errors > 0 || verify != GM_OK) { return(GM_ERROR); } return(GM_OK); } /* verify our option */ int verify_options(mod_gm_opt_t *opt) { /* no server specified? then default to localhost */ if(opt->server_num == 0) { add_server(&opt->server_num, opt->server_list, "localhost"); } /* host is mandatory */ if(opt->host == NULL) { printf("got no hostname, please use --host=...\n" ); return(GM_ERROR); } /* encryption without key? */ if(opt->encryption == GM_ENABLED) { if(opt->crypt_key == NULL && opt->keyfile == NULL) { printf("no encryption key provided, please use --key=... or keyfile=... or disable encryption\n"); return(GM_ERROR); } } if ( mod_gm_opt->result_queue == NULL ) mod_gm_opt->result_queue = GM_DEFAULT_RESULT_QUEUE; return(GM_OK); } /* print usage */ void print_usage() { printf("usage:\n"); printf("\n"); printf("send_multi [ --debug= ]\n"); printf(" [ --help|-h ]\n"); printf("\n"); printf(" [ --config= ]\n"); printf("\n"); printf(" [ --server= ]\n"); printf(" default:localhost \n"); printf("\n"); printf(" [ --encryption= ]\n"); printf(" default:no \n"); printf(" [ --key= ]\n"); printf(" [ --keyfile= ]\n"); printf("\n"); printf(" [ --host= ]\n"); printf(" [ --result_queue= ]\n"); printf(" default:check_results \n"); printf(" [ --timeout= ]\n"); printf("\n"); printf("For details see\n"); printf("http://my-plugin.de/wiki/projects/check_multi/feed_passive\n"); printf("\n"); exit( STATE_UNKNOWN ); } /* send message to job server */ int send_result() { char * buf; char temp_buffer1[GM_BUFFERSIZE]; char temp_buffer2[GM_BUFFERSIZE]; gm_log( GM_LOG_TRACE, "send_result()\n" ); if(mod_gm_opt->result_queue == NULL) { printf( "got no result queue, please use --result_queue=...\n" ); return(GM_ERROR); } /* escape newline */ buf = gm_escape_newlines(mod_gm_opt->message, GM_DISABLED); free(mod_gm_opt->message); mod_gm_opt->message = malloc(GM_BUFFERSIZE); snprintf(mod_gm_opt->message, GM_BUFFERSIZE, "%s", buf); free(buf); gm_log( GM_LOG_TRACE, "queue: %s\n", mod_gm_opt->result_queue ); temp_buffer1[0]='\x0'; snprintf( temp_buffer1, sizeof( temp_buffer1 )-1, "type=%s\nhost_name=%s\nstart_time=%i.%i\nfinish_time=%i.%i\nreturn_code=%i\n", mod_gm_opt->active == GM_ENABLED ? "active" : "passive", mod_gm_opt->host, (int)mod_gm_opt->starttime.tv_sec, (int)mod_gm_opt->starttime.tv_usec, (int)mod_gm_opt->finishtime.tv_sec, (int)mod_gm_opt->finishtime.tv_usec, mod_gm_opt->return_code ); if(mod_gm_opt->service != NULL) { temp_buffer2[0]='\x0'; strncat(temp_buffer2, "service_description=", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, mod_gm_opt->service, (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, "\n", (sizeof(temp_buffer2)-1)); strncat(temp_buffer1, temp_buffer2, (sizeof(temp_buffer1)-1)); } if(mod_gm_opt->message != NULL) { temp_buffer2[0]='\x0'; strncat(temp_buffer2, "output=", (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, mod_gm_opt->message, (sizeof(temp_buffer2)-1)); strncat(temp_buffer2, "\n", (sizeof(temp_buffer2)-1)); strncat(temp_buffer1, temp_buffer2, (sizeof(temp_buffer1)-1)); } strncat(temp_buffer1, "\n", (sizeof(temp_buffer1)-2)); gm_log( GM_LOG_TRACE, "data:\n%s\n", temp_buffer1); if(add_job_to_queue( &client, mod_gm_opt->server_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\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" ); return(GM_ERROR); } return(GM_OK); } /* called when check runs into timeout */ void alarm_sighandler(int sig) { gm_log( GM_LOG_TRACE, "alarm_sighandler(%i)\n", sig ); printf("Timeout after %d seconds - got no input! Send plugin output to stdin.\n", mod_gm_opt->timeout); exit( STATE_CRITICAL ); } /* print version */ void print_version() { printf("send_gearman: version %s running on libgearman %s\n", GM_VERSION, gearman_version()); printf("\n"); exit( STATE_UNKNOWN ); } int read_multi_stream(FILE *stream) { char buffer[GM_BUFFERSIZE+1]; unsigned long buflen=0L; unsigned long bytes_read=0L; char *bufstart=NULL; char *bufend=NULL; int count=0; struct timeval end_time; gettimeofday(&end_time, NULL); do { /* opening tag found? read from buffer start with maximum buffer len */ if ((bufstart=(char *)memmem(buffer,buflen,"",strlen(""))) != NULL) { /* closing tag found? read after with rest of buffer len */ if ((bufend=(char *)memmem(bufstart,buflen-(bufstart-buffer),"",strlen(""))) != NULL) { gm_log( GM_LOG_TRACE, "\tXML chunk %d found: buffer position %3d-%3d length %d bytes\n", count, bufstart-buffer, bufend-buffer, bufend-bufstart); /* count valid chunks */ count++; /* identify CHILD chunk */ bufstart+=strlen(""); /* if valid check_multi chunk found, send the result*/ if (read_child_check(bufstart,bufend,&end_time)) { if (send_result() == GM_ERROR) { count--; } } else { count--; } /* shift input rest to buffer start, create space for subsequent reads */ memmove(buffer,bufend+strlen(""),buflen-(bufend+strlen("")-buffer)); buflen-=bufend+strlen("")-buffer; /* start tag found, but no closing tag , buffer too small? */ } else { buflen=0L; printf("send_multi UNKNOWN: no closing tag within buffer, buffer size too small? discarding buffer, %ld bytes now\n", buflen); return -STATE_UNKNOWN; } gm_log( GM_LOG_TRACE, "\tbuflen after XML chunk parsing:%ld\n", buflen); /* neither nor found, discard buffer */ } else { /* no chunks found? then check for message in STDIN */ if (!count) { unsigned long i; /* check buffer for ASCII characters */ for (i=0; i within buffer - discarding buffer, buflen now %ld bytes\n", buflen); } gm_log( GM_LOG_TRACE, "\ttrying to fill up buffer with %ld bytes from offset %ld\n", GM_BUFFERSIZE-buflen, buflen); /* read one block of data, or less bytes, if there is still data left */ alarm(mod_gm_opt->timeout); if ((bytes_read=fread(buffer+buflen, 1, GM_BUFFERSIZE-buflen, stream)) == 0L) { /* break if zero read was caused by an error */ if (!feof(stream)) { perror("fread"); return -STATE_CRITICAL; } } else { /* adjust block len */ buflen+=bytes_read; } gm_log( GM_LOG_TRACE, "\tread %ld bytes, %ld bytes remaining in buffer\n", bytes_read, buflen); } while (buflen > 0); return count; } int read_child_check(char *bufstart, char *bufend, struct timeval * end_time) { char *attribute = NULL; char *attribute2 = NULL; char *attribute3 = NULL; char *error = NULL; char temp_buffer[GM_BUFFERSIZE]; double end_time_d; struct timeval start_time; /* child check number */ if ((attribute=read_multi_attribute(bufstart,bufend,"no")) == NULL) { return 0; } else { /* skip parent check */ if (!strcmp(attribute,"0")) { return 0; } gm_log( GM_LOG_TRACE, "child check: %d\n", atoi(attribute)); } /* service description */ if ((attribute=read_multi_attribute(bufstart,bufend,"name")) == NULL) return 0; mod_gm_opt->service=strdup(attribute); gm_log( GM_LOG_TRACE, "service_description: %s\n", mod_gm_opt->service); /* return code */ if ((attribute=read_multi_attribute(bufstart,bufend,"rc")) == NULL) return 0; mod_gm_opt->return_code=atoi(attribute); gm_log( GM_LOG_TRACE, "mod_gm_opt->return_code: %d\n", mod_gm_opt->return_code); /* runtime */ if ((attribute=read_multi_attribute(bufstart,bufend,"runtime")) == NULL) return 0; end_time_d = timeval2double(end_time); double2timeval(end_time_d - atof(attribute), &start_time); mod_gm_opt->starttime.tv_sec = start_time.tv_sec; mod_gm_opt->starttime.tv_usec = start_time.tv_usec; gm_log( GM_LOG_TRACE, "starttime: %d.%d\n", mod_gm_opt->starttime.tv_sec, mod_gm_opt->starttime.tv_usec); /* end time is the execution time of send_multi itself */ mod_gm_opt->finishtime.tv_sec = end_time->tv_sec; mod_gm_opt->finishtime.tv_usec = end_time->tv_usec; gm_log( GM_LOG_TRACE, "endtime: %d.%d\n", mod_gm_opt->finishtime.tv_sec, mod_gm_opt->finishtime.tv_usec); /* message */ if ((attribute=read_multi_attribute(bufstart,bufend,"output")) == NULL) return 0; /* stderr */ if ((error=read_multi_attribute(bufstart,bufend,"error")) == NULL) { return 0; /* if error found: 'error' -> ' [error]' */ } else if (*error) { *(--error)='['; *(--error)=' '; strcat(error,"]"); } /* performance data with multi headers */ if ((attribute2=read_multi_attribute(bufstart,bufend,"performance")) == NULL) { snprintf( temp_buffer, sizeof( temp_buffer )-1, "%s%s", decode_xml(attribute), decode_xml(error)); } else if ((attribute3=read_multi_attribute(bufstart,bufend,"pplugin")) == NULL) { return 0; } else { attribute2 = trim(attribute2); attribute2 = decode_xml(attribute2); /* do we have a single quote performance label? then single quote the whole multi header */ if (*attribute2 == '\'') { attribute2++; snprintf( temp_buffer, sizeof( temp_buffer )-1, "%s%s|\'%s::%s::%s", decode_xml(attribute), decode_xml(error), mod_gm_opt->service, decode_xml(attribute3), decode_xml(attribute2)); /* normal header without single quotes */ } else { snprintf( temp_buffer, sizeof( temp_buffer )-1, "%s%s|%s::%s::%s", decode_xml(attribute), decode_xml(error), mod_gm_opt->service, decode_xml(attribute3), decode_xml(attribute2)); } } mod_gm_opt->message=strdup(temp_buffer); gm_log( GM_LOG_TRACE, "mod_gm_opt->message: %s\n", mod_gm_opt->message); return 1; } char *read_multi_attribute(char *bufstart, char *bufend, char *element) { char start_element[GM_BUFFERSIZE], end_element[GM_BUFFERSIZE]; sprintf(start_element, "<%s>", element); sprintf(end_element, "", element); if ((bufstart=(char *)memmem(bufstart,bufend-bufstart,start_element,strlen(start_element))) == NULL) { gm_log( GM_LOG_TRACE, "\tread_multi_attribute: start element \'%s\' not found\n", start_element); return NULL; } bufstart+=strlen(start_element); if ((bufend=(char *)memmem(bufstart,bufend-bufstart,end_element,strlen(end_element))) == NULL) { gm_log( GM_LOG_TRACE, "\tread_multi_attribute: end element \'%s\' not found\n", end_element); return NULL; } *bufend='\0'; return bufstart; } char *decode_xml(char *string) { struct decode{ char c; char *enc_string; } dtab[] = { { '>', ">" }, { '<', "<" }, { '&', "&" }, { '\'', "'" }, { '|', "|" }, }; int i; char *found; /* foreach XML decode pair */ for (i=0; i<(int)(sizeof(dtab)/sizeof(struct decode)); i++) { /* while XML encoding strings found */ while ((found=strstr(string, dtab[i].enc_string)) != NULL) { /* replace string with character */ *found=dtab[i].c; /* shift rest of string after character */ strcpy(found+1, found+strlen(dtab[i].enc_string)); } } return string; } /* core log wrapper */ void write_core_log(char *data) { printf("core logger is not available for tools: %s", data); return; } mod_gearman-1.4.14/support/0000755001161000116100000000000012241511662012557 500000000000000mod_gearman-1.4.14/support/mod_gearman.spec0000644001161000116100000000701712241503656015635 00000000000000Name: mod_gearman Version: 1.4.14 Release: 1%{?dist} License: GNU Public License version 2 Packager: Sven Nierlein Vendor: Labs Consol URL: http://labs.consol.de/nagios/mod-gearman/ Source0: mod_gearman-%{version}.tar.gz Group: Applications/Monitoring BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) BuildRequires: autoconf, automake, ncurses-devel BuildRequires: libtool, libtool-ltdl-devel, libevent-devel BuildRequires: gearmand-devel Summary: Gearman module for Nagios Requires(pre,post): /sbin/ldconfig Requires(pre): shadow-utils Requires: gearmand, perl, logrotate Provides: mod_gearman %description Mod Gearman is a new way of distributing active Nagios (and compatible cores) checks across your network. It consists of two parts: There is a NEB module which resides in the Nagios core and adds servicechecks, hostchecks and eventhandler to a Gearman queue. There can be multiple equal gearman servers. The counterpart is one or more worker clients for the checks itself. They can be bound to host and servicegroups. %prep %setup -q [ -f ./configure ] || ./autogen.sh %build %configure \ --datadir="%{_datadir}" \ --datarootdir="%{_datadir}" \ --localstatedir="%{_localstatedir}" \ --sysconfdir="%{_sysconfdir}" \ --with-init-dir="%{_initrddir}" \ --enable-embedded-perl %{__make} %{_smp_mflags} %install %{__rm} -rf %{buildroot} %{__make} install \ install-config \ DESTDIR="%{buildroot}" \ AM_INSTALL_PROGRAM_FLAGS="" # remove custom gearmand initscript %{__rm} -f %{buildroot}/%{_initrddir}/gearmand %pre getent group nagios >/dev/null || groupadd -r nagios getent passwd nagios >/dev/null || \ useradd -r -g nagios -d %{_localstatedir}/mod_gearman -s /sbin/nologin \ -c "nagios user" nagios exit 0 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %clean %{__rm} -rf %{buildroot} %files %attr(755,root,root) %{_initrddir}/mod_gearman_worker %config(noreplace) %{_sysconfdir}/mod_gearman/mod_gearman_neb.conf %config(noreplace) %{_sysconfdir}/mod_gearman/mod_gearman_worker.conf %config(noreplace) %{_sysconfdir}/logrotate.d/mod_gearman %{_datadir}/mod_gearman/standalone_worker.conf %{_datadir}/mod_gearman/shared.conf %{_datadir}/mod_gearman/mod_gearman_p1.pl %{_datadir}/mod_gearman/gearman_proxy.pl %{_bindir}/check_gearman %{_bindir}/gearman_top %{_bindir}/mod_gearman_worker %{_bindir}/send_gearman %{_bindir}/send_multi %{_bindir}/mod_gearman_mini_epn %{_libdir}/mod_gearman/mod_gearman.o %attr(755,nagios,root) %{_localstatedir}/mod_gearman %attr(755,nagios,root) %{_localstatedir}/log/mod_gearman %defattr(-,root,root) %docdir %{_defaultdocdir} %changelog * Thu Oct 31 2013 Sven Nierlein - added mini_epn * Mon Nov 19 2012 Ricardo Maraschini - added logrotate configuration file * Fri Apr 06 2012 Sven Nierlein - added gearman_proxy to package * Thu Jan 19 2012 Sven Nierlein - enabled embedded Perl * Mon Jun 06 2011 Michael Friedrich - reworked spec file to fit fhs compliance in /etc/mod_gearman - moved extras/*conf from localestatedir to sysconfdir - added config noreplace to config targets - removed custom gearmand init script, interferes with gearmand dependency on rhel * Fri Feb 11 2011 Sven Nierlein - Adapted spec file for SLES11 * Wed Oct 13 2010 Olivier Raginel - First build, on Scientific Linux CERN 5.5 mod_gearman-1.4.14/depcomp0000755001161000116100000004426712005170750012352 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program 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 2, or (at your option) # any later version. # This program 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 this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mod_gearman-1.4.14/configure0000755001161000116100000062023412241504051012673 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67 for mod_gearman 1.4.14. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: sven.nierlein@consol.de about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS 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. 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 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mod_gearman' PACKAGE_TARNAME='mod_gearman' PACKAGE_VERSION='1.4.14' PACKAGE_STRING='mod_gearman 1.4.14' PACKAGE_BUGREPORT='sven.nierlein@consol.de' PACKAGE_URL='' ac_unique_file="neb_module/mod_gearman.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LN_S USEBSD_FALSE USEBSD_TRUE PERLLIBS USEPERL_FALSE USEPERL_TRUE user initrddir LIBOBJS EGREP GREP CPP RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_debug enable_dependency_tracking with_gearman with_init_dir with_user enable_embedded_perl ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) 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" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) 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" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) 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" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) 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" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --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" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # 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'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` 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" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac 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' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. 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 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null 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" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no 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" 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" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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.4.14 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --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 --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 --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/mod_gearman] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of mod_gearman 1.4.14:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug will enable debugging symbols --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-embedded-perl will enable embedded Perl interpreter Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gearman=DIR Specify the path to your gearman library --with-init-dir specify the system init script directory [default="${sysconfdir}/init.d"] --with-user specify the user [default="nagios"] Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF mod_gearman configure 1.4.14 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. 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 : { $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 : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&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;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $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 "## -------------------------------------- ## ## Report this to sven.nierlein@consol.de ## ## -------------------------------------- ##" ) | 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 : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { 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 : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { 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 : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { 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 : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func cat >config.log <<_ACEOF 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.4.14, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. 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 elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $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 ; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $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 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' 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 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 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) 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 ;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # 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 alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else 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 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $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 : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # 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;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." 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 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='mod_gearman' VERSION='1.4.14' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" CFLAGS="-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -O -fPIC -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64" ############################################## # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; CFLAGS="${CFLAGS} -pedantic -Wfatal-errors -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -g3" else CFLAGS="${CFLAGS} -s" fi ############################################## # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $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 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done 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 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes 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. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $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 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi 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 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } 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 : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ############################################## # gearman wants this { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 ; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done 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 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done 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 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : 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 : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork 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 : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if test "${ac_cv_func_fork_works+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if test "${ac_cv_func_vfork_works+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi ############################################## # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" fi ############################################## # Checks for header files. for ac_header in stdlib.h string.h unistd.h pthread.h arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h sys/socket.h sys/time.h sys/timeb.h syslog.h 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 : 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 fi done for ac_header in ltdl.h do : ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default" if test "x$ac_cv_header_ltdl_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LTDL_H 1 _ACEOF else as_fn_error $? "Compiling Mod-Gearman requires ltdl.h" "$LINENO" 5 fi done for ac_header in curses.h do : ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CURSES_H 1 _ACEOF else as_fn_error $? "Compiling Mod-Gearman requires curses.h" "$LINENO" 5 fi done # Check whether --with-gearman was given. if test "${with_gearman+set}" = set; then : withval=$with_gearman; found=0 libgm_1_0=0 for d in libgearman/.libs lib .; do test -e "$withval/$d/libgearman.so" && LDFLAGS="${LDFLAGS} -L$withval/$d" && CFLAGS="${CFLAGS} -L$withval/$d" && found=1 && break; done test $found -eq 1 || { echo 'did not find libgearman.so under your specified path!' && exit 1; } found=0 for d in libgearman-1.0 include .; do test -e "$withval/$d/libgearman-1.0/gearman.h" && CFLAGS="${CFLAGS} -I$withval/$d" && found=1 && libgm_1_0=1 && break; test -e "$withval/$d/libgearman/gearman.h" && CFLAGS="${CFLAGS} -I$withval/$d" && found=1 && break; done test $found -eq 1 || { echo 'did not find gearman.h under your specified path!' && exit 1; } test $libgm_1_0 -eq 1 && { cat >>confdefs.h <<_ACEOF #define LIBGEARMAN_1_0 /**/ _ACEOF } fi ############################################## # Checks for additional libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gearman_client_create in -lgearman" >&5 $as_echo_n "checking for gearman_client_create in -lgearman... " >&6; } if test "${ac_cv_lib_gearman_gearman_client_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgearman $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gearman_client_create (); int main () { return gearman_client_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gearman_gearman_client_create=yes else ac_cv_lib_gearman_gearman_client_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gearman_gearman_client_create" >&5 $as_echo "$ac_cv_lib_gearman_gearman_client_create" >&6; } if test "x$ac_cv_lib_gearman_gearman_client_create" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEARMAN 1 _ACEOF LIBS="-lgearman $LIBS" else as_fn_error $? "Compiling Mod-Gearman requires libgearman. You may specify the path by --with-gearman=path..." "$LINENO" 5 fi ############################################## # Determine the system init.d directory # Check whether --with-init-dir was given. if test "${with_init_dir+set}" = set; then : withval=$with_init_dir; else with_init_dir="${sysconfdir}/init.d" fi initrddir="$with_init_dir" ############################################## # Determine the user # Check whether --with-user was given. if test "${with_user+set}" = set; then : withval=$with_user; else with_user="nagios" fi user="$with_user" ############################################## USEPERL=no; # Check whether --enable-embedded-perl was given. if test "${enable_embedded_perl+set}" = set; then : enableval=$enable_embedded_perl; USEPERL=$enableval else USEPERL=no fi if test "$USEPERL" = "yes"; then USEPERL_TRUE= USEPERL_FALSE='#' else USEPERL_TRUE='#' USEPERL_FALSE= fi if test "$USEPERL" = "yes"; then tmp=$LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl_alloc in -lperl" >&5 $as_echo_n "checking for perl_alloc in -lperl... " >&6; } if test "${ac_cv_lib_perl_perl_alloc+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lperl `perl -MExtUtils::Embed -e ccopts -e ldopts` $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char perl_alloc (); int main () { return perl_alloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_perl_perl_alloc=yes else ac_cv_lib_perl_perl_alloc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perl_perl_alloc" >&5 $as_echo "$ac_cv_lib_perl_perl_alloc" >&6; } if test "x$ac_cv_lib_perl_perl_alloc" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPERL 1 _ACEOF LIBS="-lperl $LIBS" else as_fn_error $? "Compiling Mod-Gearman with embedded Perl requires libperl." "$LINENO" 5 fi # save libs, as we do not want to add -lperl to all LIBS LIBS=$tmp cat >>confdefs.h <<_ACEOF #define EMBEDDEDPERL /**/ _ACEOF echo "creating common/perlxsi.c" perl -MExtUtils::Embed -e xsinit -- -o common/perlxsi.c echo "Embedded Perl interpreter will be compiled in..." PERLLIBS="`perl -MExtUtils::Embed -e ccopts -e ldopts | tr -d '\n'`" fi ############################################## if test "$(uname)" = "FreeBSD"; then USEBSD_TRUE= USEBSD_FALSE='#' else USEBSD_TRUE='#' USEBSD_FALSE= fi ############################################## # Check some functions 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 : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi ############################################## # Checks for typedefs, structures, and compiler characteristics. ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ############################################## # add a "make install" target ############################################## # write out files ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H 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$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then 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. 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. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEPERL_TRUE}" && test -z "${USEPERL_FALSE}"; then as_fn_error $? "conditional \"USEPERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEBSD_TRUE}" && test -z "${USEBSD_FALSE}"; then as_fn_error $? "conditional \"USEBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS 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. 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 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # 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.4.14, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF 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.4.14 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: 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 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $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;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || 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. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && 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 '^'` 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 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 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || 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 # 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/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "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'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $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 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 $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;} 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 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $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 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 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false 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 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 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi mod_gearman-1.4.14/aclocal.m40000644001161000116100000010602712241504045012626 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. 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. 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'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # 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". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR mod_gearman-1.4.14/docs/0000755001161000116100000000000012241511662011773 500000000000000mod_gearman-1.4.14/docs/README.html0000644001161000116100000022273712241503673013556 00000000000000 Nagios Gearman Module

What is Mod-Gearman

Mod_Gearman is an easy way of distributing active Nagios checks across your network and increasing Nagios scalability. Mod-Gearman can even help to reduce the load on a single Nagios host, because its much smaller and more efficient in executing checks.

It consists of three parts:

  • There is a NEB module which resides in the Nagios core and adds servicechecks, hostchecks and eventhandler to a Gearman queue.

  • The counterpart is one or more worker clients executing the checks. Worker can be configured to only run checks for specific host- or servicegroups.

  • And you need at least one Gearman Job Server running.

  • See the common scenarios for some examples.

Presentations

Features

  • Reduce load of your central Nagios machine

  • Make Nagios scalable up to thousands of checks per second

  • Easy distributed setups without configuration overhead

  • Real loadbalancing across all workers

  • Real failover for redundant workers

  • Embedded Perl support for very fast execution of perl scripts

  • Fast transport of passive check results with included tools like send_gearman and send_multi

Download

Support

Changelog

The changelog is available on github.

How does it work

When the Mod-Gearman broker module is loaded, it intercepts all servicechecks, hostchecks and the eventhandler events. Eventhandler are then sent to a generic eventhandler queue. Checks for hosts which are in one of the specified hostgroups, are sent into a seperate hostgroup queue. All non matching hosts are sent to a generic hosts queue. Checks for services are first checked against the list of servicegroups, then against the hostgroups and if none matches they will be sent into a generic service queue. The NEB module starts a single thread, which monitors the check_results where all results come in.

mod_gearman architecture

A simple example queue would look like:

+---------------+------------------+--------------+--------------+
| Queue Name    | Worker Available | Jobs Waiting | Jobs Running |
+---------------+------------------+--------------+--------------+
| check_results | 1                | 0            | 0            |
| eventhandler  | 50               | 0            | 0            |
| host          | 50               | 0            | 1            |
| service       | 50               | 0            | 13           |
+---------------+------------------+--------------+--------------+

There is one queue for the results and two for the checks plus the eventhandler queue.

The workflow is simple:

  1. Nagios wants to execute a service check.

  2. The check is intercepted by the Mod-Gearman neb module.

  3. Mod-Gearman puts the job into the service queue.

  4. A worker grabs the job and puts back the result into the check_results queue

  5. Mod-Gearman grabs the result job and puts back the result onto the check result list

  6. The Nagios reaper reads all checks from the result list and updates hosts and services

You can set some host or servicegroups for special worker. This example uses a seperate hostgroup for Japan and a seperate servicegroup for resource intensive selenium checks.

It would look like this:

+-----------------------+------------------+--------------+--------------+
| Queue Name            | Worker Available | Jobs Waiting | Jobs Running |
+-----------------------+------------------+--------------+--------------+
| check_results         | 1                | 0            | 0            |
| eventhandler          | 50               | 0            | 0            |
| host                  | 50               | 0            | 1            |
| hostgroup_japan       | 3                | 1            | 3            |
| service               | 50               | 0            | 13           |
| servicegroup_selenium | 2                | 0            | 2            |
+-----------------------+------------------+--------------+--------------+

You still have the generic queues and in addition there are two queues for the specific groups.

The worker processes will take jobs from the queues and put the result back into the check_result queue which will then be taken back by the neb module and put back into the Nagios core. A worker can work on one or more queues. So you could start a worker which only handles the hostgroup_japan group. One worker for the selenium checks and one worker which covers the other queues. There can be more than one worker on each queue to share the load.

mod_gearman architecture

Common Scenarios

Load Balancing

Load Balancing

The easiest variant is a simple load balancing. For example if your single Nagios box just cannot handle the load, you could just add a worker in the same network (or even on the same host) to reduce your load on the Nagios box. Therefor we just enable hosts, services and eventhandler on the server and the worker.

Pro:

  • reduced load on your monitoring box

Contra:

  • no failover

Distributed Monitoring

Distributed Monitoring

If your checks have to be run from different network segments, then you can use the hostgroups (or servicegroups) to define a hostgroup for specific worker. The general hosts and services queue is disabled for this worker and just the hosts and services from the given hostgroup will be processed.

Pro:

  • reduced load on your monitoring box

  • ability to access remote networks

Contra:

  • no failover

Distributed Monitoring with Load Balancing

Distributed Monitoring with Load Balancing

Your distributed setup could easily be extended to a load balanced setup with just adding more worker of the same config.

Pro:

  • reduced load on your monitoring box

  • ability to access remote networks

  • automatic failover and load balancing for worker

Contra:

  • no failover for the master

NSCA Replacement

NSCA Replacement

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 or use the accept_clear_results option.

Pro:

  • easy to setup in existing environments

Distributed Setup With Remote Scheduler

Distributed Setup With Remote Scheduler

In case your network is unstable or you need a gui view from the remote location or any other reason which makes a remote core unavoidable you may want this setup. Thist setup consists of 2 independent Mod-Gearman setups and the slave worker just send their results to the master via the dup_server option. The master objects configuration must contain all slave services and hosts. The configuration sync is not part of Mod-Gearman.

Pro:

  • independent from network outtakes

  • local view

Contra:

  • more complex setup

  • requires configuration sync

Gearman Proxy

Gearman Proxy

Sometimes you may need to reverse the direction of the initial connection attempt. Usually the worker and the neb module open the initial connection so they need to access the gearmand port. In cases where no direct connection is possible use ssh tunnel or the Gearman proxy. The Gearman proxy just puts jobs from one gearmand into another gearmand and vice versa.

Just copy the gearman_proxy.pl from the contrib or share directory and adjust the first few lines to match you needs.

Pro:

  • changes direction of initial connection setup

  • buffers network outages

Contra:

  • two more daemon to monitor and maintain

Installation

OMD

Using OMD is propably the easiest way of installing and using Mod-Gearman. You just have to run omd config or set Mod-Gearman to on.

OMD is available for Debian, Ubuntu, Centos/Redhat and SLES.

OMD[test]:~$ omd config set MOD_GEARMAN on
Note
Mod-Gearman is included in OMD since version 0.48.

Debian / Ubuntu

It is strongly recommended to use the official packages or the unoffical packages which contains Debian Squeeze and various Ubuntu packages.

Centos/Redhat

The easy and proper way is to build RPM packages. The following steps assume a Centos 5.7. Other releases may have different versions but should behave similar.

Note
use the prebuild packages if available.

Build/install Gearmand rpms

#> yum install autoconf automake libtool boost141-devel boost141-program-options
#> cd /tmp
#> wget http://launchpad.net/gearmand/trunk/0.33/+download/gearmand-0.33.tar.gz
#> tar zxf gearmand-0.33.tar.gz
#> ln -s gearmand-0.33/support/gearmand.init /tmp/gearmand.init
#> vi gearmand-0.33/support/gearmand.spec
   change in line 9 and 25:
   Requires: sqlite, libevent >= 1.4, boost-program-options >=  1.39
   in
   Requires: sqlite, libevent >= 1.4, boost141-program-options >=  1.39
#> tar cfz gearmand-0.33.tar.gz gearmand-0.33
#> LIBRARY_PATH=/usr/lib64/boost141:/usr/lib/boost141 \
   LD_LIBRARY_PATH=/usr/lib64/boost141:/usr/lib/boost141 \
   CPATH=/usr/include/boost141 \
   rpmbuild -tb gearmand-0.33.tar.gz
#> yum --nogpgcheck install /usr/src/redhat/RPMS/*/gearmand*-0.33-1*.rpm
Note
The link to gearmand.init is a workaround, otherwise the build will fail. It may not be necessary for future gearman versions.

Build/install Mod-Gearman rpms

#> wget http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.2.0.tar.gz
#> rpmbuild -tb mod_gearman-1.2.0.tar.gz
#> yum --nogpgcheck install /usr/src/redhat/RPMS/*/mod_gearman-1.2.0-1.*.rpm

Finally start and check your installation

#> /etc/init.d/gearmand start
#> /etc/init.d/mod_gearman_worker start
#> gearman_top

From Source

Note
source installation should be avoided if possible. Prebuild packages are way easier to maintain.

Pre Requirements:

  • gcc / g++

  • autoconf / automake / autoheader

  • libtool

  • libgearman (>= 0.14)

Download the tarball and perform the following steps:

#> ./configure
#> make
#> make install

Then add the mod_gearman.o to your Nagios installation and add a broker line to your nagios.cfg:

broker_module=.../mod_gearman.o server=localhost:4730 eventhandler=yes services=yes hosts=yes

see Configuration for details on all parameters

The next step is to start one or more worker. You may use the same configuration file as for the neb module.

./mod_gearman_worker --server=localhost:4730 --services --hosts

or use the supplied init script.

Note
Make sure you have started your Gearmand job server. Usually it can be started with
/usr/sbin/gearmand -t 10 -j 0

or a supplied init script (extras/gearmand-init). Command line arguments have change in recent gearman versions and you now should use something like:

/usr/sbin/gearmand --threads=10 --job-retries=0

Patch Nagios

Note
The needed patch is already applied to Nagios 3.2.2. Use the patch if you have an older version.

It is not possible to distribute eventhandler with Nagios versions prior 3.2.2. Just apply the patch from the ./extras/patches directory to your Nagios sources and build Nagios again if you want to use an older version. You only need to replace the Nagios binary. Nothing else has changed. If you plan to distribute only Host/Servicechecks, no patch is needed.

Configuration

Nagios Core

A sample broker in your nagios.cfg could look like:

broker_module=/usr/local/share/nagios/mod_gearman.o keyfile=/usr/local/share/nagios/secret.txt server=localhost eventhandler=yes hosts=yes services=yes

See the following list for a detailed explanation of available options:

Common Options

Shared options for worker and the NEB module:

config

include config from this file. Options are the same as described here. include is an alias for config.

config=/etc/nagios3/mod_gm_worker.conf
debug

use debug to increase the verbosity of the module. Possible values are:

  • 0 - only errors

  • 1-4 - debug verbosity

  • 5 - trace and all gearman related logs are going to stdout

Default is 0.

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.

logmode=automatic
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 the first server available.

server=localhost:4730,remote_host:4730
eventhandler

defines if the module should distribute execution of eventhandlers.

eventhandler=yes
services

defines if the module should distribute execution of service checks.

services=yes
hosts

defines if the module should distribute execution of host checks.

hosts=yes
hostgroups

sets a list of hostgroups which will go into seperate queues.

hostgroups=name1,name2,name3
servicegroups

sets a list of servicegroups which will go into seperate queues.

servicegroups=name1,name2,name3
encryption

enables or disables encryption. It is strongly advised to not disable encryption. Anybody will be able to inject packages to your worker. Encryption is enabled by default and you have to explicitly disable it. When using encryption, you will either have to specify a shared password with key=... or a keyfile with keyfile=.... Default is On.

encryption=yes
key

A shared password which will be used for encryption of data pakets. Should be at least 8 bytes long. Maximum length is 32 characters.

key=secret
keyfile

The shared password will be read from this file. Use either key or keyfile. Only the first 32 characters from the first line will be used. Whitespace to the right will be trimmed.

keyfile=/path/to/secret.file
use_uniq_jobs

Using uniq keys prevents the gearman queues from filling up when there is no worker. However, gearmand seems to have problems with the uniq key and sometimes jobs get stuck in the queue. Set this option to off when you run into problems with stuck jobs but make sure your worker are running. Default is On.

+

use_uniq_jobs=on

Server Options

Additional options for the NEB module only:

localhostgroups

sets a list of hostgroups which will not be executed by gearman. They are just passed through.

localhostgroups=name1,name2,name3
localservicegroups

sets a list of servicegroups which will not be executed by gearman. They are just passed through.

localservicegroups=name1,name2,name3
queue_custom_variable

Can be used to define the target queue by a custom variable in addition to host/servicegroups. When set for ex. to WORKER you then could define a _WORKER custom variable for your hosts and services to directly set the worker queue. The host queue is inherited unless overwritten by a service custom variable. Set the value of your custom variable to local to bypass Mod-Gearman (Same behaviour as in localhostgroups/localservicegroups).

queue_custom_variable=WORKER
do_hostchecks

Set this to no if you want Mod-Gearman to only take care of 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: yes

do_hostchecks=yes
result_workers

Number of result worker threads. Usually one is enough. You may increase the value if your result queue is not processed fast enough.

result_workers=3
perfdata

Defines if the module should distribute perfdata to gearman.

perfdata=yes
Note
processing of perfdata is not part of mod_gearman. You will need additional worker for handling performance data. For example: PNP4Nagios. Performance data is just written to the gearman queue.
perfdata_mode

There will be only a single job for each host or servier when putting performance data onto the perfdata_queue in overwrite mode. In append mode perfdata will be stored as long as there is memory left. Setting this to overwrite helps preventing the perf_data queue from getting to big. Monitor your perfdata carefully when using the append mode. Possible values are:

  • 1 - overwrite

  • 2 - append

Default is 1.

perfdata_mode=1
result_queue

sets the result queue. Necessary when putting jobs from several Nagios instances onto the same gearman queues. Default: check_results

result_queue=check_results_nagios1
orphan_host_checks

The Mod-Gearman NEB module will submit a fake result for orphaned host checks with a message saying there is no worker running for this queue. Use this option to get better reporting results, otherwise your hosts will keep their last state as long as there is no worker running. Default is yes.

orphan_host_checks=yes
orphan_service_checks

Same like orphan_host_checks but for services. Default is yes.

orphan_service_checks=yes
accept_clear_results

When enabled, the NEB module will accept unencrypted results too. This is quite useful if you have lots of passive checks and make use of send_gearman/send_multi where you would have to spread the shared key to all clients using these tools. Default is no.

accept_clear_results=yes

Worker Options

Additional options for worker:

identifier

Identifier for this worker. Will be used for the worker_identifier queue for status requests. You may want to change it if you are using more than one worker on a single host. Defaults to the current hostname.

identifier=hostname_test
pidfile

Path to the pidfile.

pidfile=/path/to/pid.file
job_timeout

Default job timeout in seconds. Currently this value is only used for eventhandler. The worker will use the values from the core for host and service checks. Default: 60

job_timeout=60
max-age

Threshold for discarding too old jobs. When a new job is older than this amount of seconds it will not be executed and just discarded. This will result in a message like "(Could Not Start Check In Time)". Possible reasons for this are time differences between core and worker (use NTP!) or the smart rescheduler of the core which should be disabled. Set to zero to disable this check. Default: 0

max-age=600
min-worker

Minimum number of worker processes which should run at any time. Default: 1

min-worker=1
max-worker

Maximum number of worker processes which should run at any time. You may set this equal to min-worker setting to disable dynamic starting of workers. When setting this to 1, all services from this worker will be executed one after another. Default: 20

max-worker=20
spawn-rate

Defines the rate of spawned worker per second as long as there are jobs waiting. Default: 1

spawn-rate=1
load_limit1

Set a limit based on the 1min load average. When exceding the load limit, no new worker will be started until the current load is below the limit. No limit will be used when set to 0. Default: no limit

load_limit1=0
load_limit5

Set a limit based on the 5min load average. See load_limit1 for details. Default: no limit

load_limit5=0
load_limit15

Set a limit based on the 15min load average. See load_limit1 for details. Default: no limit

load_limit15=0
idle-timeout

Time in seconds after which an idling worker exits. This parameter controls how fast your waiting workers will exit if there are no jobs waiting. Set to 0 to disable the idle timeout. Default: 10

idle-timeout=30
max-jobs

Controls the amount of jobs a worker will do before he exits. Use this to control how fast the amount of workers will go down after high load times. Disabled when set to 0. Default: 1000

max-jobs=500
fork_on_exec

Use this option to disable an extra fork for each plugin execution. Disabling this option will reduce the load on the worker host, but may cause trouble with unclean plugins. Default: no

fork_on_exec=no
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.

dupserver=logserver:4730,logserver2:4730
show_error_output

Use this option to show stderr output of plugins too. When set to no, only stdout will be displayed. Default is yes.

show_error_output=yes
timeout_return

Defines the return code for timed out checks. Accepted return codes are 0 (Ok), 1 (Warning), 2 (Critical) and 3 (Unknown) Default: 2

timeout_return=2
dup_results_are_passive

Use this option to set if the duplicate result send to the dupserver will be passive or active. Default is yes (passive).

dup_results_are_passive=yes
debug-result

When enabled, the hostname of the executing worker will be put in front of the plugin output. This may help with debugging your plugin results. Default is off.

debug-result=yes
enable_embedded_perl

When embedded perl has been compiled in, you can use this switch to enable or disable the embedded perl interpreter. See Embedded Perl for details on EPN.

enable_embedded_perl=on
use_embedded_perl_implicitly

Default value used when the perl script does not have a "nagios: +epn" or "nagios: -epn" set. Perl scripts not written for epn support usually fail with epn, so its better to set the default to off.

use_embedded_perl_implicitly=off
use_perl_cache

Cache compiled perl scripts. This makes the worker process a little bit bigger but makes execution of perl scripts even faster. When turned off, Mod-Gearman will still use the embedded perl interpreter, but will not cache the compiled script.

use_perl_cache=on
workaround_rc_25

Duplicate jobs from gearmand result sometimes in exit code 25 of plugins because they are executed twice and get killed because of using the same ressource. Sending results (when exit code is 25 ) will be skipped with this enabled. Only needed if you experience problems with plugins exiting with exit code 25 randomly. Default is off.

workaround_rc_25=off

Queue Names

You may want to watch your gearman server job queue. The shipped gearman_top does this. It polls the gearman server every second and displays the current queue statistics.

+-----------------------+--------+-------+-------+---------+
| Name                  | Worker | Avail | Queue | Running |
+-----------------------+--------+-------+-------+---------+
| check_results         | 1      | 1     | 0     | 0       |
| host                  | 3      | 3     | 0     | 0       |
| service               | 3      | 3     | 0     | 0       |
| eventhandler          | 3      | 3     | 0     | 0       |
| servicegroup_jmx4perl | 3      | 3     | 0     | 0       |
| hostgroup_japan       | 3      | 3     | 0     | 0       |
+-----------------------+--------+-------+-------+---------+
check_results

this queue is monitored by the neb module to fetch results from the worker. You don’t need an extra worker for this queue. The number of result workers can be set to a maximum of 256, but usually one is enough. One worker is capable of processing several thousand results per second.

host

This is the queue for generic host checks. If you enable host checks with the hosts=yes switch. Before a host goes into this queue, it is checked if any of the local groups matches or a seperate hostgroup machtes. If nothing matches, then this queue is used.

service

This is the queue for generic service checks. If you enable service checks with the services=yes switch. Before a service goes into this queue it is checked against the local host- and service-groups. Then the normal host- and servicegroups are checked and if none matches, this queue is used.

hostgroup_<name>

This queue is created for every hostgroup which has been defined by the hostgroups=… option. Make sure you have at least one worker for every hostgroup you specify. Start the worker with --hostgroups=... to work on hostgroup queues. Note that this queue may also contain service checks if the hostgroup of a service matches.

servicegroup_<name>

This queue is created for every servicegroup which has been defined by the servicegroup=... option.

eventhandler

This is the generic queue for all eventhandler. Make sure you have a worker for this queue if you have eventhandler enabled. Start the worker with --events to work on this queue.

perfdata

This is the generic queue for all performance data. It is created and used if you switch on --perfdata=yes. Performance data cannot be processed by the gearman worker itself. You will need PNP4Nagios therefor.

Performance

While the main motivation was to ease distributed configuration, this plugin also helps to spread the load on multiple worker. Throughput is mainly limited by the amount of jobs a single Nagios instance can put onto the Gearman job server. Keep the Gearman job server close to the Nagios box. Best practice is to put both on the same machine. Both processes will utilize one core. Some testing with my workstation (Dual Core 2.50GHz) and two worker boxes gave me these results. I used a sample Nagios installation with 20.000 Services at a 1 minute interval and a sample plugin which returns just a single line of output. I got over 300 Servicechecks per second, which means you could easily setup 100.000 services at a 5 minute interval with a single Nagios box. The amount of worker boxes depends on your check types.

mod_gearman performance mod_gearman performance

See this article about benchmarks with Nagios3, Nagios4 and Mod-Gearman.

Exports

Exports export data structures from the Nagios core as JSON data. For each configurable event one job will be created. At the moment, the only useful event type is the logdata event which allows you to create a json data job for every logged line. This can be very useful for external reporting tools.

exports

Set the queue name to create the jobs in. The return code will be sent back to the core (Not all callbacks support return codes). Callbacks are a list of callbacks for which you want to export json data.

export=<queue>:<returncode>:<callback>[,<callback>,...]
export=log_queue:1:NEBCALLBACK_LOG_DATA

Embedded Perl

Since 1.2.0 Mod-Gearman has builtin embedded Perl support which means generally a big performance boost when you have lots of perl plugins.

To enable embedded Perl you need to run configure with --enable-embedded-perl

  ./configure --enable-embedded-perl otheroptions...

The --with-perlcache configure option has been replace by a runtime configure option use_perl_cache.

Note
Not all perl plugins support EPN. You can fix them, add # nagios: -epn in the first 10 lines of the script or set use_embedded_perl_implicitly=off so all scripts without the explicit tag are run without embedded Perl.

The default configuration of Mod-Gearman enables embedded Perl, but only uses it for Perl scripts which explicitly set # nagios: +epn. This is a very safe way of using embedded Perl but you probably miss some plugins which do not set the header and still would run with EPN. You may want to use the mini_epn from your Nagios installation to verify if a plugin works with EPN or not.

General EPN documentation is valid for Mod-Gearman as well:

Note
Mod-Gearman does not fix all of the memory leaks introduced with Nagios and Embedded Perl, but it moves the leaks away from the core. And they do not affect Mod-Gearman at all, as they are only in the preforked worker processes which will be restarted automatically from time to time (see max-jobs).

How To

How to Monitor Job Server and Worker

Use the supplied check_gearman to monitor your worker and job server. Worker have a own queue for status requests.

%> ./check_gearman -H <job server hostname> -q worker_<worker hostname> -t 10 -s check
check_gearman OK - localhost has 10 worker and is working on 1 jobs|worker=10 running=1 total_jobs_done=1508

This will send a test job to the given job server and the worker will respond with some statistical data.

Job server can be monitored with:

%> ./check_gearman -H localhost -t 20
check_gearman OK - 6 jobs running and 0 jobs waiting.|check_results=0;0;1;10;100 host=0;0;9;10;100 service=0;6;9;10;100

How to Submit Passive Checks

You can use send_gearman to submit active and passive checks to a gearman job server where they will be processed just like a finished check would do.

%> ./send_gearman --server=<job server> --encryption=no --host="<hostname>" --service="<service>" --message="message"

How to build send_gearman.exe

After installing strawberry perl, you need to install the PAR::Packer module and run pp:

  pp -z 9 -M Class::Load::XS -M Moose -M Nagios::Passive::Base -M Params::Validate::XS -o send_gearman.exe send_gearman.pl

Or just use the prebuild one from labs.consol.de: send_gearman.exe.

How to Submit check_multi Results

check_multi is a plugin which executes multiple child checks. See more details about the feed_passive mode at: www.my-plugin.de

You can pass such child checks to Nagios via the mod_gearman neb module:

%> check_multi -f multi.cmd -r 256 | ./send_multi --server=<job server> --encryption=no --host="<hostname>" --service="<service>"

If you want to use only check_multi and no other workers, you can achieve this with the following neb module settings:

broker_module=/usr/local/share/nagios/mod_gearman.o server=localhost encryption=no eventhandler=no hosts=no services=no hostgroups=does_not_exist
Note
encryption is not necessary if you both run the check_multi checks and the Nagios check_results queue on the same server.

How to Set Queue by Custom Variable

Set queue_custom_variable=worker in your Mod-Gearman NEB configuration. Then adjust your nagios host/service configuration and add the custom variable:

  define host {
    ...
    _WORKER    hostgroup_test
  }

The test hostgroup does not have to exist, it is a virtual queue name which is used by the worker.

Adjust your Mod-Gearman worker configuration and put test in the hostgroups attribute. From then on, the worker will work on all jobs in the hostgroup_test queue.

What About Notifications

Notifications are currently not possible to distribute via Mod-Gearman. The Nagios core would have to be patched to support this. And i think its not very useful at all. So don’t expect this feature to be implemented in the near future.

Supported Dependencies

Note
Mod-Gearman works best with libgearman/gearmand 0.33 and Nagios 3.2.3. If in doubt, use these versions.

Lib-Gearman

Mod-Gearman has successfully been tested on the following Gearmand Versions. It is recommended to always use the latest listed version of libgearman.

Nagios

Mod-Gearman works best since version 3.2.2 up to the latest stable Nagios 3.5.1. Nagios 4 is not fully tested yet, but there is a preview version available here http://mod-gearman.org/download/v1.4.0nagios4/ or in the nagios4 branch of the source tree.

Naemon

Mod-Gearman works on the Naemon core as well with the same remarks as Nagios 4.

Icinga

To be clear, Icinga is not the recommended platform for Mod-Gearman and not supported in any way. However, people have reported it works with Icinga 1.2.0, 1.8 and 1.10.1 but it seems like some statistics are not updated.

Hints

  • Make sure you have at least one worker for every queue. You should monitor that (check_gearman).

  • Add Logfile checks for your gearmand server and mod_gearman worker.

  • Make sure all gearman checks are in local groups. Gearman self checks should not be monitored through gearman.

  • Checks which write directly to the Nagios command file (ex.: check_mk) have to run on a local worker or have to be excluded by the localservicegroups.

  • Keep the gearmand server close to Nagios for better performance.

  • If you have some checks which should not run parallel, just setup a single worker with --max-worker=1 and they will be executed one after another. For example for cpu intesive checks with selenium.

  • Make sure all your worker have the Nagios-Plugins available under the same path. Otherwise they could’nt be found by the worker.

Archive


mod_gearman-1.4.14/extras/0000755001161000116100000000000012234560110012343 500000000000000mod_gearman-1.4.14/extras/patches/0000755001161000116100000000000011705011514013773 500000000000000mod_gearman-1.4.14/extras/patches/0001-nagios_3.2.1_eventhandler_broker.patch0000644001161000116100000002432711705011514023426 00000000000000diff --git a/base/broker.c b/base/broker.c index 329543f..8f5bc88 100644 --- a/base/broker.c +++ b/base/broker.c @@ -174,13 +174,14 @@ void broker_system_command(int type, int flags, int attr, struct timeval start_t /* send event handler data to broker */ -void broker_event_handler(int type, int flags, int attr, int eventhandler_type, void *data, int state, int state_type, struct timeval start_time, struct timeval end_time, double exectime, int timeout, int early_timeout, int retcode, char *cmd, char *cmdline, char *output, struct timeval *timestamp){ +int broker_event_handler(int type, int flags, int attr, int eventhandler_type, void *data, int state, int state_type, struct timeval start_time, struct timeval end_time, double exectime, int timeout, int early_timeout, int retcode, char *cmd, char *cmdline, char *output, struct timeval *timestamp){ service *temp_service=NULL; host *temp_host=NULL; char *command_buf=NULL; char *command_name=NULL; char *command_args=NULL; nebstruct_event_handler_data ds; + int return_code=OK; if(!(event_broker_options & BROKER_EVENT_HANDLERS)) return; @@ -227,12 +228,12 @@ void broker_event_handler(int type, int flags, int attr, int eventhandler_type, ds.output=output; /* make callbacks */ - neb_make_callbacks(NEBCALLBACK_EVENT_HANDLER_DATA,(void *)&ds); + return_code=neb_make_callbacks(NEBCALLBACK_EVENT_HANDLER_DATA,(void *)&ds); /* free memory */ my_free(command_buf); - return; + return return_code; } @@ -1010,4 +1011,3 @@ struct timeval get_broker_timestamp(struct timeval *timestamp){ #endif - diff --git a/base/sehandlers.c b/base/sehandlers.c index 6def42e..a53d99f 100644 --- a/base/sehandlers.c +++ b/base/sehandlers.c @@ -32,6 +32,9 @@ #include "../include/perfdata.h" #include "../include/broker.h" +#ifdef USE_EVENT_BROKER +#include "../include/neberrors.h" +#endif extern int enable_event_handlers; extern int obsess_over_services; @@ -251,6 +254,7 @@ int run_global_service_event_handler(service *svc){ #ifdef USE_EVENT_BROKER struct timeval start_time; struct timeval end_time; + int neb_result=OK; #endif int macro_options=STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS; @@ -275,13 +279,6 @@ int run_global_service_event_handler(service *svc){ gettimeofday(&start_time,NULL); #endif -#ifdef USE_EVENT_BROKER - /* send event data to broker */ - end_time.tv_sec=0L; - end_time.tv_usec=0L; - broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,GLOBAL_SERVICE_EVENTHANDLER,(void *)svc,svc->current_state,svc->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,global_service_event_handler,NULL,NULL,NULL); -#endif - /* get the raw command line */ get_raw_command_line(global_service_event_handler_ptr,global_service_event_handler,&raw_command,macro_options); if(raw_command==NULL) @@ -302,6 +299,22 @@ int run_global_service_event_handler(service *svc){ logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry); } +#ifdef USE_EVENT_BROKER + /* send event data to broker */ + end_time.tv_sec=0L; + end_time.tv_usec=0L; + neb_result=broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,GLOBAL_SERVICE_EVENTHANDLER,(void *)svc,svc->current_state,svc->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,global_service_event_handler,processed_command,NULL,NULL); + + /* neb module wants to override (or cancel) the event handler - perhaps it will run the eventhandler itself */ + if(neb_result==NEBERROR_CALLBACKOVERRIDE) { + my_free(processed_command); + my_free(raw_command); + my_free(raw_logentry); + my_free(processed_logentry); + return OK; + } +#endif + /* run the command */ result=my_system(processed_command,event_handler_timeout,&early_timeout,&exectime,&command_output,0); @@ -344,6 +357,7 @@ int run_service_event_handler(service *svc){ #ifdef USE_EVENT_BROKER struct timeval start_time; struct timeval end_time; + int neb_result=OK; #endif int macro_options=STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS; @@ -364,12 +378,6 @@ int run_service_event_handler(service *svc){ gettimeofday(&start_time,NULL); #endif -#ifdef USE_EVENT_BROKER - /* send event data to broker */ - end_time.tv_sec=0L; - end_time.tv_usec=0L; - broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,SERVICE_EVENTHANDLER,(void *)svc,svc->current_state,svc->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,svc->event_handler,NULL,NULL,NULL); -#endif /* get the raw command line */ get_raw_command_line(svc->event_handler_ptr,svc->event_handler,&raw_command,macro_options); @@ -391,6 +399,22 @@ int run_service_event_handler(service *svc){ logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry); } +#ifdef USE_EVENT_BROKER + /* send event data to broker */ + end_time.tv_sec=0L; + end_time.tv_usec=0L; + neb_result=broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,SERVICE_EVENTHANDLER,(void *)svc,svc->current_state,svc->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,svc->event_handler,processed_command,NULL,NULL); + + /* neb module wants to override (or cancel) the event handler - perhaps it will run the eventhandler itself */ + if(neb_result==NEBERROR_CALLBACKOVERRIDE) { + my_free(processed_command); + my_free(raw_command); + my_free(raw_logentry); + my_free(processed_logentry); + return OK; + } +#endif + /* run the command */ result=my_system(processed_command,event_handler_timeout,&early_timeout,&exectime,&command_output,0); @@ -476,6 +500,7 @@ int run_global_host_event_handler(host *hst){ #ifdef USE_EVENT_BROKER struct timeval start_time; struct timeval end_time; + int neb_result=OK; #endif int macro_options=STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS; @@ -500,13 +525,6 @@ int run_global_host_event_handler(host *hst){ gettimeofday(&start_time,NULL); #endif -#ifdef USE_EVENT_BROKER - /* send event data to broker */ - end_time.tv_sec=0L; - end_time.tv_usec=0L; - broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,GLOBAL_HOST_EVENTHANDLER,(void *)hst,hst->current_state,hst->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,global_host_event_handler,NULL,NULL,NULL); -#endif - /* get the raw command line */ get_raw_command_line(global_host_event_handler_ptr,global_host_event_handler,&raw_command,macro_options); if(raw_command==NULL) @@ -527,6 +545,22 @@ int run_global_host_event_handler(host *hst){ logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry); } +#ifdef USE_EVENT_BROKER + /* send event data to broker */ + end_time.tv_sec=0L; + end_time.tv_usec=0L; + neb_result=broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,GLOBAL_HOST_EVENTHANDLER,(void *)hst,hst->current_state,hst->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,global_host_event_handler,processed_command,NULL,NULL); + + /* neb module wants to override (or cancel) the event handler - perhaps it will run the eventhandler itself */ + if(neb_result==NEBERROR_CALLBACKOVERRIDE) { + my_free(processed_command); + my_free(raw_command); + my_free(raw_logentry); + my_free(processed_logentry); + return OK; + } +#endif + /* run the command */ result=my_system(processed_command,event_handler_timeout,&early_timeout,&exectime,&command_output,0); @@ -568,6 +602,7 @@ int run_host_event_handler(host *hst){ #ifdef USE_EVENT_BROKER struct timeval start_time; struct timeval end_time; + int neb_result=OK; #endif int macro_options=STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS; @@ -588,13 +623,6 @@ int run_host_event_handler(host *hst){ gettimeofday(&start_time,NULL); #endif -#ifdef USE_EVENT_BROKER - /* send event data to broker */ - end_time.tv_sec=0L; - end_time.tv_usec=0L; - broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,HOST_EVENTHANDLER,(void *)hst,hst->current_state,hst->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,hst->event_handler,NULL,NULL,NULL); -#endif - /* get the raw command line */ get_raw_command_line(hst->event_handler_ptr,hst->event_handler,&raw_command,macro_options); if(raw_command==NULL) @@ -615,6 +643,22 @@ int run_host_event_handler(host *hst){ logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry); } +#ifdef USE_EVENT_BROKER + /* send event data to broker */ + end_time.tv_sec=0L; + end_time.tv_usec=0L; + neb_result=broker_event_handler(NEBTYPE_EVENTHANDLER_START,NEBFLAG_NONE,NEBATTR_NONE,HOST_EVENTHANDLER,(void *)hst,hst->current_state,hst->state_type,start_time,end_time,exectime,event_handler_timeout,early_timeout,result,hst->event_handler,processed_command,NULL,NULL); + + /* neb module wants to override (or cancel) the event handler - perhaps it will run the eventhandler itself */ + if(neb_result==NEBERROR_CALLBACKOVERRIDE) { + my_free(processed_command); + my_free(raw_command); + my_free(raw_logentry); + my_free(processed_logentry); + return OK; + } +#endif + /* run the command */ result=my_system(processed_command,event_handler_timeout,&early_timeout,&exectime,&command_output,0); @@ -780,5 +824,3 @@ int handle_host_state(host *hst){ return OK; } - - diff --git a/include/broker.h b/include/broker.h index bbb8810..8c15b03 100644 --- a/include/broker.h +++ b/include/broker.h @@ -188,7 +188,7 @@ struct timeval get_broker_timestamp(struct timeval *); void broker_program_state(int,int,int,struct timeval *); void broker_timed_event(int,int,int,timed_event *,struct timeval *); void broker_log_data(int,int,int,char *,unsigned long,time_t,struct timeval *); -void broker_event_handler(int,int,int,int,void *,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,char *,struct timeval *); +int broker_event_handler(int,int,int,int,void *,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,char *,struct timeval *); void broker_ocp_data(int,int,int,void *,int,int,double,int,int,struct timeval *); void broker_system_command(int,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,struct timeval *); int broker_host_check(int,int,int,host *,int,int,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,char *,char *,char *,struct timeval *); mod_gearman-1.4.14/extras/.gitignore0000644001161000116100000000001611452564105014261 00000000000000gearmand-init mod_gearman-1.4.14/extras/gearmand-init.in0000755001161000116100000001047212141667303015352 00000000000000#!/bin/sh ### BEGIN INIT INFO # Provides: gearmand # Required-Start: $local_fs # Required-Stop: $local_fs # Should-Start: # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop the gearman daemon ### END INIT INFO NAME=gearmand DAEMON="%GEARMAND%" OPTIONS="-d -j 0 -w 10" PORT=4730 LISTEN=0.0.0.0 PIDFILE=%GPIDFILE% LOGFILE=%GLOGFILE% USER=%USER% GRACEFUL_SHUTDOWN_TIME=30 LIBEVENTMINVERSION=1.4 for f in $( which netcat nc 2>/dev/null ) ; do if [ -x "$f" ]; then NC=$f fi done # check libevent version # io threads are only supported in lib event >= 1.4 LIBEVENTVERSION=`/sbin/ldconfig -p 2>&1 | grep libevent- | tail -n 1 | sed -e 's/.*libevent\-\(.*\)\.so.*/\1/g' -e 's/[^0-9\.]//g'` if [ ! -z "$LIBEVENTVERSION" ]; then [ `echo "$LIBEVENTVERSION $LIBEVENTMINVERSION" | awk '{if ($1 >= $2) print 1}'` ] && OPTIONS="$OPTIONS -t 10" fi # create state dir mkdir -p $(dirname $LOGFILE) chown $USER: $(dirname $LOGFILE) get_status() { pid=$( cat $PIDFILE 2>/dev/null ) if [ -n "$pid" ]; then if ps -p $pid > /dev/null 2>&1 ; then echo "$NAME is running with pid $pid" return 0; fi fi echo "$NAME is not running" return 1; } kill_gearmand() { printf '%s' "Killing $NAME..." pid=$( cat $PIDFILE 2>/dev/null ) if [ -z "$pid" ]; then echo ". Not running." else # do a kill if still now down ps -p $pid > /dev/null 2>&1 && kill $pid for x in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5; do printf "." ps -p $pid > /dev/null 2>&1 && sleep 1; done if ! ps -p $pid > /dev/null 2>&1 ; then echo "OK" exit 0; else echo "failed" exit 1; fi fi } WHO=$( whoami ) case "$1" in start) printf '%s' "Starting $NAME..." if get_status > /dev/null ; then echo "failed" echo "$NAME already running" exit 0; fi if [ ! -x "$DAEMON" ]; then echo "Cannot start. Make sure $DAEMON exists and is executable" exit 1; fi CMD="$DAEMON -p $PORT -P $PIDFILE $OPTIONS --log-file=$LOGFILE --verbose=2 --listen=$LISTEN" if [ "$WHO" = "root" ]; then # try to exec commands as user su - $USER -c /bin/true if [ $? -ne 0 ]; then echo "cannot exec commands as user $USER, make sure user has a valid shell" exit 1; fi su - $USER -c "$CMD > $LOGFILE 2>&1" else $CMD > $LOGFILE 2>&1 fi if [ $? -eq 0 ]; then echo "OK" exit 0; else echo "failed" exit 1; fi ;; stop) printf '%s' "Stopping $NAME..." pid=$( cat $PIDFILE 2>/dev/null ) if [ -z "$pid" ]; then echo ". Not running." else # do a graceful shutdown if [ ! -z $NC ]; then printf '%s' " gracefully " echo "shutdown graceful" | $NC -w 1 -i 1 $LISTEN $PORT > /dev/null x=$GRACEFUL_SHUTDOWN_TIME while [ $x -gt 0 ]; do printf "." ps -p $pid > /dev/null 2>&1 && sleep 1 || x=0; x=$( expr $x - 1 ) done if ! ps -p $pid > /dev/null 2>&1 ; then echo "OK" exit 0; else echo "failed" fi fi # kill if still running ps -p $pid > /dev/null 2>&1 && kill_gearmand; fi ;; kill) kill_gearmand; ;; reload|force-reload) printf '%s' "Reloading $NAME configuration files..." pid=$( cat $PIDFILE 2>/dev/null ) if [ -n "$pid" ]; then kill -HUP "$pid" echo "OK" exit 0; else echo "" echo "$NAME is not running" exit 1; fi ;; status) get_status; exit $?; ;; restart) $0 stop && sleep 1 && $0 start exit $? ;; *) echo "Usage: $NAME {start|stop|kill|status|restart}" exit 1 ;; esac exit 0 mod_gearman-1.4.14/extras/standalone_worker.conf0000644001161000116100000001247612064652156016702 00000000000000############################################################################### # # mod_gearman - distribute checks with gearman # # Copyright (c) 2010 Sven Nierlein # # Sample Standalone Worker Config # ############################################################################### # use debug to increase the verbosity of the module. # Possible values are: # 0 = only errors # 1-4 = debug verbosity # 5 = trace and all gearman related logs are going to stdout. # Default is 0. 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 # defines if the module should distribute execution of # eventhandlers. eventhandler=yes # defines if the module should distribute execution of # service checks. services=yes # defines if the module should distribute execution of # host checks. hosts=yes # sets a list of hostgroups which will go into seperate # queues. Either specify a comma seperated list or use # multiple lines. #hostgroups=name1 #hostgroups=name2,name3 # sets a list of servicegroups which will go into seperate # queues. #servicegroups=name1,name2,name3 # enables or disables encryption. It is strongly # advised to not disable encryption. Anybody will be # able to inject packages to your worker. # Encryption is enabled by default and you have to # explicitly disable it. # When using encryption, you will either have to # specify a shared password with key=... or a # keyfile with keyfile=... # Default is On. encryption=yes # A shared password which will be used for # encryption of data pakets. Should be at least 8 # bytes long. Maximum length is 32 characters. key=should_be_changed # The shared password will be read from this file. # Use either key or keyfile. Only the first 32 # characters will be used. #keyfile=/path/to/secret.file # Identifier, hostname will be used if undefined #identifier=hostname # Path to the pidfile. pidfile=./worker.pid # Path to the logfile. logfile=./worker.log # Default job timeout in seconds. Currently this value is only used for # eventhandler. The worker will use the values from the core for host and # service checks. job_timeout=60 # Minimum number of worker processes which should # run at any time. min-worker=1 # Maximum number of worker processes which should # run at any time. You may set this equal to # min-worker setting to disable dynamic starting of # workers. When setting this to 1, all services from # this worker will be executed one after another. max-worker=20 # idling worker will terminate after this amount of seconds # until min-worker is reached idle-timeout=30 # worker will terminate after this amount of jobs done max-jobs=50 # max-age is the threshold for discarding too old jobs. When a new job is older # than this amount of seconds it will not be executed and just discarded. Set to # zero to disable this check. #max-age=0 # defined the rate of spawed worker per second as long # as there are jobs waiting spawn-rate=1 # Use this option to disable an extra fork for each plugin execution. Disabling # this option will reduce the load on the worker host but can lead to problems with # unclean plugin. Default: no fork_on_exec=no # Set a limit based on the 1min load average. When exceding the load limit, # no new worker will be started until the current load is below the limit. # No limit will be used when set to 0. load_limit1=0 # Same as load_limit1 but for the 5min load average. load_limit5=0 # Same as load_limit1 but for the 15min load average. load_limit15=0 # Use this option to show stderr output of plugins too. # Default: yes show_error_output=yes # timeout_return defines the return code for timed out checks. Accepted return # codes are 0 (Ok), 1 (Warning), 2 (Critical) and 3 (Unknown) Default: 2 timeout_return=2 # Use dup_results_are_passive to set if the duplicate result send to the dupserver # will be passive or active. # Default is yes (passive). #dup_results_are_passive=yes # When embedded perl has been compiled in, you can use this # switch to enable or disable the embedded perl interpreter. enable_embedded_perl=on # Default value used when the perl script does not have a # "nagios: +epn" or "nagios: -epn" set. # Perl scripts not written for epn support usually fail with epn, # so its better to set the default to off. use_embedded_perl_implicitly=off # Cache compiled perl scripts. This makes the worker process a little # bit bigger but makes exection of perl scripts even faster. # When turned off, Mod-Gearman will still use the embedded perl # interpreter, but will not cache the compiled script. use_perl_cache=on # path to p1 file which is used to execute and cache the # perl scripts run by the embedded perl interpreter p1_file=./worker/mod_gearman_p1.pl # Workarounds # workaround for rc 25 bug # duplicate jobs from gearmand result in exit code 25 of plugins # because they are executed twice and get killed because of using # the same ressource. # Sending results (when exit code is 25 ) will be skipped with this # enabled. workaround_rc_25=off mod_gearman-1.4.14/extras/shared.conf0000644001161000116100000002215012212675260014411 00000000000000############################################################################### # # mod_gearman - distribute checks with gearman # # Copyright (c) 2010 Sven Nierlein # # Sample Shared Worker / NEB Module Config # ############################################################################### # use debug to increase the verbosity of the module. # Possible values are: # 0 = only errors # 1-4 = debug verbosity # 5 = trace and all gearman related logs are going to stdout. # Default is 0. 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 # core # -> use nagios internal loging (not thread safe! Use with care) # 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 # defines if the module should distribute execution of # eventhandlers. eventhandler=yes # defines if the module should distribute execution of # service checks. services=yes # defines if the module should distribute execution of # host checks. hosts=yes # sets a list of hostgroups which will go into seperate # queues. Either specify a comma seperated list or use # multiple lines. #hostgroups=name1 #hostgroups=name2,name3 # sets a list of servicegroups which will go into seperate # queues. #servicegroups=name1,name2,name3 # Set this to 'no' if you want Mod-Gearman to only take care of # 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 # This settings determines if all eventhandlers go into a single # 'eventhandlers' queue or into the same queue like normal checks # would do. route_eventhandler_like_checks=no # enables or disables encryption. It is strongly # advised to not disable encryption. Anybody will be # able to inject packages to your worker. # Encryption is enabled by default and you have to # explicitly disable it. # When using encryption, you will either have to # specify a shared password with key=... or a # keyfile with keyfile=... # Default is On. encryption=yes # A shared password which will be used for # encryption of data pakets. Should be at least 8 # bytes long. Maximum length is 32 characters. key=should_be_changed # The shared password will be read from this file. # Use either key or keyfile. Only the first 32 # characters will be used. #keyfile=/path/to/secret.file # use_uniq_jobs # Using uniq keys prevents the gearman queues from filling up when there # is no worker. However, gearmand seems to have problems with the uniq # key and sometimes jobs get stuck in the queue. Set this option to 'off' # when you run into problems with stuck jobs but make sure your worker # are running. use_uniq_jobs=on ############################################################################### # # NEB Module Config # # the following settings are for the neb module only and # will be ignored by the worker. # ############################################################################### # sets a list of hostgroups which will not be executed # by gearman. They are just passed through. # Default: none localhostgroups= # sets a list of servicegroups which will not be executed # by gearman. They are just passed through. # Default: none localservicegroups= # The queue_custom_variable can be used to define the target queue # by a custom variable in addition to host/servicegroups. When set # for ex. to 'WORKER' you then could define a '_WORKER' custom # variable for your hosts and services to directly set the worker # queue. The host queue is inherited unless overwritten # by a service custom variable. Set the value of your custom # variable to 'local' to bypass Mod-Gearman (Same behaviour as in # localhostgroups/localservicegroups). #queue_custom_variable=WORKER # Number of result worker threads. Usually one is # enough. You may increase the value if your # result queue is not processed fast enough. # Default: 1 result_workers=1 # defines if the module should distribute perfdata # to gearman. # Note: processing of perfdata is not part of # mod_gearman. You will need additional worker for # handling performance data. For example: pnp4nagios # Performance data is just written to the gearman # queue. # Default: no perfdata=no # perfdata mode overwrite helps preventing the perdata queue getting to big # 1 = overwrote # 2 = append perfdata_mode=1 # The Mod-Gearman NEB module will submit a fake result for orphaned host # checks with a message saying there is no worker running for this # queue. Use this option to get better reporting results, otherwise your # hosts will keep their last state as long as there is no worker # running. # Default: yes orphan_host_checks=yes # Same like 'orphan_host_checks' but for services. # Default: yes orphan_service_checks=yes # orphan_return defines the return code for orphaned checks. Accepted return # codes are 0 (Ok), 1 (Warning), 2 (Critical) and 3 (Unknown) Default: 2 orphan_return=2 # When accept_clear_results is enabled, the NEB module will accept unencrypted # results too. This is quite useful if you have lots of passive checks and make # use of send_gearman/send_multi where you would have to spread the shared key to # all clients using these tools. # Default is no. accept_clear_results=no ############################################################################### # # Worker Config # # the following settings are for the worker only and # will be ignored by the neb module. # ############################################################################### # Identifier, hostname will be used if undefined #identifier=hostname # Path to the pidfile. pidfile=./worker.pid # Path to the logfile. logfile=./worker.log # Default job timeout in seconds. Currently this value is only used for # eventhandler. The worker will use the values from the core for host and # service checks. job_timeout=60 # Minimum number of worker processes which should # run at any time. min-worker=1 # Maximum number of worker processes which should # run at any time. You may set this equal to # min-worker setting to disable dynamic starting of # workers. When setting this to 1, all services from # this worker will be executed one after another. max-worker=20 # idling worker will terminate after this amount of seconds # until min-worker is reached idle-timeout=30 # worker will terminate after this amount of jobs done max-jobs=50 # max-age is the threshold for discarding too old jobs. When a new job is older # than this amount of seconds it will not be executed and just discarded. Set to # zero to disable this check. #max-age=0 # defined the rate of spawed worker per second as long # as there are jobs waiting spawn-rate=1 # Use this option to disable an extra fork for each plugin execution. Disabling # this option will reduce the load on the worker host but can lead to problems with # unclean plugin. Default: no fork_on_exec=no # Set a limit based on the 1min load average. When exceding the load limit, # no new worker will be started until the current load is below the limit. # No limit will be used when set to 0. load_limit1=0 # Same as load_limit1 but for the 5min load average. load_limit5=0 # Same as load_limit1 but for the 15min load average. load_limit15=0 # Use this option to show stderr output of plugins too. # Default: yes show_error_output=yes # timeout_result defines the return code for timed out checks. Accepted return # codes are 0 (Ok), 1 (Warning), 2 (Critical) and 3 (Unknown) Default: 2 timeout_result=2 # Use dup_results_are_passive to set if the duplicate result send to the dupserver # will be passive or active. # Default is yes (passive). #dup_results_are_passive=yes # When embedded perl has been compiled in, you can use this # switch to enable or disable the embedded perl interpreter. enable_embedded_perl=on # Default value used when the perl script does not have a # "nagios: +epn" or "nagios: -epn" set. # Perl scripts not written for epn support usually fail with epn, # so its better to set the default to off. use_embedded_perl_implicitly=off # Cache compiled perl scripts. This makes the worker process a little # bit bigger but makes exection of perl scripts even faster. # When turned off, Mod-Gearman will still use the embedded perl # interpreter, but will not cache the compiled script. use_perl_cache=on # path to p1 file which is used to execute and cache the # perl scripts run by the embedded perl interpreter p1_file=./worker/mod_gearman_p1.pl # Workarounds # workaround for rc 25 bug # duplicate jobs from gearmand result in exit code 25 of plugins # because they are executed twice and get killed because of using # the same ressource. # Sending results (when exit code is 25 ) will be skipped with this # enabled. workaround_rc_25=off mod_gearman-1.4.14/worker/0000755001161000116100000000000012241511662012354 500000000000000mod_gearman-1.4.14/worker/worker.c0000644001161000116100000006507012234761075013770 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /* include header */ #include "config.h" #include "worker.h" #include "utils.h" #include "worker_client.h" int current_number_of_workers = 0; volatile sig_atomic_t current_number_of_jobs = 0; /* must be signal safe */ int orig_argc; char ** orig_argv; int last_time_increased; volatile sig_atomic_t shmid; int * shm; #ifdef EMBEDDEDPERL extern char *p1_file; char **start_env; #endif /* work starts here */ #ifdef EMBEDDEDPERL int main (int argc, char **argv, char **env) { struct stat stat_buf; #else int main (int argc, char **argv) { #endif int sid, x; #ifdef EMBEDDEDPERL start_env=env; #endif last_time_increased = 0; /* store the original command line for later reloads */ store_original_comandline(argc, argv); /* * allocate options structure * and parse command line */ mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); if(parse_arguments(argc, argv) != GM_OK) { exit( EXIT_FAILURE ); } #ifdef EMBEDDEDPERL /* make sure the P1 file exists... */ if(p1_file==NULL){ gm_log(GM_LOG_ERROR,"Error: p1.pl file required for embedded Perl interpreter is not set!\n"); exit( EXIT_FAILURE ); } if(stat(p1_file,&stat_buf)!=0){ gm_log(GM_LOG_ERROR,"Error: p1.pl file required for embedded Perl interpreter is missing!\n"); perror("stat"); exit( EXIT_FAILURE ); } #endif /* fork into daemon mode? */ if(mod_gm_opt->daemon_mode == GM_ENABLED) { pid_t pid = fork(); /* an error occurred while trying to fork */ if(pid == -1) { perror("fork"); exit( EXIT_FAILURE ); } /* we are the child process */ else if(pid == 0) { gm_log( GM_LOG_INFO, "mod_gearman worker daemon started with pid %d\n", getpid()); /* Create a new SID for the child process */ sid = setsid(); if ( sid < 0 ) { mod_gm_free_opt(mod_gm_opt); exit( EXIT_FAILURE ); } /* Close out the standard file descriptors */ if(mod_gm_opt->debug_level <= 1) { close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); } } /* we are the parent. So forking into daemon mode worked */ else { mod_gm_free_opt(mod_gm_opt); exit( EXIT_SUCCESS ); } } else { 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); signal(SIGHUP, reload_config); signal(SIGPIPE, SIG_IGN); /* check and write pid file */ if(write_pid_file() != GM_OK) { exit(EXIT_FAILURE); } /* init crypto functions */ if(mod_gm_opt->encryption == GM_ENABLED) { mod_gm_crypt_init(mod_gm_opt->crypt_key); } else { mod_gm_opt->transportmode = GM_ENCODE_ONLY; } gm_log( GM_LOG_DEBUG, "main process started\n"); /* start a single non forked standalone worker */ if(mod_gm_opt->debug_level >= 10) { gm_log( GM_LOG_TRACE, "starting standalone worker\n"); #ifdef EMBEDDEDPERL worker_client(GM_WORKER_STANDALONE, 1, shmid, start_env); #else worker_client(GM_WORKER_STANDALONE, 1, shmid); #endif exit(EXIT_SUCCESS); } /* setup shared memory */ setup_child_communicator(); /* start status worker */ make_new_child(GM_WORKER_STATUS); /* setup children */ for(x=0; x < mod_gm_opt->min_worker; x++) { make_new_child(GM_WORKER_MULTI); } /* maintain worker population */ monitor_loop(); gm_log( GM_LOG_ERROR, "worker exited from main loop\n"); clean_exit(15); exit( EXIT_SUCCESS ); } /* main loop for checking worker */ void monitor_loop() { /* maintain the population */ while (1) { /* check number of workers every second */ sleep(GM_DEFAULT_WORKER_LOOP_SLEEP); /* make sure our worker are running */ check_worker_population(); } return; } /* count current worker and jobs */ void count_current_worker(int restart) { int x; gm_log( GM_LOG_TRACE3, "count_current_worker()\n"); gm_log( GM_LOG_TRACE3, "done jobs: shm[SHM_JOBS_DONE] = %d\n", shm[SHM_JOBS_DONE]); /* shm states: * 0 -> undefined * -1 -> free * <-1 -> used but idle * > 1 -> used and working */ /* check if status worker died */ if( shm[SHM_STATUS_WORKER_PID] != -1 && pid_alive(shm[SHM_STATUS_WORKER_PID]) == FALSE ) { gm_log( GM_LOG_TRACE, "removed stale status worker, old pid: %d\n", shm[SHM_STATUS_WORKER_PID] ); shm[SHM_STATUS_WORKER_PID] = -1; } gm_log( GM_LOG_TRACE3, "status worker: shm[SHM_STATUS_WORKER_PID] = %d\n", shm[SHM_STATUS_WORKER_PID]); /* check all known worker */ current_number_of_workers = 0; current_number_of_jobs = 0; for(x=SHM_SHIFT; x < mod_gm_opt->max_worker+SHM_SHIFT; x++) { /* verify worker is alive */ gm_log( GM_LOG_TRACE3, "worker slot: shm[%d] = %d\n", x, shm[x]); if( shm[x] != -1 && pid_alive(shm[x]) == FALSE ) { gm_log( GM_LOG_TRACE, "removed stale worker %d, old pid: %d\n", x, shm[x]); shm[x] = -1; /* immediately start new worker, otherwise the fork rate cannot be guaranteed */ if(restart == GM_ENABLED) { make_new_child(GM_WORKER_MULTI); current_number_of_workers++; } } if(shm[x] != -1) { current_number_of_workers++; } if(shm[x] > 0) { current_number_of_jobs++; } } shm[SHM_WORKER_TOTAL] = current_number_of_workers; /* total worker */ shm[SHM_WORKER_RUNNING] = current_number_of_jobs; /* running worker */ gm_log( GM_LOG_TRACE3, "worker: %d - running: %d\n", current_number_of_workers, current_number_of_jobs); return; } /* start new worker if needed */ void check_worker_population() { int x, now, status, target_number_of_workers; gm_log( GM_LOG_TRACE3, "check_worker_population()\n"); now = (int)time(NULL); /* collect finished workers */ while(waitpid(-1, &status, WNOHANG) > 0) gm_log( GM_LOG_TRACE, "waitpid() worker exited with: %d\n", status); /* set current worker number */ count_current_worker(GM_ENABLED); /* check last check time, force restart all worker if there is no result in 2 minutes */ if( shm[SHM_WORKER_LAST_CHECK] < (now - 120) ) { gm_log( GM_LOG_INFO, "no checks in 2minutes, restarting all workers\n", shm[SHM_WORKER_LAST_CHECK]); shm[SHM_WORKER_LAST_CHECK] = now; for(x=SHM_SHIFT; x < mod_gm_opt->max_worker+SHM_SHIFT; x++) { save_kill(shm[x], SIGINT); } sleep(3); for(x=SHM_SHIFT; x < mod_gm_opt->max_worker+SHM_SHIFT; x++) { save_kill(shm[x], SIGKILL); shm[x] = -1; } } /* check if status worker died */ if( shm[SHM_STATUS_WORKER_PID] == -1 ) { make_new_child(GM_WORKER_STATUS); } /* keep up minimum population */ for (x = current_number_of_workers; x < mod_gm_opt->min_worker; x++) { make_new_child(GM_WORKER_MULTI); current_number_of_workers++; } /* check every second if we need to increase worker population */ if(last_time_increased >= now) return; target_number_of_workers = adjust_number_of_worker(mod_gm_opt->min_worker, mod_gm_opt->max_worker, current_number_of_workers, current_number_of_jobs); for (x = current_number_of_workers; x < target_number_of_workers; x++) { last_time_increased = now; /* top up the worker pool */ make_new_child(GM_WORKER_MULTI); } return; } /* start up new worker */ int make_new_child(int mode) { pid_t pid = 0; int next_shm_index; gm_log( GM_LOG_TRACE, "make_new_child(%d)\n", mode); if(mode == GM_WORKER_STATUS) { gm_log( GM_LOG_TRACE, "forking status worker\n"); next_shm_index = 3; } else { gm_log( GM_LOG_TRACE, "forking worker\n"); next_shm_index = get_next_shm_index(); } signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); /* fork a child process */ pid=fork(); /* an error occurred while trying to fork */ if(pid==-1){ perror("fork"); gm_log( GM_LOG_ERROR, "fork error\n" ); return GM_ERROR; } /* we are in the child process */ else if(pid==0){ gm_log( GM_LOG_DEBUG, "child started with pid: %d\n", getpid() ); shm[next_shm_index] = -getpid(); /* do the real work */ #ifdef EMBEDDEDPERL worker_client(mode, next_shm_index, shmid, start_env); #else worker_client(mode, next_shm_index, shmid); #endif exit(EXIT_SUCCESS); } /* parent */ else if(pid > 0){ signal(SIGINT, clean_exit); signal(SIGTERM,clean_exit); shm[next_shm_index] = -pid; } return GM_OK; } /* parse command line arguments */ int parse_arguments(int argc, char **argv) { int i; int errors = 0; int verify; mod_gm_opt_t * mod_gm_new_opt; mod_gm_new_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_new_opt); for(i=1;iidentifier == NULL) { gethostname(hostname, GM_BUFFERSIZE-1); mod_gm_new_opt->identifier = strdup(hostname); } /* close old logfile */ if(mod_gm_opt->logfile_fp != NULL) { fclose(mod_gm_opt->logfile_fp); mod_gm_opt->logfile_fp = NULL; } /* verify options */ verify = verify_options(mod_gm_new_opt); /* set new options */ if(errors == 0 && verify == GM_OK) { mod_gm_free_opt(mod_gm_opt); mod_gm_opt = mod_gm_new_opt; } /* open new logfile */ 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); errors++; } } /* read keyfile */ if(mod_gm_opt->keyfile != NULL && read_keyfile(mod_gm_opt) != GM_OK) { errors++; } if(verify != GM_OK || errors > 0 || mod_gm_new_opt->debug_level >= GM_LOG_DEBUG) { int old_debug = mod_gm_opt->debug_level; mod_gm_opt->debug_level = GM_LOG_DEBUG; dumpconfig(mod_gm_new_opt, GM_WORKER_MODE); mod_gm_opt->debug_level = old_debug; } if(errors > 0 || verify != GM_OK) { mod_gm_free_opt(mod_gm_new_opt); return(GM_ERROR); } return(GM_OK); } /* verify our option */ int verify_options(mod_gm_opt_t *opt) { /* stdout loggin in daemon mode is pointless */ if( opt->debug_level > GM_LOG_TRACE && opt->daemon_mode == GM_ENABLED) { opt->debug_level = GM_LOG_TRACE; } /* 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); } /* nothing set by hand -> defaults */ if( opt->set_queues_by_hand == 0 ) { gm_log( GM_LOG_DEBUG, "starting client with default queues\n" ); opt->hosts = GM_ENABLED; opt->services = GM_ENABLED; opt->events = GM_ENABLED; } /* do we have queues to serve? */ if( opt->servicegroups_num == 0 && opt->hostgroups_num == 0 && opt->hosts == GM_DISABLED && opt->services == GM_DISABLED && opt->events == GM_DISABLED ) { gm_log( GM_LOG_ERROR, "starting worker without any queues is useless\n" ); return(GM_ERROR); } if(opt->min_worker > opt->max_worker) opt->min_worker = opt->max_worker; /* encryption without key? */ if(opt->encryption == GM_ENABLED) { if(opt->crypt_key == NULL && opt->keyfile == NULL) { gm_log( GM_LOG_ERROR, "no encryption key provided, please use --key=... or keyfile=... or disable encryption\n"); return(GM_ERROR); } } return(GM_OK); } /* print usage */ void print_usage() { printf("Usage: worker [OPTION]...\n"); printf("\n"); printf("Mod-Gearman worker executes host- and servicechecks.\n"); printf("\n"); printf("Basic Settings:\n"); printf(" --debug= \n"); printf(" --logmode= \n"); printf(" --logfile= \n"); printf(" --debug-result \n"); printf(" --help|-h \n"); printf(" --daemon|-d \n"); printf(" --config= \n"); printf(" --server= \n"); printf(" --dupserver= \n"); printf("\n"); printf("Encryption:\n"); printf(" --encryption= \n"); printf(" --key= \n"); printf(" --keyfile= \n"); printf("\n"); printf("Job Control:\n"); printf(" --hosts \n"); printf(" --services \n"); printf(" --eventhandler \n"); printf(" --hostgroup= \n"); printf(" --servicegroup= \n"); printf(" --do_hostchecks \n"); printf(" --max-age= \n"); printf(" --timeout \n"); printf("\n"); printf("Worker Control:\n"); printf(" --min-worker= \n"); printf(" --max-worker= \n"); printf(" --idle-timeout= \n"); printf(" --max-jobs= \n"); printf(" --spawn-rate= \n"); printf(" --fork_on_exec \n"); printf(" --load_limit1=load1 \n"); printf(" --load_limit5=load5 \n"); printf(" --load_limit15=load15 \n"); printf(" --show_error_output \n"); printf("\n"); printf("Embedded Perl:\n"); printf(" --enable_embedded_perl \n"); printf(" --use_embedded_perl_implicitly \n"); printf(" --use_perl_cache \n"); printf(" --p1_file \n"); printf("\n"); printf("Miscellaneous:\n"); printf(" --workaround_rc_25\n"); printf("\n"); printf("see README for a detailed explaination of all options.\n"); printf("\n"); exit( EXIT_SUCCESS ); } /* create shared memory segments */ void setup_child_communicator() { int x; gm_log( GM_LOG_TRACE, "setup_child_communicator()\n"); /* Create the segment. */ mod_gm_shm_key = getpid(); /* use pid as shm key */ if ((shmid = shmget(mod_gm_shm_key, GM_SHM_SIZE, IPC_CREAT | 0600)) < 0) { perror("shmget"); exit( EXIT_FAILURE ); } /* Now we attach the segment to our data space. */ if ((shm = shmat(shmid, NULL, 0)) == (int *) -1) { perror("shmat"); exit( EXIT_FAILURE ); } /* change SHM_SHIFT if more global counters are added */ shm[SHM_JOBS_DONE] = 0; /* done jobs */ shm[SHM_WORKER_TOTAL] = 0; /* total worker */ shm[SHM_WORKER_RUNNING] = 0; /* running worker */ shm[SHM_STATUS_WORKER_PID] = -1; /* status worker pid */ for(x = 0; x < mod_gm_opt->max_worker; x++) { shm[x+SHM_SHIFT] = -1; /* normal worker */ } return; } /* set new number of workers */ int adjust_number_of_worker(int min, int max, int cur_workers, int cur_jobs) { int perc_running; int idle; int target = min; double load[3]; if(cur_workers == 0) { gm_log( GM_LOG_TRACE3, "adjust_number_of_worker(min %d, max %d, worker %d, jobs %d) -> %d\n", min, max, cur_workers, cur_jobs, mod_gm_opt->min_worker); return mod_gm_opt->min_worker; } perc_running = (int)cur_jobs*100/cur_workers; idle = (int)cur_workers - cur_jobs; gm_log( GM_LOG_TRACE3, "adjust_number_of_worker(min %d, max %d, worker %d, jobs %d) = %d%% running\n", min, max, cur_workers, cur_jobs, perc_running); if(cur_workers == max) return max; /* > 90% workers running */ if(cur_jobs > 0 && ( perc_running > 90 || idle <= 2 )) { if (getloadavg(load, 3) == -1) { gm_log( GM_LOG_ERROR, "failed to get current load\n"); perror("getloadavg"); } if(mod_gm_opt->load_limit1 > 0 && load[0] >= mod_gm_opt->load_limit1) { gm_log( GM_LOG_TRACE, "load limit 1min hit, not starting any more workers: %1.2f > %1.2f\n", load[0], mod_gm_opt->load_limit1); return cur_workers; } if(mod_gm_opt->load_limit5 > 0 && load[1] >= mod_gm_opt->load_limit5) { gm_log( GM_LOG_TRACE, "load limit 5min hit, not starting any more workers: %1.2f > %1.2f\n", load[1], mod_gm_opt->load_limit5); return cur_workers; } if(mod_gm_opt->load_limit15 > 0 && load[2] >= mod_gm_opt->load_limit15) { gm_log( GM_LOG_TRACE, "load limit 15min hit, not starting any more workers: %1.2f > %1.2f\n", load[2], mod_gm_opt->load_limit15); return cur_workers; } /* increase target number by spawn rate */ gm_log( GM_LOG_TRACE, "starting %d new workers\n", mod_gm_opt->spawn_rate); target = cur_workers + mod_gm_opt->spawn_rate; } /* dont go over the top */ if(target > max) { target = max; } if(target != cur_workers) gm_log( GM_LOG_TRACE3, "adjust_number_of_worker(min %d, max %d, worker %d, jobs %d) = %d%% running -> %d\n", min, max, cur_workers, cur_jobs, perc_running, target); return target; } /* do a clean exit */ void clean_exit(int sig) { gm_log( GM_LOG_TRACE, "clean_exit(%d)\n", sig); if(mod_gm_opt->pidfile != NULL) unlink(mod_gm_opt->pidfile); /* stop all children */ stop_children(GM_WORKER_STOP); /* detach shm */ if(shmdt(shm) < 0) perror("shmdt"); /* * clean up shared memory * will be removed when last client detaches */ if( shmctl( shmid, IPC_RMID, 0 ) == -1 ) { perror("shmctl"); } else { gm_log( GM_LOG_DEBUG, "shared memory deleted\n"); } gm_log( GM_LOG_INFO, "mod_gearman worker exited\n"); mod_gm_free_opt(mod_gm_opt); exit( EXIT_SUCCESS ); } /* stop all children */ void stop_children(int mode) { int status, chld; int waited = 0; int x; gm_log( GM_LOG_TRACE, "stop_children(%d)\n", mode); /* ignore some signals for now */ signal(SIGTERM, SIG_IGN); signal(SIGINT, SIG_IGN); /* * send term signal to our children * children will finish the current job and exit */ killpg(0, SIGTERM); while(current_number_of_workers > 0) { gm_log( GM_LOG_TRACE, "send SIGTERM\n"); save_kill(shm[SHM_STATUS_WORKER_PID], SIGTERM); for(x=SHM_SHIFT; x < mod_gm_opt->max_worker+SHM_SHIFT; x++) { save_kill(shm[x], SIGTERM); } while((chld = waitpid(-1, &status, WNOHANG)) != -1 && chld > 0) { gm_log( GM_LOG_TRACE, "wait() %d exited with %d\n", chld, status); } if(mode == GM_WORKER_RESTART) break; sleep(1); waited++; if(waited > GM_CHILD_SHUTDOWN_TIMEOUT) { break; } count_current_worker(GM_DISABLED); if(current_number_of_workers == 0) break; gm_log( GM_LOG_TRACE, "still waiting (%d) %d children missing...\n", waited, current_number_of_workers); } if(mode == GM_WORKER_STOP) { killpg(0, SIGINT); count_current_worker(GM_DISABLED); if(current_number_of_workers == 0) return; gm_log( GM_LOG_TRACE, "sending SIGINT...\n"); save_kill(shm[SHM_STATUS_WORKER_PID], SIGINT); for(x=SHM_SHIFT; x < mod_gm_opt->max_worker+SHM_SHIFT; x++) { save_kill(shm[x], SIGINT); } /* wait 3 more seconds*/ if(current_number_of_workers > 0) sleep(3); while((chld = waitpid(-1, &status, WNOHANG)) != -1 && chld > 0) { gm_log( GM_LOG_TRACE, "wait() %d exited with %d\n", chld, status); } /* kill them the hard way */ count_current_worker(GM_DISABLED); if(current_number_of_workers == 0) return; save_kill(shm[SHM_STATUS_WORKER_PID], SIGKILL); for(x=SHM_SHIFT; x < mod_gm_opt->max_worker+SHM_SHIFT; x++) { save_kill(shm[x], SIGKILL); } /* count children a last time */ count_current_worker(GM_DISABLED); if(current_number_of_workers == 0) return; /* this will kill us too */ gm_log( GM_LOG_ERROR, "exiting by SIGKILL...\n"); killpg(0, SIGKILL); } /* restore signal handlers for a clean exit */ signal(SIGINT, clean_exit); signal(SIGTERM,clean_exit); } /* check for pid file and write new one */ int write_pid_file() { FILE *fp; char pid_path[GM_BUFFERSIZE]; /* no pidfile given */ if(mod_gm_opt->pidfile == NULL) return GM_OK; if(file_exists(mod_gm_opt->pidfile)) { fp = fopen(mod_gm_opt->pidfile, "r"); if(fp != NULL) { char *pid; pid = malloc(GM_BUFFERSIZE); if(fgets(pid, GM_BUFFERSIZE, fp) == NULL) perror("fgets"); fclose(fp); pid = trim(pid); gm_log( GM_LOG_INFO, "found pid file for: %s\n", pid); snprintf(pid_path, GM_BUFFERSIZE, "/proc/%s/status", pid); free(pid); if(file_exists(pid_path)) { gm_log( GM_LOG_INFO, "pidfile already exists, cannot start!\n"); return(GM_ERROR); } else { gm_log( GM_LOG_INFO, "removed stale pidfile\n"); unlink(mod_gm_opt->pidfile); } } else { perror(mod_gm_opt->pidfile); gm_log( GM_LOG_INFO, "cannot read pidfile\n"); return(GM_ERROR); } } /* now write new pidfile */ fp = fopen(mod_gm_opt->pidfile,"w+"); if(fp == NULL) { perror(mod_gm_opt->pidfile); gm_log( GM_LOG_ERROR, "cannot write pidfile\n"); return(GM_ERROR); } fprintf(fp, "%d\n", getpid()); fclose(fp); gm_log( GM_LOG_DEBUG, "pid file %s written\n", mod_gm_opt->pidfile ); return GM_OK; } /* store the original command line for later reloads */ int store_original_comandline(int argc, char **argv) { orig_argc = argc; orig_argv = argv; return(GM_OK); } /* try to reload the config */ void reload_config(int sig) { gm_log( GM_LOG_TRACE, "reload_config(%d)\n", sig); if(parse_arguments(orig_argc, orig_argv) != GM_OK) { gm_log( GM_LOG_ERROR, "reload config failed, check your config\n"); return; } /* * restart workers gracefully: * send term signal to our children * children will finish the current job and exit */ stop_children(GM_WORKER_RESTART); /* start status worker */ make_new_child(GM_WORKER_STATUS); /* start normal worker */ check_worker_population(); gm_log( GM_LOG_INFO, "reloading config was successful\n"); return; } /* return and reserve next shm index*/ int get_next_shm_index() { int x; int next_index = 0; gm_log( GM_LOG_TRACE, "get_next_shm_index()\n" ); for(x = SHM_SHIFT; x < mod_gm_opt->max_worker+SHM_SHIFT; x++) { if(shm[x] == -1) { next_index = x; shm[next_index] = 1; break; } } if(next_index == 0) { gm_log(GM_LOG_ERROR, "unable to get next shm id\n"); clean_exit(15); exit(EXIT_FAILURE); } gm_log( GM_LOG_TRACE, "get_next_shm_index() -> %d\n", next_index ); return next_index; } /* kill child */ void save_kill(int pid, int sig) { if(pid < 0) { pid = -pid; } if( pid != 0 && pid != 1 ) { kill(pid, sig); } return; } /* 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()); printf("\n"); exit( STATE_UNKNOWN ); } mod_gearman-1.4.14/worker/initscript.in0000755001161000116100000000516112213031451015012 00000000000000#!/bin/sh # chkconfig: 2345 85 15 # description: Mod-Gearman Worker Daemon ### BEGIN INIT INFO # Provides: mod_gearman_worker # Required-Start: $local_fs # Required-Stop: $local_fs # Should-Start: # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop the Mod-Gearman Worker Daemon ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=%WORKERBIN% NAME=mod_gearman_worker CONFIG=%CONFIG_WORKER% PIDFILE=%PIDFILE% LOCKFILE=/var/lock/subsys/$NAME USER=%USER% USERID=`id -u` # load extra environment variables if [ -f /etc/sysconfig/mod_gearman_worker ]; then . /etc/sysconfig/mod_gearman_worker fi # create state dir if [ "$USERID" -eq 0 ]; then mkdir -p $(dirname $PIDFILE) chown $USER: $(dirname $PIDFILE) fi case "$1" in start) echo -n "Starting $NAME..." CMD="$DAEMON -d --config=$CONFIG --pidfile=$PIDFILE" if [ "$USERID" -eq 0 ]; then su -s $SHELL - $USER -c "$CMD" else $CMD fi if [ $? -eq 0 ]; then if [ "$USERID" -eq 0 ]; then touch $LOCKFILE fi echo "OK" else echo "failed" fi ;; stop) echo -n "Stopping $NAME..." pid=`cat $PIDFILE 2>/dev/null` if [ -z $pid ]; then echo ". Not running." else kill $pid for x in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5; do echo -n "." ps -p $pid > /dev/null 2>&1 && sleep 1; done ps -p $pid > /dev/null 2>&1; if [ $? -ne 0 ]; then rm -f $PIDFILE if [ "$USERID" -eq 0 ]; then rm -f $LOCKFILE fi echo "OK" exit 0; else echo "failed" exit 1; fi fi ;; reload|force-reload) echo "Reloading $NAME configuration files" pid=`cat $PIDFILE 2>/dev/null` if [ "$pid" != "" ]; then kill -HUP $pid fi ;; status) pid=`cat $PIDFILE 2>/dev/null` if [ "$pid" != "" ]; then ps -p $pid > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "$NAME is running with pid $pid" exit 0; fi fi echo "$NAME is not running" exit 1; ;; restart) $0 stop && sleep 1 && $0 start exit $? ;; *) echo "Usage: $NAME {start|stop|status|restart}" exit 1 ;; esac exit 0 mod_gearman-1.4.14/worker/worker_client.c0000644001161000116100000004457012241503526015321 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /* include header */ #include "worker.h" #include "common.h" #include "worker_client.h" #include "utils.h" #include "check_utils.h" #include "gearman_utils.h" #ifdef EMBEDDEDPERL #include "epn_utils.h" #endif char temp_buffer1[GM_BUFFERSIZE]; char temp_buffer2[GM_BUFFERSIZE]; gearman_worker_st worker; gearman_client_st client; gearman_client_st client_dup; pid_t current_pid; gm_job_t * exec_job; int jobs_done = 0; int sleep_time_after_error = 1; int worker_run_mode; int shm_index = 0; volatile sig_atomic_t shmid; /* callback for task completed */ #ifdef EMBEDDEDPERL void worker_client(int worker_mode, int indx, int shid, char **env) { #else void worker_client(int worker_mode, int indx, int shid) { #endif gm_log( GM_LOG_TRACE, "%s worker client started\n", (worker_mode == GM_WORKER_STATUS ? "status" : "job" )); /* set signal handlers for a clean exit */ signal(SIGINT, clean_worker_exit); signal(SIGTERM,clean_worker_exit); worker_run_mode = worker_mode; shm_index = indx; shmid = shid; current_pid = getpid(); gethostname(hostname, GM_BUFFERSIZE-1); /* create worker */ if(set_worker(&worker) != GM_OK) { gm_log( GM_LOG_ERROR, "cannot start worker\n" ); clean_worker_exit(0); _exit( EXIT_FAILURE ); } /* create client */ if ( create_client( mod_gm_opt->server_list, &client ) != GM_OK ) { gm_log( GM_LOG_ERROR, "cannot start client\n" ); clean_worker_exit(0); _exit( EXIT_FAILURE ); } /* create duplicate client */ if( mod_gm_opt->dupserver_num ) { 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 ); } } #ifdef EMBEDDEDPERL if(init_embedded_perl(env) == GM_ERROR) { _exit( EXIT_FAILURE ); } #endif worker_loop(); return; } /* main loop of jobs */ void worker_loop() { while ( 1 ) { gearman_return_t ret; /* wait for a job, otherwise exit when hit the idle timeout */ if(mod_gm_opt->idle_timeout > 0 && ( worker_run_mode == GM_WORKER_MULTI || worker_run_mode == GM_WORKER_STATUS )) { signal(SIGALRM, idle_sighandler); alarm(mod_gm_opt->idle_timeout); } signal(SIGPIPE, SIG_IGN); ret = gearman_worker_work( &worker ); if ( ret != GEARMAN_SUCCESS ) { gm_log( GM_LOG_ERROR, "worker error: %s\n", gearman_worker_error( &worker ) ); gearman_job_free_all( &worker ); gearman_worker_free( &worker ); gearman_client_free( &client ); if( mod_gm_opt->dupserver_num ) gearman_client_free( &client_dup ); /* sleep on error to avoid cpu intensive infinite loops */ sleep(sleep_time_after_error); sleep_time_after_error += 3; if(sleep_time_after_error > 60) sleep_time_after_error = 60; /* create new connections */ set_worker( &worker ); create_client( mod_gm_opt->server_list, &client ); if( mod_gm_opt->dupserver_num ) create_client_dup( mod_gm_opt->dupserver_list, &client_dup ); } } return; } /* get a job */ void *get_job( gearman_job_st *job, void *context, size_t *result_size, gearman_return_t *ret_ptr ) { sigset_t block_mask; int wsize, valid_lines; char workload[GM_BUFFERSIZE]; char * decrypted_data; char * decrypted_data_c; char * decrypted_orig; char *ptr; /* reset timeout for now, will be set befor execution again */ alarm(0); signal(SIGALRM, SIG_IGN); jobs_done++; /* send start signal to parent */ set_state(GM_JOB_START); gm_log( GM_LOG_TRACE, "get_job()\n" ); /* contect is unused */ context = context; /* set size of result */ *result_size = 0; /* reset sleep time */ sleep_time_after_error = 1; /* ignore sigterms while running job */ sigemptyset(&block_mask); sigaddset(&block_mask, SIGTERM); sigprocmask(SIG_BLOCK, &block_mask, NULL); /* get the data */ current_gearman_job = job; wsize = gearman_job_workload_size(job); strncpy(workload, (const char*)gearman_job_workload(job), wsize); workload[wsize] = '\0'; gm_log( GM_LOG_TRACE, "got new job %s\n", gearman_job_handle( job ) ); gm_log( GM_LOG_TRACE, "%d +++>\n%s\n<+++\n", strlen(workload), workload ); /* decrypt data */ decrypted_data = malloc(GM_BUFFERSIZE); decrypted_data_c = decrypted_data; mod_gm_decrypt(&decrypted_data, workload, mod_gm_opt->transportmode); decrypted_orig = strdup(decrypted_data); if(decrypted_data == NULL) { *ret_ptr = GEARMAN_WORK_FAIL; return NULL; } gm_log( GM_LOG_TRACE, "%d --->\n%s\n<---\n", strlen(decrypted_data), decrypted_data ); /* set result pointer to success */ *ret_ptr= GEARMAN_SUCCESS; exec_job = ( gm_job_t * )malloc( sizeof *exec_job ); set_default_job(exec_job, mod_gm_opt); valid_lines = 0; while ( (ptr = strsep(&decrypted_data, "\n" )) != NULL ) { char *key = strsep( &ptr, "=" ); char *value = strsep( &ptr, "\x0" ); if ( key == NULL ) continue; if ( value == NULL || !strcmp( value, "") ) break; if ( !strcmp( key, "host_name" ) ) { exec_job->host_name = strdup(value); valid_lines++; } else if ( !strcmp( key, "service_description" ) ) { exec_job->service_description = strdup(value); valid_lines++; } else if ( !strcmp( key, "type" ) ) { exec_job->type = strdup(value); valid_lines++; } else if ( !strcmp( key, "result_queue" ) ) { exec_job->result_queue = strdup(value); valid_lines++; } else if ( !strcmp( key, "check_options" ) ) { exec_job->check_options = atoi(value); valid_lines++; } else if ( !strcmp( key, "scheduled_check" ) ) { exec_job->scheduled_check = atoi(value); valid_lines++; } else if ( !strcmp( key, "reschedule_check" ) ) { exec_job->reschedule_check = atoi(value); valid_lines++; } else if ( !strcmp( key, "latency" ) ) { exec_job->latency = atof(value); valid_lines++; } else if ( !strcmp( key, "next_check" ) ) { string2timeval(value, &exec_job->next_check); valid_lines++; } else if ( !strcmp( key, "start_time" ) ) { /* for compatibility reasons... (used by older mod-gearman neb modules) */ string2timeval(value, &exec_job->next_check); string2timeval(value, &exec_job->core_time); valid_lines++; } else if ( !strcmp( key, "core_time" ) ) { string2timeval(value, &exec_job->core_time); valid_lines++; } else if ( !strcmp( key, "timeout" ) ) { exec_job->timeout = atoi(value); valid_lines++; } else if ( !strcmp( key, "command_line" ) ) { exec_job->command_line = strdup(value); valid_lines++; } } #ifdef GM_DEBUG if(exec_job->next_check.tv_sec < 10000) write_debug_file(&decrypted_orig); #endif if(valid_lines == 0) { gm_log( GM_LOG_ERROR, "discarded invalid job (%s), check your encryption settings\n", gearman_job_handle( job ) ); } else { do_exec_job(); } current_gearman_job = NULL; /* start listening to SIGTERMs */ sigprocmask(SIG_UNBLOCK, &block_mask, NULL); free(decrypted_orig); free(decrypted_data_c); free_job(exec_job); /* send finish signal to parent */ set_state(GM_JOB_END); if(mod_gm_opt->max_jobs > 0 && jobs_done >= mod_gm_opt->max_jobs) { gm_log( GM_LOG_TRACE, "jobs done: %i -> exiting...\n", jobs_done ); clean_worker_exit(0); _exit( EXIT_SUCCESS ); } return NULL; } /* do some job */ void do_exec_job( ) { struct timeval start_time, end_time; int latency, age; gm_log( GM_LOG_TRACE, "do_exec_job()\n" ); if(exec_job->type == NULL) { gm_log( GM_LOG_ERROR, "discarded invalid job, no type given\n" ); return; } if(exec_job->command_line == NULL) { gm_log( GM_LOG_ERROR, "discarded invalid job, no command line given\n" ); return; } if ( !strcmp( exec_job->type, "service" ) ) { gm_log( GM_LOG_DEBUG, "got service job: %s - %s\n", exec_job->host_name, exec_job->service_description); } else if ( !strcmp( exec_job->type, "host" ) ) { gm_log( GM_LOG_DEBUG, "got host job: %s\n", exec_job->host_name); } else if ( !strcmp( exec_job->type, "eventhandler" ) ) { gm_log( GM_LOG_DEBUG, "got eventhandler job\n"); } /* check proper timeout value */ if( exec_job->timeout <= 0 ) { exec_job->timeout = mod_gm_opt->job_timeout; } /* get the check start time */ gettimeofday(&start_time,NULL); exec_job->start_time = start_time; latency = start_time.tv_sec - exec_job->next_check.tv_sec; age = start_time.tv_sec - exec_job->core_time.tv_sec; gm_log( GM_LOG_TRACE, "timeout: %i, core latency: %i\n", exec_job->timeout, latency); /* job is too old */ if(mod_gm_opt->max_age > 0 && age > mod_gm_opt->max_age) { exec_job->return_code = 3; if ( !strcmp( exec_job->type, "service" ) ) { gm_log( GM_LOG_INFO, "discarded too old %s job: %i > %i (%s - %s)\n", exec_job->type, (int)age, mod_gm_opt->max_age, exec_job->host_name, exec_job->service_description); } else if ( !strcmp( exec_job->type, "host" ) ) { gm_log( GM_LOG_INFO, "discarded too old %s job: %i > %i (%s - %s)\n", exec_job->type, (int)age, mod_gm_opt->max_age, exec_job->host_name); } else { gm_log( GM_LOG_INFO, "discarded too old %s job: %i > %i\n", exec_job->type, (int)age, mod_gm_opt->max_age); } gettimeofday(&end_time, NULL); exec_job->finish_time = end_time; if ( !strcmp( exec_job->type, "service" ) || !strcmp( exec_job->type, "host" ) ) { exec_job->output = strdup("(Could Not Start Check In Time)"); send_result_back(exec_job); } return; } exec_job->early_timeout = 0; /* run the command */ gm_log( GM_LOG_TRACE, "command: %s\n", exec_job->command_line); current_job = exec_job; execute_safe_command(exec_job, mod_gm_opt->fork_on_exec, mod_gm_opt->identifier ); current_job = NULL; if ( !strcmp( exec_job->type, "service" ) || !strcmp( exec_job->type, "host" ) ) { send_result_back(exec_job); } return; } /* create the worker */ int set_worker( gearman_worker_st *w ) { int x = 0; gm_log( GM_LOG_TRACE, "set_worker()\n" ); create_worker( mod_gm_opt->server_list, w ); if(worker_run_mode == GM_WORKER_STATUS) { /* register status function */ char status_queue[GM_BUFFERSIZE]; snprintf(status_queue, GM_BUFFERSIZE, "worker_%s", mod_gm_opt->identifier ); worker_add_function( w, status_queue, return_status ); } else { /* normal worker */ if(mod_gm_opt->hosts == GM_ENABLED) worker_add_function( w, "host", get_job ); if(mod_gm_opt->services == GM_ENABLED) worker_add_function( w, "service", get_job ); if(mod_gm_opt->events == GM_ENABLED) worker_add_function( w, "eventhandler", get_job ); while ( mod_gm_opt->hostgroups_list[x] != NULL ) { char buffer[GM_BUFFERSIZE]; snprintf( buffer, (sizeof(buffer)-1), "hostgroup_%s", mod_gm_opt->hostgroups_list[x] ); worker_add_function( w, buffer, get_job ); x++; } x = 0; while ( mod_gm_opt->servicegroups_list[x] != NULL ) { char buffer[GM_BUFFERSIZE]; snprintf( buffer, (sizeof(buffer)-1), "servicegroup_%s", mod_gm_opt->servicegroups_list[x] ); worker_add_function( w, buffer, get_job ); x++; } } /* add our dummy queue, gearman sometimes forgets the last added queue */ worker_add_function( w, "dummy", dummy); return GM_OK; } /* called when worker runs into exit timeout */ void exit_sighandler(int sig) { gm_log( GM_LOG_TRACE, "exit_sighandler(%i)\n", sig ); _exit( EXIT_SUCCESS ); } /* called when worker runs into idle timeout */ void idle_sighandler(int sig) { gm_log( GM_LOG_TRACE, "idle_sighandler(%i)\n", sig ); clean_worker_exit(0); _exit( EXIT_SUCCESS ); } /* tell parent our state */ void set_state(int status) { int *shm; gm_log( GM_LOG_TRACE, "set_state(%d)\n", status ); if(worker_run_mode == GM_WORKER_STANDALONE) return; /* give us 10 seconds to set state */ signal(SIGALRM, exit_sighandler); alarm(10); /* Now we attach the segment to our data space. */ if ((shm = shmat(shmid, NULL, 0)) == (int *) -1) { perror("shmat"); gm_log( GM_LOG_TRACE, "worker finished: %d\n", getpid() ); clean_worker_exit(0); _exit( EXIT_FAILURE ); } if(status == GM_JOB_START) shm[shm_index] = current_pid; if(status == GM_JOB_END) { shm[SHM_JOBS_DONE]++; /* increase jobs done */ shm[SHM_WORKER_LAST_CHECK] = (int)time(NULL); /* set last job date */ /* status slot changed to -1 -> exit */ if( shm[shm_index] == -1 ) { gm_log( GM_LOG_TRACE, "worker finished: %d\n", getpid() ); clean_worker_exit(0); _exit( EXIT_SUCCESS ); } /* pid in our status slot changed, this should not happen -> exit */ if( shm[shm_index] != current_pid && shm[shm_index] != -current_pid ) { gm_log( GM_LOG_ERROR, "double used worker slot: %d != %d\n", current_pid, shm[shm_index] ); clean_worker_exit(0); _exit( EXIT_FAILURE ); } shm[shm_index] = -current_pid; } /* detach from shared memory */ if(shmdt(shm) < 0) perror("shmdt"); alarm(0); return; } /* do a clean exit */ void clean_worker_exit(int sig) { int *shm; /* give us 30 seconds to stop */ signal(SIGALRM, exit_sighandler); alarm(30); gm_log( GM_LOG_TRACE, "clean_worker_exit(%d)\n", sig); /* clear gearmans job, otherwise it would be retried and retried */ if(current_gearman_job != NULL) { if(sig == SIGINT) { /* if worker stopped with sigint, let the job retry */ } else { send_failed_result(current_job, sig); gearman_job_send_complete(current_gearman_job, NULL, 0); } /* make sure no processes are left over */ kill_child_checks(); } gm_log( GM_LOG_TRACE, "cleaning worker\n"); gearman_worker_unregister_all(&worker); gearman_job_free_all( &worker ); gm_log( GM_LOG_TRACE, "cleaning client\n"); gearman_client_free( &client ); mod_gm_free_opt(mod_gm_opt); #ifdef EMBEDDEDPERL deinit_embedded_perl(0); #endif if(worker_run_mode == GM_WORKER_STANDALONE) exit( EXIT_SUCCESS ); /* Now we attach the segment to our data space. */ if((shm = shmat(shmid, NULL, 0)) == (int *) -1) { perror("shmat"); gm_log( GM_LOG_TRACE, "worker finished: %d\n", getpid() ); _exit( EXIT_FAILURE ); } /* clean our pid from worker list */ if( shm[shm_index] == current_pid || shm[shm_index] == -current_pid ) { shm[shm_index] = -1; } /* detach from shared memory */ if(shmdt(shm) < 0) perror("shmdt"); _exit( EXIT_SUCCESS ); } /* answer status querys */ void *return_status( gearman_job_st *job, void *context, size_t *result_size, gearman_return_t *ret_ptr ) { int wsize; char workload[GM_BUFFERSIZE]; int *shm; char * result; gm_log( GM_LOG_TRACE, "return_status()\n" ); /* contect is unused */ context = context; /* get the data */ wsize = gearman_job_workload_size(job); strncpy(workload, (const char*)gearman_job_workload(job), wsize); workload[wsize] = '\0'; gm_log( GM_LOG_TRACE, "got status job %s\n", gearman_job_handle( job ) ); gm_log( GM_LOG_TRACE, "%d +++>\n%s\n<+++\n", strlen(workload), workload ); /* set result pointer to success */ *ret_ptr= GEARMAN_SUCCESS; /* set size of result */ result = malloc(GM_BUFFERSIZE); *result_size = GM_BUFFERSIZE; /* give us 10 seconds to get state */ signal(SIGALRM, exit_sighandler); alarm(10); /* Now we attach the segment to our data space. */ if ((shm = shmat(shmid, NULL, 0)) == (int *) -1) { perror("shmat"); *result_size = 0; alarm(0); return NULL; } snprintf(result, GM_BUFFERSIZE, "%s has %i worker and is working on %i jobs. Version: %s|worker=%i;;;%i;%i jobs=%ic", hostname, shm[SHM_WORKER_TOTAL], shm[SHM_WORKER_RUNNING], GM_VERSION, shm[SHM_WORKER_TOTAL], mod_gm_opt->min_worker, mod_gm_opt->max_worker, shm[SHM_JOBS_DONE] ); /* and increase job counter */ shm[SHM_JOBS_DONE]++; /* detach from shared memory */ if(shmdt(shm) < 0) perror("shmdt"); alarm(0); return((void*)result); } #ifdef GM_DEBUG /* write text to a debug file */ void write_debug_file(char ** text) { FILE * fd; fd = fopen( "/tmp/mod_gearman_worker.txt", "a+" ); if(fd == NULL) perror("fopen"); fputs( "------------->\n", fd ); fputs( *text, fd ); fputs( "\n<-------------\n", fd ); fclose( fd ); } #endif mod_gearman-1.4.14/worker/mod_gearman_p1.pl0000755001161000116100000002343411727447424015527 00000000000000package Embed::Persistent; # p1.pl for Mod-Gearman use strict; use Text::ParseWords qw(parse_line); use constant LEAVE_MSG => 1; use constant CACHE_DUMP => 2; use constant PLUGIN_DUMP => 4; use constant DEBUG_LEVEL => 0; # use constant DEBUG_LEVEL => CACHE_DUMP ; # use constant DEBUG_LEVEL => LEAVE_MSG ; # use constant DEBUG_LEVEL => LEAVE_MSG | CACHE_DUMP ; # use constant DEBUG_LEVEL => LEAVE_MSG | CACHE_DUMP | PLUGIN_DUMP ; use constant DEBUG_LOG_PATH => './'; use constant LEAVE_MSG_STREAM => DEBUG_LOG_PATH . 'epn_leave-msgs.log'; use constant CACHE_DUMP_STREAM => DEBUG_LOG_PATH . 'epn_cache-dump.log'; use constant PLUGIN_DUMP_STREAM => DEBUG_LOG_PATH . 'epn_plugin-dump.log'; use constant NUMBER_OF_PERL_PLUGINS => 60; # Cache will be dumped every Cache_Dump_Interval plugin compilations use constant Cache_Dump_Interval => 20; ( DEBUG_LEVEL & LEAVE_MSG ) && do { open LH, '>> ' . LEAVE_MSG_STREAM or die "Can't open " . LEAVE_MSG_STREAM . ": $!"; # Unbuffer LH since this will be written by child processes. select( ( select(LH), $| = 1 )[0] ); }; ( DEBUG_LEVEL & CACHE_DUMP ) && do { ( open CH, '>> ' . CACHE_DUMP_STREAM or die "Can't open " . CACHE_DUMP_STREAM . ": $!" ); select( ( select(CH), $| = 1 )[0] ); }; ( DEBUG_LEVEL & PLUGIN_DUMP ) && ( open PH, '>> ' . PLUGIN_DUMP_STREAM or die "Can't open " . PLUGIN_DUMP_STREAM . ": $!" ); require Data::Dumper if DEBUG_LEVEL & CACHE_DUMP; my( %Cache, $Current_Run ); keys %Cache = NUMBER_OF_PERL_PLUGINS; # Offsets in %Cache{$filename} use constant MTIME => 0; use constant PLUGIN_ARGS => 1; use constant PLUGIN_ERROR => 2; use constant PLUGIN_HNDLR => 3; package main; use subs 'CORE::GLOBAL::exit'; sub CORE::GLOBAL::exit { die "ExitTrap: $_[0] (Redefine exit to trap plugin exit with eval BLOCK)" } package OutputTrap; # Methods for use by tied STDOUT in embedded PERL module. # Simply ties STDOUT to a scalar and caches values written to it. # NB No more than 4KB characters per line are kept. sub TIEHANDLE { my($class) = @_; my $me = ''; bless \$me, $class; } sub PRINT { my $self = shift; $$self .= substr( join( '', @_ ), 0, 4096 ); } sub PRINTF { my $self = shift; my $fmt = shift; $$self .= substr( sprintf( $fmt, @_ ), 0, 4096 ); } sub READLINE { my $self = shift; return $$self; } sub CLOSE { my $self = shift; undef $self; } sub DESTROY { my $self = shift; undef $self; } package Embed::Persistent; sub valid_package_name { local $_ = shift; s|([^A-Za-z0-9\/])|sprintf("_%2x",unpack("C",$1))|eg; # second pass only for words starting with a digit s|/(\d)|sprintf("/_%2x",unpack("C",$1))|eg; # Dress it up as a real package name s|/|::|g; return /^::/ ? "Embed$_" : "Embed::$_"; } # Perl 5.005_03 only traps warnings for errors classed by perldiag # as Fatal (eg 'Global symbol """"%s"""" requires explicit package name'). # Therefore treat all warnings as fatal. sub throw_exception { die shift; } sub eval_file { my( $filename, $delete, undef, $plugin_args ) = @_; my $mtime = -M $filename; my $ts = localtime( time() ) if DEBUG_LEVEL; if( exists( $Cache{$filename} ) && $Cache{$filename}[MTIME] && $Cache{$filename}[MTIME] <= $mtime ) { # We have compiled this plugin before and # it has not changed on disk; nothing to do except # 1 parse the plugin arguments and cache them (to save # repeated parsing of the same args) - the same # plugin could be called with different args. # 2 return the error from a former compilation # if there was one. $Cache{$filename}[PLUGIN_ARGS]{$plugin_args} ||= [ parse_line( '\s+', 0, $plugin_args ) ] if $plugin_args; if( $Cache{$filename}[PLUGIN_ERROR] ) { print LH qq($ts eval_file: $filename failed compilation formerly and file has not changed; skipping compilation.\n) if DEBUG_LEVEL & LEAVE_MSG; die qq(**ePN failed to compile $filename: "$Cache{$filename}[PLUGIN_ERROR]"); } else { print LH qq($ts eval_file: $filename already successfully compiled and file has not changed; skipping compilation.\n) if DEBUG_LEVEL & LEAVE_MSG; return $Cache{$filename}[PLUGIN_HNDLR]; } } my $package = valid_package_name($filename); $Cache{$filename}[PLUGIN_ARGS]{$plugin_args} ||= [ parse_line( '\s+', 0, $plugin_args ) ] if $plugin_args; local *FH; # die will be trapped by caller (checking ERRSV) open FH, $filename or die qq(**ePN failed to open "$filename": "$!"); my $sub; sysread FH, $sub, -s FH; close FH; # Cater for scripts that have embedded EOF symbols (__END__) # XXXX # Doesn't make sense to me. # $sub =~ s/__END__/\;}\n__END__/; # Wrap the code into a subroutine inside our unique package # (using $_ here [to save a lexical] is not a good idea since # the definition of the package is visible to any other Perl # code that uses [non localised] $_). my $hndlr = <>> $sub # <<< END of PLUGIN >>> } EOSUB $Cache{$filename}[MTIME] = $mtime unless $delete; # Suppress warning display. local $SIG{__WARN__} = \&throw_exception; # Following 3 lines added 10/18/07 by Larry Low to fix problem where # modified Perl plugins didn't get recached by the epn no strict 'refs'; undef %{ $package . '::' }; use strict 'refs'; # Compile &$package::hndlr. Since non executable code is being eval'd # there is no need to protect lexicals in this scope. eval $hndlr; # $@ is set for any warning and error. # This guarantees that the plugin will not be run. if($@) { # Report error line number wrt to original plugin text (7 lines added by eval_file). # Error text looks like # 'Use of uninitialized ..' at (eval 23) line 186, line 218 # The error line number is 'line 186' chomp($@); $@ =~ s/line (\d+)[\.,]/'line ' . ($1 - 7) . ','/e; print LH qq($ts eval_file: syntax error in $filename: "$@".\n) if DEBUG_LEVEL & LEAVE_MSG; if( DEBUG_LEVEL & PLUGIN_DUMP ) { my $i = 1; $_ = $hndlr; s/^/sprintf('%10d ', $i++)/meg; # Will only get here once (when a faulty plugin is compiled). # Therefore only _faulty_ plugins are dumped once each time the text changes. print PH qq($ts eval_file: transformed plugin "$filename" to ==>\n$_\n); } $@ = substr( $@, 0, 4096 ) if length($@) > 4096; $Cache{$filename}[PLUGIN_ERROR] = $@; # If the compilation fails, leave nothing behind that may affect subsequent # compilations. This will be trapped by caller (checking ERRSV). die qq(**ePN failed to compile $filename: "$@"); } else { $Cache{$filename}[PLUGIN_ERROR] = ''; } print LH qq($ts eval_file: successfully compiled "$filename $plugin_args".\n) if DEBUG_LEVEL & LEAVE_MSG; print CH qq($ts eval_file: after $Current_Run compilations \%Cache =>\n), Data::Dumper->Dump( [ \%Cache ], [qw(*Cache)] ), "\n" if( ( DEBUG_LEVEL & CACHE_DUMP ) && ( ++$Current_Run % Cache_Dump_Interval == 0 ) ); no strict 'refs'; return $Cache{$filename}[PLUGIN_HNDLR] = *{ $package . '::hndlr' }{CODE}; } sub run_package { my( $filename, undef, $plugin_hndlr_cr, $plugin_args ) = @_; # Second parm (after $filename) _may_ be used to wallop stashes. my $has_exit = 0; my $res = 3; my $ts = localtime( time() ) if DEBUG_LEVEL; local $SIG{__WARN__} = \&throw_exception; my $stdout = tie( *STDOUT, 'OutputTrap' ); my @plugin_args = $plugin_args ? @{ $Cache{$filename}[PLUGIN_ARGS]{$plugin_args} } : (); # If the plugin has args, they have been cached by eval_file. # ( cannot cache @plugin_args here because run_package() is # called by child processes so cannot update %Cache.) eval { $plugin_hndlr_cr->(@plugin_args) }; if($@) { # Error => normal plugin termination (exit) || run time error. $_ = $@; /^ExitTrap: (-?\d+)/ ? do {$has_exit = 1; $res = $1} : # For normal plugin exit, $@ will always match /^ExitTrap: (-?\d+)/ /^ExitTrap: / ? do { $has_exit = 1; $res = 0 } : do { # Run time error/abnormal plugin termination. chomp; # Report error line number wrt to original plugin text (7 lines added by eval_file). s/line (\d+)[\.,]/'line ' . ($1 - 7) . ','/e; print STDOUT qq(**ePN $filename: "$_".\n); }; ( $@, $_ ) = ( '', '' ); } # ! Error => Perl code is not a plugin (fell off the end; no exit) # !! (read any output from the tied file handle.) my $plugin_output = ; undef $stdout; untie *STDOUT; $plugin_output = "**ePN $filename: plugin did not call exit()\n".$plugin_output if $has_exit == 0; print LH qq($ts run_package: "$filename $plugin_args" returning ($res, "$plugin_output").\n) if DEBUG_LEVEL & LEAVE_MSG; return ( $res, $plugin_output ); } 1; =head1 SEE ALSO =over 4 =item * perlembed (section on maintaining a persistent interpreter) =back =head1 AUTHOR Originally by Stephen Davies. Now maintained by Stanley Hopcroft who retains responsibility for the 'bad bits'. =head1 COPYRIGHT Copyright (c) 2004 Stanley Hopcroft. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut mod_gearman-1.4.14/Makefile.am0000644001161000116100000003424112236143153013023 00000000000000# vim:ft=automake noexpandtab ############################################################################### # # mod_gearman - distribute checks with gearman # # Copyright (c) 2010 Sven Nierlein # ############################################################################### RPM_TOPDIR=$$(pwd)/rpm.topdir DOS2UNIX=$(shell which dos2unix || which fromdos) .PHONY: docs AM_CPPFLAGS=-Iinclude CFLAGS +=-DDATADIR='"$(datadir)"' OS=$(shell uname) if USEPERL P1FILE = worker/mod_gearman_p1.pl PERLLIB = @PERLLIBS@ perl_objects = common/perlxsi.o common/epn_utils.o install_epnfiles = install_epnfiles EXTRA_mod_gearman_worker_SOURCES=common/perlxsi.c common/epn_utils.c EXTRA_01_utils_SOURCES=common/perlxsi.c common/epn_utils.c EXTRA_02_full_SOURCES=common/perlxsi.c common/epn_utils.c EXTRA_03_exec_SOURCES=common/perlxsi.c common/epn_utils.c EXTRA_06_exec_SOURCES=common/perlxsi.c common/epn_utils.c EXTRA_07_epn_SOURCES=common/perlxsi.c common/epn_utils.c EPN_BIN = mod_gearman_mini_epn else PERLLIB = P1FILE = install_epnfiles = perl_objects = EPN_BIN = endif # source definitions common_SOURCES = common/base64.c \ common/gm_crypt.c \ common/rijndael.c \ common/gearman_utils.c \ common/utils.c \ common/md5.c common_check_SOURCES = common/check_utils.c \ common/popenRWE.c \ worker/worker_client.c pkglib_LIBRARIES = mod_gearman.so mod_gearman_so_SOURCES = $(common_SOURCES) \ neb_module/result_thread.c \ neb_module/mod_gearman.c bin_PROGRAMS = mod_gearman_worker \ send_gearman \ send_multi \ check_gearman \ gearman_top mod_gearman_worker_SOURCES = $(common_SOURCES) \ $(common_check_SOURCES) \ worker/worker.c send_gearman_SOURCES = $(common_SOURCES) \ tools/send_gearman.c send_multi_SOURCES = $(common_SOURCES) \ tools/send_multi.c check_gearman_SOURCES = $(common_SOURCES) \ tools/check_gearman.c gearman_top_SOURCES = $(common_SOURCES) \ tools/gearman_top.c gearman_top_LDADD = -lncurses # tests check_PROGRAMS = 01_utils 02_full 03_exec 04_log 05_neb 06_exec 07_epn 01_utils_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/01-utils.c $(common_check_SOURCES) 02_full_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/02-full.c $(common_check_SOURCES) 03_exec_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/03-exec_checks.c $(common_check_SOURCES) 04_log_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/04-log.c 05_neb_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/05-neb.c if USEBSD 05_neb_LDADD= else 05_neb_LDADD=-ldl endif 05_neb_LDFLAGS = -Wl,--export-dynamic -rdynamic 07_epn_SOURCES = $(common_SOURCES) t/tap.h t/tap.c t/07-epn.c $(common_check_SOURCES) # only used for performance tests 06_exec_SOURCES = $(common_SOURCES) t/06-execvp_vs_popen.c $(common_check_SOURCES) TESTS = $(check_PROGRAMS) t/benchmark.t GEARMANDS=/usr/sbin/gearmand /opt/sbin/gearmand replace_vars = sed -e 's:%CONFIG_WORKER%:$(sysconfdir)/mod_gearman/mod_gearman_worker.conf:g' \ -e 's:%PIDFILE%:$(localstatedir)/mod_gearman/mod_gearman_worker.pid:g' \ -e 's:%LOGFILE_NEB%:$(localstatedir)/log/mod_gearman/mod_gearman_neb.log:g' \ -e 's:%LOGFILE_WORKER%:$(localstatedir)/log/mod_gearman/mod_gearman_worker.log:g' \ -e 's:%P1FILE%:$(datadir)/mod_gearman/mod_gearman_p1.pl:g' \ -e 's:%GPIDFILE%:$(localstatedir)/mod_gearman/gearmand.pid:g' \ -e 's:%GLOGFILE%:$(localstatedir)/mod_gearman/gearmand.log:g' \ -e 's:%WORKERBIN%:$(bindir)/mod_gearman_worker:g' \ -e 's:%USER%:$(user):g' EXTRA_DIST = COPYING etc/*.in extras include \ THANKS README docs/README.html Changes worker/initscript.in \ support/mod_gearman.spec \ t/data/* t/rc t/both t/killer t/sleep t/*.pl t/*.t \ worker/mod_gearman_p1.pl t/test_all.pl t/valgrind_suppress.cfg contrib \ etc/mod_gearman_logrotate include contrib/Makefile.am # other targets mod_gearman.o: $(mod_gearman_so_OBJECTS) $(mod_gearman_so_DEPENDENCIES) @echo ' $$(CC) $<' @if [ "$(OS)" = "Darwin" ]; then \ $(CXX) $(LDFLAGS) -dynamiclib -single_module -undefined dynamic_lookup $(mod_gearman_so_OBJECTS) -o $@ -lpthread -lgearman; \ else \ $(CXX) $(LDFLAGS) -fPIC -shared $(mod_gearman_so_OBJECTS) -o $@ -lpthread -lgearman; \ fi chmod 644 mod_gearman.o @$(RM) mod_gearman.so common/perlxsi.o: @echo ' $$(CC) $<' @depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ $(COMPILE) `perl -MExtUtils::Embed -e ccopts` -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ common/perlxsi.c &&\ $(am__mv) $$depbase.Tpo $$depbase.Po common/epn_utils.o: @echo ' $$(CC) $<' @depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ $(COMPILE) `perl -MExtUtils::Embed -e ccopts` -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ common/epn_utils.c &&\ $(am__mv) $$depbase.Tpo $$depbase.Po mod_gearman_neb.conf-local: @$(replace_vars) etc/mod_gearman_neb.conf.in > etc/mod_gearman_neb.conf mod_gearman_worker.conf-local: @$(replace_vars) etc/mod_gearman_worker.conf.in > etc/mod_gearman_worker.conf initscript-local: @$(replace_vars) worker/initscript.in > worker/initscript gearmand-init-local: @$(replace_vars) extras/gearmand-init.in > extras/gearmand-init @if [ ! -z $$(which gearmand 2>/dev/null) ]; then \ sed -i -e "s:%GEARMAND%:$$(which gearmand 2>/dev/null):g" extras/gearmand-init; \ fi @for gearm in $(GEARMANDS); do \ test -f $$gearm && sed -i -e "s:%GEARMAND%:$$gearm:g" extras/gearmand-init ; \ done; echo done @sed -i -e 's:%GEARMAND%:/usr/sbin/gearmand:g' extras/gearmand-init @chmod 755 extras/gearmand-init all-local: mod_gearman.o initscript-local mod_gearman_neb.conf-local mod_gearman_worker.conf-local gearmand-init-local $(EPN_BIN) @echo "" @echo "################################################################" @echo "" @echo " the following files have been created:" @echo "" @echo " mod_gearman.o" @echo " mod_gearman_worker" @echo " worker/initscript" @echo " etc/mod_gearman_neb.conf" @echo " etc/mod_gearman_worker.conf" @[ "$(P1FILE)" = "" ] || echo " $(P1FILE)" @[ "$(EPN_BIN)" = "" ] || echo " $(EPN_BIN)" @echo "" @echo " read the README for configuration details" @echo "" @echo " for a normal installation continue with" @echo " make install" @echo "" @echo "################################################################" distclean-local: clean $(RM) -rf .deps/ Makefile.in aclocal.m4 autom4te.cache config.* configure depcomp install-sh missing *.gz contrib/.deps/ contrib/.dirstamp clean-local: $(RM) -f worker.static worker/initscript etc/mod_gearman.conf rpm.topdir *.o */*.o extras/gearmand-init etc/mod_gearman_neb.conf etc/mod_gearman_worker.conf mod_gearman_mini_epn perlxsi.c worker.static: worker @echo "################################################################" @echo "" @echo " if the static compiler complains about 'cannot find -lgearman', you have to" @echo " compile libgearman with -static" @echo "" @echo "################################################################" cd worker && $(CC) $(LDFLAGS) $(CFLAGS) -static -o worker.static $(worker_OBJECTS) -lgearman -lpthread -luuid @echo "" @echo " worker.static created." @echo "" install-exec-local: install-local-state-dir $(install_sh_PROGRAM) -m 644 mod_gearman.o $(DESTDIR)$(pkglibdir)/mod_gearman.o $(install_sh_PROGRAM) -m 755 worker/initscript $(DESTDIR)$(initrddir)/mod_gearman_worker $(install_sh_PROGRAM) -m 755 extras/gearmand-init $(DESTDIR)$(initrddir)/gearmand install-local-state-dir: $(install_sh_PROGRAM) -d $(DESTDIR)$(localstatedir)/mod_gearman/ install_epnfiles: $(install_sh_PROGRAM) -m 755 $(P1FILE) $(DESTDIR)$(datadir)/mod_gearman/mod_gearman_p1.pl $(install_sh_PROGRAM) -m 755 $(EPN_BIN) $(DESTDIR)$(bindir)/mod_gearman_mini_epn @echo "################################################################" @echo " Installation completed:" @echo " p1file: $(DESTDIR)$(datadir)/mod_gearman/mod_gearman_p1.pl" @echo "################################################################" install-data-local: install-local-state-dir $(install_epnfiles) $(install_sh_PROGRAM) -d $(DESTDIR)$(localstatedir)/log/mod_gearman $(install_sh_PROGRAM) -m 644 extras/shared.conf $(DESTDIR)$(datadir)/mod_gearman/shared.conf $(install_sh_PROGRAM) -m 644 extras/standalone_worker.conf $(DESTDIR)$(datadir)/mod_gearman/standalone_worker.conf $(install_sh_PROGRAM) -m 644 contrib/gearman_proxy.pl $(DESTDIR)$(datadir)/mod_gearman/gearman_proxy.pl @echo "" @echo "################################################################" @echo "" @echo " Installation completed:" @echo " neb module: $(DESTDIR)$(pkglibdir)/mod_gearman.o" @echo "" @echo " worker: $(DESTDIR)$(bindir)/mod_gearman_worker" @echo " init script: $(DESTDIR)$(initrddir)/mod_gearman_worker" @[ "$(EPN_BIN)" = "" ] || echo " mini-epn: $(DESTDIR)$(bindir)/mod_gearman_mini_epn" @echo "" @echo " check bin: $(DESTDIR)$(bindir)/check_gearman" @echo " send bin: $(DESTDIR)$(bindir)/send_gearman" @echo " send multi bin: $(DESTDIR)$(bindir)/send_multi" @echo "" @echo "just add the broker line to your nagios.cfg:" @echo "broker_module=$(DESTDIR)$(pkglibdir)/mod_gearman.o config=$(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf" @echo "" @if [ -e $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf -o -e $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_worker.conf ]; then \ echo " install default config with"; \ echo ""; \ echo " make install-config"; \ echo ""; \ else \ make install-config; \ fi $(RM) $(DESTDIR)$(pkglibdir)/mod_gearman.so install-config: $(install_sh_PROGRAM) -m 644 etc/mod_gearman_neb.conf $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf $(install_sh_PROGRAM) -m 644 etc/mod_gearman_worker.conf $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_worker.conf $(install_sh_PROGRAM) -m 644 etc/mod_gearman_logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/mod_gearman @echo "################################################################" @echo "" @echo " configuration:" @echo " neb module: $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_neb.conf" @echo " worker: $(DESTDIR)$(sysconfdir)/mod_gearman/mod_gearman_worker.conf" @echo " logrotate.d: $(DESTDIR)$(sysconfdir)/logrotate.d/mod_gearman" @echo "" @echo "################################################################" test: check @echo "################################################################" @echo "" @echo " All tests completed successfully" @echo "" @echo "################################################################" fulltest: ./t/test_all.pl @echo "################################################################" @echo "" @echo " Full tests completed successfully" @echo "" @echo "################################################################" docs: @if [ -z "$(DOS2UNIX)" ]; then \ printf "\n\n**** please install dos2unix or tofrodos package ****\n\n"; \ exit 1; \ fi @if [ `type doxygen > /dev/null 2>&1` ]; then \ doxygen Doxyfile; \ else \ printf "\n\n**** please install doxygen to generate doxygen docs ****\n\n"; \ fi; $(RM) docs/images cd docs && ln -s /usr/share/asciidoc/images . cp -p README.asciidoc docs/README && cd docs && asciidoc --unsafe -a toc -a toclevels=2 -a max-width=800 README chmod 644 docs/README.html $(DOS2UNIX) docs/README.html ./replace_doc_toc.pl docs/README.html $(RM) -f docs/README rpm: dist mkdir -p $(RPM_TOPDIR)/{SOURCES,BUILD,RPMS,SRPMS,SPECS} cp mod_gearman-$(VERSION).tar.gz $(RPM_TOPDIR)/SOURCES rpmbuild -ba --define "_topdir $(RPM_TOPDIR)" \ --buildroot=$$(pwd)/rpm.buildroot support/mod_gearman.spec mv -v $(RPM_TOPDIR)/RPMS/*/*.rpm . mv -v $(RPM_TOPDIR)/SRPMS/*.src.rpm . $(RM) -f $(RPM_TOPDIR) rpm.buildroot deb: dpkg-buildpackage -us -uc mrproper: git clean -xfd version: if [ -z "$$NEWVERSION" ]; then NEWVERSION=$$(dialog --stdout --inputbox "New Version:" 0 0 "$(VERSION)"); fi; \ if [ -n "$$NEWVERSION" ] && [ "$$NEWVERSION" != "$(VERSION)" ]; then \ sed -ri "s/$(VERSION)/$$NEWVERSION/" include/common.h configure.ac support/mod_gearman.spec; \ sed -i Changes -e "s/$(VERSION)/$$NEWVERSION $(shell date)\n - ...\n\n$(VERSION)/"; \ $(MAKE) docs; \ fi; # order does matter for perl libs/includes (at least on centos 5) mod_gearman_worker$(EXEEXT): $(mod_gearman_worker_OBJECTS) $(perl_objects) $(mod_gearman_worker_DEPENDENCIES) @rm -f mod_gearman_worker$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(mod_gearman_worker_OBJECTS) $(perl_objects) $(mod_gearman_worker_LDADD) $(LIBS) $(PERLLIB) 01_utils$(EXEEXT): $(01_utils_OBJECTS) $(perl_objects) $(01_utils_DEPENDENCIES) @rm -f 01_utils$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(01_utils_OBJECTS) $(perl_objects) $(01_utils_LDADD) $(LIBS) $(PERLLIB) 02_full$(EXEEXT): $(02_full_OBJECTS) $(perl_objects) $(02_full_DEPENDENCIES) @rm -f 02_full$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(02_full_OBJECTS) $(perl_objects) $(02_full_LDADD) $(LIBS) $(PERLLIB) 03_exec$(EXEEXT): $(03_exec_OBJECTS) $(perl_objects) $(03_exec_DEPENDENCIES) @rm -f 03_exec$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(03_exec_OBJECTS) $(perl_objects) $(03_exec_LDADD) $(LIBS) $(PERLLIB) 06_exec$(EXEEXT): $(06_exec_OBJECTS) $(perl_objects) $(06_exec_DEPENDENCIES) @rm -f 06_exec$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(06_exec_OBJECTS) $(perl_objects) $(06_exec_LDADD) $(LIBS) $(PERLLIB) 07_epn$(EXEEXT): $(07_epn_OBJECTS) $(perl_objects) $(07_epn_DEPENDENCIES) @rm -f 07_epn$(EXEEXT) $(CCLD) $(AM_CFLAGS) $(CFLAGS) -o $@ $(07_epn_OBJECTS) $(perl_objects) $(07_epn_LDADD) $(LIBS) $(PERLLIB) mod_gearman-1.4.14/neb_module/0000755001161000116100000000000012241511662013154 500000000000000mod_gearman-1.4.14/neb_module/mod_gearman.c0000644001161000116100000014254312236563503015527 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /* include header */ #include "result_thread.h" #include "mod_gearman.h" #include "gearman_utils.h" /* specify event broker API version (required) */ NEB_API_VERSION( CURRENT_NEB_API_VERSION ) /* import some global variables */ extern int event_broker_options; extern int currently_running_host_checks; extern int currently_running_service_checks; extern int service_check_timeout; extern int host_check_timeout; extern timed_event * event_list_low; extern timed_event * event_list_low_tail; extern int process_performance_data; extern check_result check_result_info; extern check_result * check_result_list; /* global variables */ static check_result * mod_gm_result_list = 0; static pthread_mutex_t mod_gm_result_list_mutex = PTHREAD_MUTEX_INITIALIZER; void *gearman_module_handle=NULL; gearman_client_st client; int send_now, result_threads_running; pthread_t result_thr[GM_LISTSIZE]; char target_queue[GM_BUFFERSIZE]; char temp_buffer[GM_BUFFERSIZE]; char uniq[GM_BUFFERSIZE]; static void register_neb_callbacks(void); static int read_arguments( const char * ); static int verify_options(mod_gm_opt_t *opt); static int handle_host_check( int,void * ); static int handle_svc_check( int,void * ); static int handle_eventhandler( int,void * ); static int handle_perfdata(int e, void *); static int handle_export(int e, void *); static void set_target_queue( host *, service * ); static int handle_process_events( int, void * ); static int handle_timed_events( int, void * ); static void start_threads(void); static check_result * merge_result_lists(check_result * lista, check_result * listb); static void move_results_to_core(void); int nebmodule_init( int flags, char *args, nebmodule *handle ) { int i; int broker_option_errors = 0; send_now = FALSE; result_threads_running = 0; /* save our handle */ 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_AUTHOR, "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); /* parse arguments */ gm_log( GM_LOG_DEBUG, "Version %s\n", GM_VERSION ); gm_log( GM_LOG_DEBUG, "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() ); if( read_arguments( args ) == GM_ERROR ) return NEB_ERROR; /* check for minimum eventbroker options */ if(!(event_broker_options & BROKER_PROGRAM_STATE)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_PROGRAM_STATE (%i) event_broker_options enabled to work\n", BROKER_PROGRAM_STATE ); broker_option_errors++; } if(!(event_broker_options & BROKER_TIMED_EVENTS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_TIMED_EVENTS (%i) event_broker_options enabled to work\n", BROKER_TIMED_EVENTS ); broker_option_errors++; } if( ( mod_gm_opt->perfdata == GM_ENABLED || mod_gm_opt->hostgroups_num > 0 || mod_gm_opt->hosts == GM_ENABLED ) && !(event_broker_options & BROKER_HOST_CHECKS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_HOST_CHECKS (%i) event_broker_options enabled to work\n", BROKER_HOST_CHECKS ); broker_option_errors++; } if( ( mod_gm_opt->perfdata == GM_ENABLED || mod_gm_opt->servicegroups_num > 0 || mod_gm_opt->services == GM_ENABLED ) && !(event_broker_options & BROKER_SERVICE_CHECKS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_SERVICE_CHECKS (%i) event_broker_options enabled to work\n", BROKER_SERVICE_CHECKS ); broker_option_errors++; } if(mod_gm_opt->events == GM_ENABLED && !(event_broker_options & BROKER_EVENT_HANDLERS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_EVENT_HANDLERS (%i) event_broker option enabled to work\n", BROKER_EVENT_HANDLERS ); broker_option_errors++; } if(broker_option_errors > 0) return NEB_ERROR; /* check the minimal gearman version */ if((float)atof(gearman_version()) < (float)GM_MIN_LIB_GEARMAN_VERSION) { gm_log( GM_LOG_ERROR, "minimum version of libgearman is %.2f, yours is %.2f\n", (float)GM_MIN_LIB_GEARMAN_VERSION, (float)atof(gearman_version()) ); return NEB_ERROR; } /* init crypto functions */ if(mod_gm_opt->encryption == GM_ENABLED) { if(mod_gm_opt->crypt_key == NULL) { gm_log( GM_LOG_ERROR, "no encryption key provided, please use --key=... or keyfile=...\n"); return NEB_ERROR; } mod_gm_crypt_init(mod_gm_opt->crypt_key); } else { mod_gm_opt->transportmode = GM_ENCODE_ONLY; } /* create client */ if ( create_client( mod_gm_opt->server_list, &client ) != GM_OK ) { gm_log( GM_LOG_ERROR, "cannot start client\n" ); return NEB_ERROR; } /* register callback for process event where everything else starts */ neb_register_callback( NEBCALLBACK_PROCESS_DATA, gearman_module_handle, 0, handle_process_events ); neb_register_callback( NEBCALLBACK_TIMED_EVENT_DATA, gearman_module_handle, 0, handle_timed_events ); /* register export callbacks */ for(i=0;iexports[i]->elem_number > 0) neb_register_callback( i, gearman_module_handle, 0, handle_export ); } /* log at least one line into the core logfile */ if ( mod_gm_opt->logmode != GM_LOG_MODE_CORE ) { int logmode_saved = mod_gm_opt->logmode; mod_gm_opt->logmode = GM_LOG_MODE_CORE; gm_log( GM_LOG_INFO, "initialized version %s (libgearman %s)\n", GM_VERSION, gearman_version() ); mod_gm_opt->logmode = logmode_saved; } gm_log( GM_LOG_DEBUG, "finished initializing\n" ); return NEB_OK; } /* register eventhandler callback */ static void register_neb_callbacks(void) { /* only if we have hostgroups defined or general hosts enabled */ if ( mod_gm_opt->do_hostchecks == GM_ENABLED && ( mod_gm_opt->hostgroups_num > 0 || mod_gm_opt->hosts == GM_ENABLED || mod_gm_opt->queue_cust_var )) neb_register_callback( NEBCALLBACK_HOST_CHECK_DATA, gearman_module_handle, 0, handle_host_check ); /* only if we have groups defined or general services enabled */ if ( mod_gm_opt->servicegroups_num > 0 || mod_gm_opt->hostgroups_num > 0 || mod_gm_opt->services == GM_ENABLED || mod_gm_opt->queue_cust_var ) neb_register_callback( NEBCALLBACK_SERVICE_CHECK_DATA, gearman_module_handle, 0, handle_svc_check ); if ( mod_gm_opt->events == GM_ENABLED ) neb_register_callback( NEBCALLBACK_EVENT_HANDLER_DATA, gearman_module_handle, 0, handle_eventhandler ); if ( mod_gm_opt->perfdata == GM_ENABLED ) { if(process_performance_data == 0) gm_log( GM_LOG_INFO, "Warning: process_performance_data is disabled globally, cannot process performance data\n" ); neb_register_callback( NEBCALLBACK_HOST_CHECK_DATA, gearman_module_handle, 0, handle_perfdata ); neb_register_callback( NEBCALLBACK_SERVICE_CHECK_DATA, gearman_module_handle, 0, handle_perfdata ); } gm_log( GM_LOG_DEBUG, "registered neb callbacks\n" ); } /* deregister all events */ int nebmodule_deinit( int flags, int reason ) { int x; gm_log( GM_LOG_TRACE, "nebmodule_deinit(%i, %i)\n", flags, reason ); /* should be removed already, but just for the case it wasn't */ neb_deregister_callback( NEBCALLBACK_PROCESS_DATA, gearman_module_handle ); neb_deregister_callback( NEBCALLBACK_TIMED_EVENT_DATA, gearman_module_handle ); /* only if we have hostgroups defined or general hosts enabled */ if ( mod_gm_opt->do_hostchecks == GM_ENABLED && ( mod_gm_opt->hostgroups_num > 0 || mod_gm_opt->hosts == GM_ENABLED )) neb_deregister_callback( NEBCALLBACK_HOST_CHECK_DATA, gearman_module_handle ); /* only if we have groups defined or general services enabled */ if ( mod_gm_opt->servicegroups_num > 0 || mod_gm_opt->hostgroups_num > 0 || mod_gm_opt->services == GM_ENABLED ) neb_deregister_callback( NEBCALLBACK_SERVICE_CHECK_DATA, gearman_module_handle ); if ( mod_gm_opt->events == GM_ENABLED ) neb_deregister_callback( NEBCALLBACK_EVENT_HANDLER_DATA, gearman_module_handle ); if ( mod_gm_opt->perfdata == GM_ENABLED ) { neb_deregister_callback( NEBCALLBACK_HOST_CHECK_DATA, gearman_module_handle ); neb_deregister_callback( NEBCALLBACK_SERVICE_CHECK_DATA, gearman_module_handle ); } /* register export callbacks */ for(x=0;xexports[x]->elem_number > 0) neb_deregister_callback( x, gearman_module_handle ); } neb_deregister_callback( NEBCALLBACK_PROCESS_DATA, gearman_module_handle ); gm_log( GM_LOG_DEBUG, "deregistered callbacks\n" ); /* stop result threads */ for(x = 0; x < result_threads_running; x++) { pthread_cancel(result_thr[x]); pthread_join(result_thr[x], NULL); } /* cleanup */ free_client(&client); /* close old logfile */ if(mod_gm_opt->logfile_fp != NULL) { fclose(mod_gm_opt->logfile_fp); } mod_gm_free_opt(mod_gm_opt); return NEB_OK; } /* handle timed events */ static int handle_timed_events( int event_type, void *data ) { nebstruct_timed_event_data * ted = (nebstruct_timed_event_data *)data; /* sanity checks */ if (event_type != NEBCALLBACK_TIMED_EVENT_DATA || ted == 0) return NEB_ERROR; /* we only care about REAPER events */ if (ted->event_type != EVENT_CHECK_REAPER) return NEB_OK; gm_log( GM_LOG_TRACE, "handle_timed_events(%i, data)\n", event_type, ted->event_type ); move_results_to_core(); return NEB_OK; } /* merge results with core */ static check_result * merge_result_lists(check_result * lista, check_result * listb) { check_result * result = 0; check_result ** iter; for (iter = &result; lista && listb; iter = &(*iter)->next) { if (mod_gm_time_compare(&lista->finish_time, &listb->finish_time) <= 0) { *iter = lista; lista = lista->next; } else { *iter = listb; listb = listb->next; } } *iter = lista? lista: listb; return result; } /* insert results list into core */ static void move_results_to_core() { check_result * local; /* safely save off currently local list */ pthread_mutex_lock(&mod_gm_result_list_mutex); local = mod_gm_result_list; mod_gm_result_list = 0; pthread_mutex_unlock(&mod_gm_result_list_mutex); /* merge local into check_result_list, store in check_result_list */ check_result_list = merge_result_lists(local, check_result_list); } /* add list to gearman result list */ void mod_gm_add_result_to_list(check_result * newcr) { check_result ** curp; assert(newcr); pthread_mutex_lock(&mod_gm_result_list_mutex); for (curp = &mod_gm_result_list; *curp; curp = &(*curp)->next) if (mod_gm_time_compare(&(*curp)->finish_time, &newcr->finish_time) >= 0) break; newcr->next = *curp; *curp = newcr; pthread_mutex_unlock(&mod_gm_result_list_mutex); } /* handle process events */ static int handle_process_events( int event_type, void *data ) { int x=0; struct nebstruct_process_struct *ps; gm_log( GM_LOG_TRACE, "handle_process_events(%i, data)\n", event_type ); ps = ( struct nebstruct_process_struct * )data; if ( ps->type == NEBTYPE_PROCESS_EVENTLOOPSTART ) { register_neb_callbacks(); start_threads(); send_now = TRUE; /* verify names of supplied groups * this cannot be done befor nagios has finished reading his config * verify local servicegroups names */ while ( mod_gm_opt->local_servicegroups_list[x] != NULL ) { servicegroup * temp_servicegroup = find_servicegroup( mod_gm_opt->local_servicegroups_list[x] ); if( temp_servicegroup == NULL ) { gm_log( GM_LOG_INFO, "Warning: servicegroup '%s' does not exist, possible typo?\n", mod_gm_opt->local_servicegroups_list[x] ); } x++; } /* verify local hostgroup names */ x = 0; while ( mod_gm_opt->local_hostgroups_list[x] != NULL ) { hostgroup * temp_hostgroup = find_hostgroup( mod_gm_opt->local_hostgroups_list[x] ); if( temp_hostgroup == NULL ) { gm_log( GM_LOG_INFO, "Warning: hostgroup '%s' does not exist, possible typo?\n", mod_gm_opt->local_hostgroups_list[x] ); } x++; } /* verify servicegroups names */ x = 0; while ( mod_gm_opt->servicegroups_list[x] != NULL ) { servicegroup * temp_servicegroup = find_servicegroup( mod_gm_opt->servicegroups_list[x] ); if( temp_servicegroup == NULL ) { gm_log( GM_LOG_INFO, "Warning: servicegroup '%s' does not exist, possible typo?\n", mod_gm_opt->servicegroups_list[x] ); } x++; } /* verify hostgroup names */ x = 0; while ( mod_gm_opt->hostgroups_list[x] != NULL ) { hostgroup * temp_hostgroup = find_hostgroup( mod_gm_opt->hostgroups_list[x] ); if( temp_hostgroup == NULL ) { gm_log( GM_LOG_INFO, "Warning: hostgroup '%s' does not exist, possible typo?\n", mod_gm_opt->hostgroups_list[x] ); } x++; } } return NEB_OK; } /* handle eventhandler events */ static int handle_eventhandler( int event_type, void *data ) { nebstruct_event_handler_data * ds; host * hst = NULL; service * svc = NULL; struct timeval core_time; gettimeofday(&core_time,NULL); gm_log( GM_LOG_TRACE, "handle_eventhandler(%i, data)\n", event_type ); if ( event_type != NEBCALLBACK_EVENT_HANDLER_DATA ) return NEB_OK; ds = ( nebstruct_event_handler_data * )data; if ( ds->type != NEBTYPE_EVENTHANDLER_START ) { gm_log( GM_LOG_TRACE, "skiped type %i, expecting: %i\n", ds->type, NEBTYPE_EVENTHANDLER_START ); return NEB_OK; } gm_log( GM_LOG_DEBUG, "got eventhandler event\n" ); gm_log( GM_LOG_TRACE, "got eventhandler event: %s\n", ds->command_line ); /* service event handler? */ if(ds->service_description != NULL) { if((svc=ds->object_ptr)==NULL) { gm_log( GM_LOG_ERROR, "Eventhandler handler received NULL service object pointer.\n" ); return NEB_OK; } if((hst=svc->host_ptr)==NULL) { gm_log( GM_LOG_ERROR, "Service handler received NULL host object pointer.\n" ); return NEB_OK; } } else { if((hst=ds->object_ptr)==NULL) { gm_log( GM_LOG_ERROR, "Host handler received NULL host object pointer.\n" ); return NEB_OK; } } /* local eventhandler? */ set_target_queue( hst, svc ); if(!strcmp( target_queue, "" )) { if(svc != NULL) { gm_log( GM_LOG_DEBUG, "passing by local service eventhandler: %s - %s\n", svc->host_name, svc->description ); } else { gm_log( GM_LOG_DEBUG, "passing by local host eventhandler: %s\n", hst->name ); } return NEB_OK; } if(mod_gm_opt->route_eventhandler_like_checks != GM_ENABLED || !strcmp( target_queue, "host" ) || !strcmp( target_queue, "service" )) { target_queue[0] = '\x0'; snprintf( target_queue, GM_BUFFERSIZE-1, "eventhandler" ); } gm_log( GM_LOG_DEBUG, "eventhandler for queue %s\n", target_queue ); temp_buffer[0]='\x0'; snprintf( temp_buffer,GM_BUFFERSIZE-1, "type=eventhandler\nstart_time=%i.0\ncore_time=%i.%i\ncommand_line=%s\n\n\n", (int)core_time.tv_sec, (int)core_time.tv_sec, (int)core_time.tv_usec, ds->command_line ); if(add_job_to_queue( &client, mod_gm_opt->server_list, target_queue, NULL, temp_buffer, GM_JOB_PRIO_NORMAL, GM_DEFAULT_JOB_RETRIES, mod_gm_opt->transportmode, FALSE ) == GM_OK) { gm_log( GM_LOG_TRACE, "handle_eventhandler() finished successfully\n" ); } else { gm_log( GM_LOG_TRACE, "handle_eventhandler() finished unsuccessfully\n" ); } /* tell nagios to not execute */ return NEBERROR_CALLBACKOVERRIDE; } /* handle host check events */ static int handle_host_check( int event_type, void *data ) { nebstruct_host_check_data * hostdata; char *raw_command=NULL; char *processed_command=NULL; host * hst; check_result * chk_result; int check_options; struct timeval core_time; struct tm next_check; char buffer1[GM_BUFFERSIZE]; gettimeofday(&core_time,NULL); gm_log( GM_LOG_TRACE, "handle_host_check(%i)\n", event_type ); if ( mod_gm_opt->do_hostchecks != GM_ENABLED ) return NEB_OK; hostdata = ( nebstruct_host_check_data * )data; gm_log( GM_LOG_TRACE, "---------------\nhost Job -> %i, %i\n", event_type, hostdata->type ); if ( event_type != NEBCALLBACK_HOST_CHECK_DATA ) return NEB_OK; /* ignore non-initiate host checks */ if ( hostdata->type != NEBTYPE_HOSTCHECK_ASYNC_PRECHECK && hostdata->type != NEBTYPE_HOSTCHECK_SYNC_PRECHECK) return NEB_OK; /* shouldn't happen - internal Nagios error */ if ( hostdata == 0 ) { gm_log( GM_LOG_ERROR, "Host handler received NULL host data structure.\n" ); return NEB_OK; } /* get objects and set target function */ 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? */ if(!strcmp( target_queue, "" )) { gm_log( GM_LOG_DEBUG, "passing by local hostcheck: %s\n", hostdata->host_name ); return NEB_OK; } gm_log( GM_LOG_DEBUG, "received job for queue %s: %s\n", target_queue, hostdata->host_name ); /* as we have to intercept host checks so early * (we cannot cancel checks otherwise) * we have to do some host check logic here * taken from checks.c: */ /* clear check options - we don't want old check options retained */ check_options = hst->check_options; hst->check_options = CHECK_OPTION_NONE; /* unset the freshening flag, otherwise only the first freshness check would be run */ hst->is_being_freshened=FALSE; /* adjust host check attempt */ adjust_host_check_attempt_3x(hst,TRUE); temp_buffer[0]='\x0'; /* grab the host macro variables */ clear_volatile_macros(); grab_host_macros(hst); /* get the raw command line */ get_raw_command_line(hst->check_command_ptr,hst->host_check_command,&raw_command,0); if(raw_command==NULL){ gm_log( GM_LOG_ERROR, "Raw check command for host '%s' was NULL - aborting.\n",hst->name ); return NEBERROR_CALLBACKCANCEL; } /* process any macros contained in the argument */ process_macros(raw_command,&processed_command,0); if(processed_command==NULL){ gm_log( GM_LOG_ERROR, "Processed check command for host '%s' was NULL - aborting.\n",hst->name); return NEBERROR_CALLBACKCANCEL; } /* log latency */ if(mod_gm_opt->debug_level >= GM_LOG_DEBUG) { localtime_r(&hst->next_check, &next_check); strftime(buffer1, sizeof(buffer1), "%Y-%m-%d %H:%M:%S", &next_check ); gm_log( GM_LOG_DEBUG, "host: '%s', next_check is at %s, latency so far: %i\n", hst->name, buffer1, ((int)core_time.tv_sec - (int)hst->next_check)); } /* increment number of host checks that are currently running */ currently_running_host_checks++; /* set the execution flag */ hst->is_executing=TRUE; gm_log( GM_LOG_TRACE, "cmd_line: %s\n", processed_command ); snprintf( temp_buffer,GM_BUFFERSIZE-1,"type=host\nresult_queue=%s\nhost_name=%s\nstart_time=%i.0\nnext_check=%i.0\ntimeout=%d\ncore_time=%i.%i\ncommand_line=%s\n\n\n", mod_gm_opt->result_queue, hst->name, (int)hst->next_check, (int)hst->next_check, host_check_timeout, (int)core_time.tv_sec, (int)core_time.tv_usec, processed_command ); if(add_job_to_queue( &client, mod_gm_opt->server_list, target_queue, (mod_gm_opt->use_uniq_jobs == GM_ENABLED ? hst->name : NULL), temp_buffer, GM_JOB_PRIO_NORMAL, GM_DEFAULT_JOB_RETRIES, mod_gm_opt->transportmode, TRUE ) == GM_OK) { } else { my_free(raw_command); my_free(processed_command); /* unset the execution flag */ hst->is_executing=FALSE; /* decrement number of host checks that are currently running */ currently_running_host_checks--; gm_log( GM_LOG_TRACE, "handle_host_check() finished unsuccessfully -> %d\n", NEBERROR_CALLBACKCANCEL ); return NEBERROR_CALLBACKCANCEL; } /* clean up */ my_free(raw_command); my_free(processed_command); /* orphaned check - submit fake result to mark host as orphaned */ if(mod_gm_opt->orphan_host_checks == GM_ENABLED && check_options & CHECK_OPTION_ORPHAN_CHECK) { gm_log( GM_LOG_DEBUG, "host check for %s orphaned\n", hst->name ); if ( ( chk_result = ( check_result * )malloc( sizeof *chk_result ) ) == 0 ) return NEBERROR_CALLBACKCANCEL; snprintf( temp_buffer,GM_BUFFERSIZE-1,"(host check orphaned, is the mod-gearman worker on queue '%s' running?)\n", target_queue); init_check_result(chk_result); chk_result->host_name = strdup( hst->name ); chk_result->scheduled_check = TRUE; chk_result->reschedule_check = TRUE; chk_result->output_file = 0; chk_result->output_file_fd = -1; chk_result->output = strdup(temp_buffer); chk_result->return_code = mod_gm_opt->orphan_return; chk_result->check_options = CHECK_OPTION_NONE; chk_result->object_check_type = HOST_CHECK; chk_result->check_type = HOST_CHECK_ACTIVE; chk_result->start_time.tv_sec = (unsigned long)time(NULL); chk_result->finish_time.tv_sec = (unsigned long)time(NULL); chk_result->latency = 0; mod_gm_add_result_to_list( chk_result ); chk_result = NULL; } /* tell nagios to not execute */ gm_log( GM_LOG_TRACE, "handle_host_check() finished successfully -> %d\n", NEBERROR_CALLBACKOVERRIDE ); return NEBERROR_CALLBACKOVERRIDE; } /* handle service check events */ static int handle_svc_check( int event_type, void *data ) { host * hst = NULL; service * svc = NULL; char *raw_command=NULL; char *processed_command=NULL; nebstruct_service_check_data * svcdata; int prio = GM_JOB_PRIO_LOW; check_result * chk_result; struct timeval core_time; struct tm next_check; char buffer1[GM_BUFFERSIZE]; gettimeofday(&core_time,NULL); gm_log( GM_LOG_TRACE, "handle_svc_check(%i, data)\n", event_type ); svcdata = ( nebstruct_service_check_data * )data; if ( event_type != NEBCALLBACK_SERVICE_CHECK_DATA ) return NEB_OK; /* ignore non-initiate service checks */ if ( svcdata->type != NEBTYPE_SERVICECHECK_ASYNC_PRECHECK ) return NEB_OK; /* shouldn't happen - internal Nagios error */ if ( svcdata == 0 ) { gm_log( GM_LOG_ERROR, "Service handler received NULL service data structure.\n" ); return NEBERROR_CALLBACKCANCEL; } /* get objects and set target function */ 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) { gm_log( GM_LOG_ERROR, "Service handler received NULL host object pointer.\n" ); return NEBERROR_CALLBACKCANCEL; } set_target_queue( hst, svc ); /* local check? */ if(!strcmp( target_queue, "" )) { gm_log( GM_LOG_DEBUG, "passing by local servicecheck: %s - %s\n", svcdata->host_name, svcdata->service_description); return NEB_OK; } gm_log( GM_LOG_DEBUG, "received job for queue %s: %s - %s\n", target_queue, svcdata->host_name, svcdata->service_description ); temp_buffer[0]='\x0'; /* as we have to intercept service checks so early * (we cannot cancel checks otherwise) * we have to do some service check logic here * taken from checks.c: */ /* clear check options - we don't want old check options retained */ svc->check_options=CHECK_OPTION_NONE; /* unset the freshening flag, otherwise only the first freshness check would be run */ svc->is_being_freshened=FALSE; /* grab the host and service macro variables */ clear_volatile_macros(); grab_host_macros(hst); grab_service_macros(svc); /* get the raw command line */ get_raw_command_line(svc->check_command_ptr,svc->service_check_command,&raw_command,0); if(raw_command==NULL){ gm_log( GM_LOG_ERROR, "Raw check command for service '%s' on host '%s' was NULL - aborting.\n", svc->description, svc->host_name ); return NEBERROR_CALLBACKCANCEL; } /* process any macros contained in the argument */ process_macros(raw_command, &processed_command, 0); if(processed_command==NULL) { gm_log( GM_LOG_ERROR, "Processed check command for service '%s' on host '%s' was NULL - aborting.\n", svc->description, svc->host_name); my_free(raw_command); return NEBERROR_CALLBACKCANCEL; } /* log latency */ if(mod_gm_opt->debug_level >= GM_LOG_DEBUG) { localtime_r(&svc->next_check, &next_check); strftime(buffer1, sizeof(buffer1), "%Y-%m-%d %H:%M:%S", &next_check ); gm_log( GM_LOG_DEBUG, "service: '%s' - '%s', next_check is at %s, latency so far: %i\n", svcdata->host_name, svcdata->service_description, buffer1, ((int)core_time.tv_sec - (int)svc->next_check)); } /* increment number of service checks that are currently running... */ currently_running_service_checks++; /* set the execution flag */ svc->is_executing=TRUE; gm_log( GM_LOG_TRACE, "cmd_line: %s\n", processed_command ); snprintf( temp_buffer,GM_BUFFERSIZE-1,"type=service\nresult_queue=%s\nhost_name=%s\nservice_description=%s\nstart_time=%i.0\nnext_check=%i.0\ncore_time=%i.%i\ntimeout=%d\ncommand_line=%s\n\n\n", mod_gm_opt->result_queue, svcdata->host_name, svcdata->service_description, (int)svc->next_check, (int)svc->next_check, (int)core_time.tv_sec, (int)core_time.tv_usec, service_check_timeout, processed_command ); uniq[0]='\x0'; snprintf( uniq,GM_BUFFERSIZE-1,"%s-%s", svcdata->host_name, svcdata->service_description); /* execute forced checks with high prio as they are propably user requested */ if(check_result_info.check_options & CHECK_OPTION_FORCE_EXECUTION) prio = GM_JOB_PRIO_HIGH; if(add_job_to_queue( &client, mod_gm_opt->server_list, target_queue, (mod_gm_opt->use_uniq_jobs == GM_ENABLED ? uniq : NULL), temp_buffer, prio, GM_DEFAULT_JOB_RETRIES, mod_gm_opt->transportmode, TRUE ) == GM_OK) { gm_log( GM_LOG_TRACE, "handle_svc_check() finished successfully\n" ); } else { my_free(raw_command); my_free(processed_command); /* unset the execution flag */ svc->is_executing=FALSE; /* decrement number of host checks that are currently running */ currently_running_service_checks--; gm_log( GM_LOG_TRACE, "handle_svc_check() finished unsuccessfully\n" ); return NEBERROR_CALLBACKCANCEL; } /* clean up */ my_free(raw_command); my_free(processed_command); /* orphaned check - submit fake result to mark service as orphaned */ if(mod_gm_opt->orphan_service_checks == GM_ENABLED && svc->check_options & CHECK_OPTION_ORPHAN_CHECK) { gm_log( GM_LOG_DEBUG, "service check for %s - %s orphaned\n", svc->host_name, svc->description ); if ( ( chk_result = ( check_result * )malloc( sizeof *chk_result ) ) == 0 ) return NEBERROR_CALLBACKCANCEL; snprintf( temp_buffer,GM_BUFFERSIZE-1,"(service check orphaned, is the mod-gearman worker on queue '%s' running?)\n", target_queue); init_check_result(chk_result); chk_result->host_name = strdup( svc->host_name ); chk_result->service_description = strdup( svc->description ); chk_result->scheduled_check = TRUE; chk_result->reschedule_check = TRUE; chk_result->output_file = 0; chk_result->output_file_fd = -1; chk_result->output = strdup(temp_buffer); chk_result->return_code = 2; chk_result->check_options = CHECK_OPTION_NONE; chk_result->object_check_type = SERVICE_CHECK; chk_result->check_type = SERVICE_CHECK_ACTIVE; chk_result->start_time.tv_sec = (unsigned long)time(NULL); chk_result->finish_time.tv_sec = (unsigned long)time(NULL); chk_result->latency = 0; mod_gm_add_result_to_list( chk_result ); chk_result = NULL; } /* tell nagios to not execute */ gm_log( GM_LOG_TRACE, "handle_svc_check() finished successfully -> %d\n", NEBERROR_CALLBACKOVERRIDE ); return NEBERROR_CALLBACKOVERRIDE; } /* parse the module arguments */ static int read_arguments( const char *args_orig ) { int verify; int errors = 0; char *ptr; char *args; char *args_c; if (args_orig == NULL) { gm_log( GM_LOG_ERROR, "error parsing arguments: none provided.\n" ); return GM_ERROR; } args = strdup(args_orig); args_c = args; while ( (ptr = strsep( &args, " " )) != NULL ) { if(parse_args_line(mod_gm_opt, ptr, 0) != GM_OK) { errors++; break; } } verify = verify_options(mod_gm_opt); if(mod_gm_opt->debug_level >= GM_LOG_DEBUG) { dumpconfig(mod_gm_opt, GM_NEB_MODE); } /* read keyfile */ if(mod_gm_opt->keyfile != NULL && read_keyfile(mod_gm_opt) != GM_OK) { errors++; } free(args_c); if(errors > 0) { return(GM_ERROR); } return(verify); } /* 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 ( opt->result_queue == NULL ) opt->result_queue = GM_DEFAULT_RESULT_QUEUE; /* nothing set by hand -> defaults */ if( opt->set_queues_by_hand == 0 ) { gm_log( GM_LOG_DEBUG, "starting client with default queues\n" ); opt->hosts = GM_ENABLED; opt->services = GM_ENABLED; opt->events = GM_ENABLED; } return(GM_OK); } /* return the prefered target function for our worker */ static void set_target_queue( host *hst, service *svc ) { int x=0; customvariablesmember *temp_customvariablesmember = NULL; /* empty our target */ target_queue[0] = '\x0'; /* grab target queue from custom variable */ if( mod_gm_opt->queue_cust_var ) { if( svc ) { temp_customvariablesmember = svc->custom_variables; for(; temp_customvariablesmember != NULL; temp_customvariablesmember = temp_customvariablesmember->next) { if(!strcmp(mod_gm_opt->queue_cust_var, temp_customvariablesmember->variable_name)) { if(!strcmp(temp_customvariablesmember->variable_value, "local")) { gm_log( GM_LOG_TRACE, "bypassing local check from service custom variable\n" ); return; } gm_log( GM_LOG_TRACE, "got target queue from service custom variable: %s\n", temp_customvariablesmember->variable_value ); snprintf( target_queue, GM_BUFFERSIZE-1, "%s", temp_customvariablesmember->variable_value ); return; } } } /* search in host custom variables */ temp_customvariablesmember = hst->custom_variables; for(; temp_customvariablesmember != NULL; temp_customvariablesmember = temp_customvariablesmember->next) { if(!strcmp(mod_gm_opt->queue_cust_var, temp_customvariablesmember->variable_name)) { if(!strcmp(temp_customvariablesmember->variable_value, "local")) { gm_log( GM_LOG_TRACE, "bypassing local check from host custom variable\n" ); return; } gm_log( GM_LOG_TRACE, "got target queue from host custom variable: %s\n", temp_customvariablesmember->variable_value ); snprintf( target_queue, GM_BUFFERSIZE-1, "%s", temp_customvariablesmember->variable_value ); return; } } } /* look for matching local servicegroups */ if ( svc ) { while ( mod_gm_opt->local_servicegroups_list[x] != NULL ) { servicegroup * temp_servicegroup = find_servicegroup( mod_gm_opt->local_servicegroups_list[x] ); if ( is_service_member_of_servicegroup( temp_servicegroup,svc )==TRUE ) { gm_log( GM_LOG_TRACE, "service is member of local servicegroup: %s\n", mod_gm_opt->local_servicegroups_list[x] ); return; } x++; } } /* look for matching local hostgroups */ x = 0; while ( mod_gm_opt->local_hostgroups_list[x] != NULL ) { hostgroup * temp_hostgroup = find_hostgroup( mod_gm_opt->local_hostgroups_list[x] ); if ( is_host_member_of_hostgroup( temp_hostgroup,hst )==TRUE ) { gm_log( GM_LOG_TRACE, "server is member of local hostgroup: %s\n", mod_gm_opt->local_hostgroups_list[x] ); return; } x++; } /* look for matching servicegroups */ x = 0; if ( svc ) { while ( mod_gm_opt->servicegroups_list[x] != NULL ) { servicegroup * temp_servicegroup = find_servicegroup( mod_gm_opt->servicegroups_list[x] ); if ( is_service_member_of_servicegroup( temp_servicegroup,svc )==TRUE ) { gm_log( GM_LOG_TRACE, "service is member of servicegroup: %s\n", mod_gm_opt->servicegroups_list[x] ); snprintf( target_queue, GM_BUFFERSIZE-1, "servicegroup_%s", mod_gm_opt->servicegroups_list[x] ); return; } x++; } } /* look for matching hostgroups */ x = 0; while ( mod_gm_opt->hostgroups_list[x] != NULL ) { hostgroup * temp_hostgroup = find_hostgroup( mod_gm_opt->hostgroups_list[x] ); if ( is_host_member_of_hostgroup( temp_hostgroup,hst )==TRUE ) { gm_log( GM_LOG_TRACE, "server is member of hostgroup: %s\n", mod_gm_opt->hostgroups_list[x] ); snprintf( target_queue, GM_BUFFERSIZE-1, "hostgroup_%s", mod_gm_opt->hostgroups_list[x] ); return; } x++; } if ( svc ) { /* pass into the general service queue */ if ( mod_gm_opt->services == GM_ENABLED && svc ) { snprintf( target_queue, GM_BUFFERSIZE-1, "service" ); return; } } else { /* pass into the general host queue */ if ( mod_gm_opt->hosts == GM_ENABLED ) { snprintf( target_queue, GM_BUFFERSIZE-1, "host" ); return; } } return; } /* start our threads */ static void start_threads(void) { if ( result_threads_running < mod_gm_opt->result_workers ) { /* create result worker */ int x; for(x = 0; x < mod_gm_opt->result_workers; x++) { result_threads_running++; pthread_create ( &result_thr[x], NULL, result_worker, (void *)&result_threads_running); } } } /* handle performance data */ int handle_perfdata(int event_type, void *data) { nebstruct_host_check_data *hostchkdata = NULL; nebstruct_service_check_data *srvchkdata = NULL; host *hst = NULL; service *svc = NULL; int has_perfdata = FALSE; gm_log( GM_LOG_TRACE, "handle_perfdata(%d)\n", event_type ); if(process_performance_data == 0) { gm_log( GM_LOG_TRACE, "handle_perfdata() process_performance_data disabled globally\n" ); return 0; } /* what type of event/data do we have? */ switch (event_type) { case NEBCALLBACK_HOST_CHECK_DATA: /* an aggregated status data dump just started or ended */ if ((hostchkdata = (nebstruct_host_check_data *) data)) { if (hostchkdata->type != NEBTYPE_HOSTCHECK_PROCESSED || hostchkdata->perf_data == NULL ) { break; } hst = find_host(hostchkdata->host_name); if(hst->process_performance_data == 0) { gm_log( GM_LOG_TRACE, "handle_perfdata() process_performance_data disabled for: %s\n", hst->name ); break; } uniq[0]='\x0'; snprintf( uniq,GM_BUFFERSIZE-1,"%s", hostchkdata->host_name); temp_buffer[0]='\x0'; snprintf( temp_buffer,GM_BUFFERSIZE-1, "DATATYPE::HOSTPERFDATA\t" "TIMET::%d\t" "HOSTNAME::%s\t" "HOSTPERFDATA::%s\t" "HOSTCHECKCOMMAND::%s!%s\t" "HOSTSTATE::%d\t" "HOSTSTATETYPE::%d\n", (int)hostchkdata->timestamp.tv_sec, hostchkdata->host_name, hostchkdata->perf_data, hostchkdata->command_name, hostchkdata->command_args, hostchkdata->state, hostchkdata->state_type); has_perfdata = TRUE; } break; case NEBCALLBACK_SERVICE_CHECK_DATA: /* an aggregated status data dump just started or ended */ if ((srvchkdata = (nebstruct_service_check_data *) data)) { if(srvchkdata->type != NEBTYPE_SERVICECHECK_PROCESSED || srvchkdata->perf_data == NULL) { break; } /* find the nagios service object for this service */ svc = find_service(srvchkdata->host_name, srvchkdata->service_description); if(svc->process_performance_data == 0) { gm_log( GM_LOG_TRACE, "handle_perfdata() process_performance_data disabled for: %s - %s\n", svc->host_name, svc->description ); break; } uniq[0]='\x0'; snprintf( uniq,GM_BUFFERSIZE-1,"%s-%s", srvchkdata->host_name, srvchkdata->service_description); temp_buffer[0]='\x0'; snprintf( temp_buffer,GM_BUFFERSIZE-1, "DATATYPE::SERVICEPERFDATA\t" "TIMET::%d\t" "HOSTNAME::%s\t" "SERVICEDESC::%s\t" "SERVICEPERFDATA::%s\t" "SERVICECHECKCOMMAND::%s\t" "SERVICESTATE::%d\t" "SERVICESTATETYPE::%d\n\n\n", (int)srvchkdata->timestamp.tv_sec, srvchkdata->host_name, srvchkdata->service_description, srvchkdata->perf_data, svc->service_check_command, srvchkdata->state, srvchkdata->state_type); temp_buffer[GM_BUFFERSIZE-1]='\x0'; has_perfdata = TRUE; } break; default: break; } if(has_perfdata == TRUE) { /* add our job onto the queue */ if(add_job_to_queue( &client, mod_gm_opt->server_list, GM_PERFDATA_QUEUE, (mod_gm_opt->perfdata_mode == GM_PERFDATA_OVERWRITE ? uniq : NULL), temp_buffer, GM_JOB_PRIO_NORMAL, GM_DEFAULT_JOB_RETRIES, mod_gm_opt->transportmode, TRUE ) == GM_OK) { gm_log( GM_LOG_TRACE, "handle_perfdata() finished successfully\n" ); } else { gm_log( GM_LOG_TRACE, "handle_perfdata() finished unsuccessfully\n" ); } } return 0; } /* handle generic exports */ int handle_export(int callback_type, void *data) { int i, debug_level_orig, return_code; char * buffer; char * type; char * event_type; nebstruct_log_data * nld; nebstruct_process_data * npd; nebstruct_timed_event_data * nted; temp_buffer[0] = '\x0'; mod_gm_opt->debug_level = -1; debug_level_orig = mod_gm_opt->debug_level; return_code = 0; /* what type of event/data do we have? */ switch (callback_type) { case NEBCALLBACK_RESERVED0: /* 0 */ break; case NEBCALLBACK_RESERVED1: /* 1 */ break; case NEBCALLBACK_RESERVED2: /* 2 */ break; case NEBCALLBACK_RESERVED3: /* 3 */ break; case NEBCALLBACK_RESERVED4: /* 4 */ break; case NEBCALLBACK_RAW_DATA: /* 5 */ break; case NEBCALLBACK_NEB_DATA: /* 6 */ break; case NEBCALLBACK_PROCESS_DATA: /* 7 */ npd = (nebstruct_process_data *)data; type = nebtype2str(npd->type); snprintf( temp_buffer,GM_BUFFERSIZE-1, "{\"callback_type\":\"%s\",\"type\":\"%s\",\"flags\":%d,\"attr\":%d,\"timestamp\":%d.%d}", "NEBCALLBACK_PROCESS_DATA", type, npd->flags, npd->attr, (int)npd->timestamp.tv_sec, (int)npd->timestamp.tv_usec ); free(type); break; case NEBCALLBACK_TIMED_EVENT_DATA: /* 8 */ nted = (nebstruct_timed_event_data *)data; event_type = eventtype2str(nted->event_type); type = nebtype2str(nted->type); snprintf( temp_buffer,GM_BUFFERSIZE-1, "{\"callback_type\":\"%s\",\"event_type\":\"%s\",\"type\":\"%s\",\"flags\":%d,\"attr\":%d,\"timestamp\":%d.%d,\"recurring\":%d,\"run_time\":%d}", "NEBCALLBACK_TIMED_EVENT_DATA", event_type, type, nted->flags, nted->attr, (int)nted->timestamp.tv_sec, (int)nted->timestamp.tv_usec, nted->recurring, (int)nted->run_time ); free(event_type); free(type); break; case NEBCALLBACK_LOG_DATA: /* 9 */ nld = (nebstruct_log_data *)data; buffer = escapestring(nld->data); type = nebtype2str(nld->type); snprintf( temp_buffer,GM_BUFFERSIZE-1, "{\"callback_type\":\"%s\",\"type\":\"%s\",\"flags\":%d,\"attr\":%d,\"timestamp\":%d.%d,\"entry_time\":%d,\"data_type\":%d,\"data\":\"%s\"}", "NEBCALLBACK_LOG_DATA", type, nld->flags, nld->attr, (int)nld->timestamp.tv_sec, (int)nld->timestamp.tv_usec, (int)nld->entry_time, nld->data_type, buffer); free(type); free(buffer); break; case NEBCALLBACK_SYSTEM_COMMAND_DATA: /* 10 */ break; case NEBCALLBACK_EVENT_HANDLER_DATA: /* 11 */ break; case NEBCALLBACK_NOTIFICATION_DATA: /* 12 */ break; case NEBCALLBACK_SERVICE_CHECK_DATA: /* 13 */ break; case NEBCALLBACK_HOST_CHECK_DATA: /* 14 */ break; case NEBCALLBACK_COMMENT_DATA: /* 15 */ break; case NEBCALLBACK_DOWNTIME_DATA: /* 16 */ break; case NEBCALLBACK_FLAPPING_DATA: /* 17 */ break; case NEBCALLBACK_PROGRAM_STATUS_DATA: /* 18 */ break; case NEBCALLBACK_HOST_STATUS_DATA: /* 19 */ break; case NEBCALLBACK_SERVICE_STATUS_DATA: /* 20 */ break; case NEBCALLBACK_ADAPTIVE_PROGRAM_DATA: /* 21 */ break; case NEBCALLBACK_ADAPTIVE_HOST_DATA: /* 22 */ break; case NEBCALLBACK_ADAPTIVE_SERVICE_DATA: /* 23 */ break; case NEBCALLBACK_EXTERNAL_COMMAND_DATA: /* 24 */ break; case NEBCALLBACK_AGGREGATED_STATUS_DATA: /* 25 */ break; case NEBCALLBACK_RETENTION_DATA: /* 26 */ break; case NEBCALLBACK_CONTACT_NOTIFICATION_DATA: /* 27 */ break; case NEBCALLBACK_CONTACT_NOTIFICATION_METHOD_DATA: /* 28 */ break; case NEBCALLBACK_ACKNOWLEDGEMENT_DATA: /* 29 */ break; case NEBCALLBACK_STATE_CHANGE_DATA: /* 30 */ break; case NEBCALLBACK_CONTACT_STATUS_DATA: /* 31 */ break; case NEBCALLBACK_ADAPTIVE_CONTACT_DATA: /* 32 */ break; default: gm_log( GM_LOG_ERROR, "handle_export() unknown export type: %d\n", callback_type ); mod_gm_opt->debug_level = debug_level_orig; return 0; } if(temp_buffer[0] != '\x0') { for(i=0;iexports[callback_type]->elem_number;i++) { return_code = mod_gm_opt->exports[callback_type]->return_code[i]; add_job_to_queue( &client, mod_gm_opt->server_list, mod_gm_opt->exports[callback_type]->name[i], /* queue name */ NULL, temp_buffer, GM_JOB_PRIO_NORMAL, GM_DEFAULT_JOB_RETRIES, mod_gm_opt->transportmode, send_now ); } } 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; } mod_gearman-1.4.14/neb_module/result_thread.c0000644001161000116100000002654212213031442016106 00000000000000/****************************************************************************** * * 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 . * *****************************************************************************/ /* include header */ #include "result_thread.h" #include "utils.h" #include "mod_gearman.h" #include "gearman_utils.h" /* cleanup and exit this thread */ static void cancel_worker_thread (void * data) { gearman_worker_st *worker = (gearman_worker_st*) data; gearman_worker_unregister_all(worker); gearman_worker_remove_servers(worker); gearman_worker_free(worker); gm_log( GM_LOG_DEBUG, "worker thread finished\n" ); return; } /* callback for task completed */ void *result_worker( void * data ) { gearman_worker_st worker; int *worker_num = (int*)data; gearman_return_t ret; gm_log( GM_LOG_TRACE, "worker %d started\n", *worker_num ); pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); set_worker(&worker); pthread_cleanup_push ( cancel_worker_thread, (void*) &worker); while ( 1 ) { ret = gearman_worker_work( &worker ); if ( ret != GEARMAN_SUCCESS && ret != GEARMAN_WORK_FAIL ) { if ( ret != GEARMAN_TIMEOUT) gm_log( GM_LOG_ERROR, "worker error: %s\n", gearman_worker_error( &worker ) ); gearman_job_free_all( &worker ); if ( ret == GEARMAN_TIMEOUT) { gearman_worker_unregister_all(&worker); gearman_worker_remove_servers(&worker); } else { gearman_worker_free( &worker ); sleep(1); } set_worker(&worker); } } pthread_cleanup_pop(0); return NULL; } /* put back the result into the core */ void *get_results( gearman_job_st *job, void *context, size_t *result_size, gearman_return_t *ret_ptr ) { int wsize, transportmode; char workload[GM_BUFFERSIZE]; char *decrypted_data; char *decrypted_data_c; #ifdef GM_DEBUG char *decrypted_orig; #endif struct timeval now, core_start_time; check_result * chk_result; int active_check = TRUE; char *ptr; double now_f, core_starttime_f, starttime_f, finishtime_f, exec_time, latency; /* for calculating real latency */ gettimeofday(&now,NULL); /* contect is unused */ context = context; /* set size of result */ *result_size = 0; /* set result pointer to success */ *ret_ptr = GEARMAN_SUCCESS; /* get the data */ wsize = gearman_job_workload_size(job); strncpy(workload, (const char*)gearman_job_workload(job), wsize); workload[wsize] = '\x0'; gm_log( GM_LOG_TRACE, "got result %s\n", gearman_job_handle( job )); gm_log( GM_LOG_TRACE, "%d +++>\n%s\n<+++\n", strlen(workload), workload ); /* decrypt data */ decrypted_data = malloc(GM_BUFFERSIZE); decrypted_data_c = decrypted_data; if(mod_gm_opt->transportmode == GM_ENCODE_AND_ENCRYPT && mod_gm_opt->accept_clear_results == GM_ENABLED) { transportmode = GM_ENCODE_ACCEPT_ALL; } else { transportmode = mod_gm_opt->transportmode; } mod_gm_decrypt(&decrypted_data, workload, transportmode); if(decrypted_data == NULL) { *ret_ptr = GEARMAN_WORK_FAIL; return NULL; } gm_log( GM_LOG_TRACE, "%d --->\n%s\n<---\n", strlen(decrypted_data), decrypted_data ); #ifdef GM_DEBUG decrypted_orig = strdup(decrypted_data); #endif /* * save this result to a file, so when nagios crashes, * we have at least the crashed package */ #ifdef GM_DEBUG if(mod_gm_opt->debug_result == GM_ENABLED) { FILE * fd; fd = fopen( "/tmp/last_result_received.txt", "w+" ); if(fd == NULL) perror("fopen"); fputs( decrypted_data, fd ); fclose( fd ); } #endif /* nagios will free it after processing */ if ( ( chk_result = ( check_result * )malloc( sizeof *chk_result ) ) == 0 ) { *ret_ptr = GEARMAN_WORK_FAIL; return NULL; } init_check_result(chk_result); chk_result->scheduled_check = TRUE; chk_result->reschedule_check = TRUE; chk_result->output_file = 0; chk_result->output_file_fd = -1; core_start_time.tv_sec = 0; core_start_time.tv_usec = 0; while ( (ptr = strsep(&decrypted_data, "\n" )) != NULL ) { char *key = strsep( &ptr, "=" ); char *value = strsep( &ptr, "\x0" ); if ( key == NULL ) continue; if ( !strcmp( key, "output" ) ) { if ( value == NULL ) { chk_result->output = strdup("(null)"); } else { chk_result->output = strdup( value ); } } if ( value == NULL || !strcmp( value, "") ) break; if ( !strcmp( key, "host_name" ) ) { chk_result->host_name = strdup( value ); } else if ( !strcmp( key, "service_description" ) ) { chk_result->service_description = strdup( value ); } else if ( !strcmp( key, "check_options" ) ) { chk_result->check_options = atoi( value ); } else if ( !strcmp( key, "scheduled_check" ) ) { chk_result->scheduled_check = atoi( value ); } else if ( !strcmp( key, "type" ) && !strcmp( value, "passive" ) ) { active_check=FALSE; } else if ( !strcmp( key, "reschedule_check" ) ) { chk_result->reschedule_check = atoi( value ); } else if ( !strcmp( key, "exited_ok" ) ) { chk_result->exited_ok = atoi( value ); } else if ( !strcmp( key, "early_timeout" ) ) { chk_result->early_timeout = atoi( value ); } else if ( !strcmp( key, "return_code" ) ) { chk_result->return_code = atoi( value ); } else if ( !strcmp( key, "core_start_time" ) ) { string2timeval(value, &core_start_time); } else if ( !strcmp( key, "start_time" ) ) { string2timeval(value, &chk_result->start_time); } else if ( !strcmp( key, "finish_time" ) ) { string2timeval(value, &chk_result->finish_time); } else if ( !strcmp( key, "latency" ) ) { chk_result->latency = atof( value ); } } if ( chk_result->host_name == NULL || chk_result->output == NULL ) { *ret_ptr= GEARMAN_WORK_FAIL; gm_log( GM_LOG_ERROR, "discarded invalid job (%s), check your encryption settings\n", gearman_job_handle( job ) ); return NULL; } if ( chk_result->service_description != NULL ) { chk_result->object_check_type = SERVICE_CHECK; chk_result->check_type = SERVICE_CHECK_ACTIVE; if(active_check == FALSE ) chk_result->check_type = SERVICE_CHECK_PASSIVE; } else { chk_result->object_check_type = HOST_CHECK; chk_result->check_type = HOST_CHECK_ACTIVE; if(active_check == FALSE ) chk_result->check_type = HOST_CHECK_PASSIVE; } /* fill some maybe missing options */ if(chk_result->start_time.tv_sec == 0) { chk_result->start_time.tv_sec = (unsigned long)time(NULL); } if(chk_result->finish_time.tv_sec == 0) { chk_result->finish_time.tv_sec = (unsigned long)time(NULL); } if(core_start_time.tv_sec == 0) { core_start_time.tv_sec = (unsigned long)time(NULL); } /* calculate real latency */ now_f = (double)now.tv_sec + (double)now.tv_usec / 1000000; core_starttime_f = (double)core_start_time.tv_sec + (double)core_start_time.tv_usec / 1000000; starttime_f = (double)chk_result->start_time.tv_sec + (double)chk_result->start_time.tv_usec / 1000000; 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; 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); #endif /* this check is not a freshnes check */ chk_result->check_options = chk_result->check_options & ! CHECK_OPTION_FRESHNESS_CHECK; if ( chk_result->service_description != NULL ) { #ifdef GM_DEBUG /* does this services exist */ service * svc = find_service( chk_result->host_name, chk_result->service_description ); if(svc == NULL) { write_debug_file(&decrypted_orig); gm_log( GM_LOG_ERROR, "service '%s' on host '%s' could not be found\n", chk_result->service_description, chk_result->host_name ); return NULL; } #endif gm_log( GM_LOG_DEBUG, "service job completed: %s %s: %d\n", chk_result->host_name, chk_result->service_description, chk_result->return_code ); } else { #ifdef GM_DEBUG /* does this host exist */ host * hst = find_host( chk_result->host_name ); if(hst == NULL) { write_debug_file(&decrypted_orig); gm_log( GM_LOG_ERROR, "host '%s' could not be found\n", chk_result->host_name ); return NULL; } #endif gm_log( GM_LOG_DEBUG, "host job completed: %s: %d\n", chk_result->host_name, chk_result->return_code ); } /* add result to result list */ mod_gm_add_result_to_list( chk_result ); /* reset pointer */ chk_result = NULL; free(decrypted_data_c); #ifdef GM_DEBUG free(decrypted_orig); #endif return NULL; } /* get the worker */ int set_worker( gearman_worker_st *worker ) { create_worker( mod_gm_opt->server_list, worker ); if ( mod_gm_opt->result_queue == NULL ) { gm_log( GM_LOG_ERROR, "got no result queue!\n" ); return GM_ERROR; } gm_log( GM_LOG_DEBUG, "started result_worker thread for queue: %s\n", mod_gm_opt->result_queue ); if(worker_add_function( worker, mod_gm_opt->result_queue, get_results ) != GM_OK) { return GM_ERROR; } /* add our dummy queue, gearman sometimes forgets the last added queue */ worker_add_function( worker, "dummy", dummy); /* let our worker renew itself every 30 seconds */ if(mod_gm_opt->server_num > 1) gearman_worker_set_timeout(worker, 30000); return GM_OK; } #ifdef GM_DEBUG /* write text to a debug file */ void write_debug_file(char ** text) { FILE * fd; fd = fopen( "/tmp/mod_gearman_result.txt", "a+" ); if(fd == NULL) perror("fopen"); fputs( "------------->\n", fd ); fputs( *text, fd ); fputs( "\n<-------------\n", fd ); fclose( fd ); } #endif mod_gearman-1.4.14/COPYING0000644001161000116100000010451311443652521012025 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program 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. This program 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 this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . mod_gearman-1.4.14/Changes0000644001161000116100000002305512241503705012262 00000000000000This file documents the revision history for mod_gearman. 1.4.14 Fri Nov 15 21:44:18 CET 2013 - fixed segfault when dupserver list was empty 1.4.12 Tue Nov 5 10:26:07 CET 2013 - fixed send_gearman to send duplicate result to normal server (Brian Christiansen) - ensure worker are running and doing jobs after reload/sighup 1.4.10 Mon Aug 5 11:38:53 CEST 2013 - fixed segfault on empty arguments (Michael Friedrich) - fixed commands containing quotes 1.4.8 Sat Jul 27 13:42:11 CEST 2013 - ensure worker exits, even if shm blocks - request proper macro escaping for nagios 4 1.4.6 Tue Jun 4 17:03:57 CEST 2013 - kill complete process group on timeout - close open filehandles before running check - added new option 'orphan_return' to set return code of orphaned checks 1.4.4 Thu May 3 15:48:34 CEST 2013 - added 'route_eventhandler_like_checks' option - fixed leaking FDs on reloading neb - install mini-epn when epn is enabled - fixed executing only the first freshness check 1.4.2 Thu Jan 10 10:56:37 CET 2013 - force check on orphaned events - added mini epn - added logrotate config (Ricardo Maraschini) - added new option load_limit1,5,15 to prevent new workers from spawning under heavy load. (sponsored by Ovido GmbH) 1.4.0 Thu Sep 25 22:14:31 CEST 2012 - implemented support for nagios 4 1.3.8 Sun Aug 19 16:52:13 CEST 2012 - fixed sending 2 results back when hit timeout 1.3.6 Mon Jul 19 17:08:19 CEST 2012 - added 'use_uniq_jobs' option - allow gearman_top to display multiple servers (Thomas Dohl) - fixed typo in 'timeout_return' docs - added send_gearman.pl (Vincent Candeau) - Bugfixes: - removed newlines in perllib breaking build on opensuse 1.3.4 Tue Jun 19 14:58:14 CEST 2012 - worker: added 'timeout_return' config option to set return code for checks running into timeout - send_gearman: make timeout configurable - send_gearman: added new mode which sends one result per line - gearman_top: allow floating number for interval - fixed killing worker on reload, worker now finishes current job - fixed executing jobs while restarting worker - fixed potential problem on deinitializing epn 1.3.2 Sun May 27 11:39:55 CEST 2012 - fixed problem with commands containing ENV definitions 1.3.0 Fri Apr 27 16:45:02 CEST 2012 - fixed setting queues by custom variables 1.2.8 Thu Apr 12 13:37:20 CEST 2012 - add new new option 'accept_clear_results' - added batch mode for gearman_top - added gearman_proxy to package - fixed problem when neb module is not reconnecting - fixed gearman path detection on source installations 1.2.6 Mon Mar 12 15:14:21 CET 2012 - set worker queue by custom variable - disabled default max job age check - added docs in sample config about max-age - added usefull message when epn plugin does not call exit() - added new option dup_results_are_passive - fixed "Could Not Start Check In Time" problem 1.2.4 Mon Feb 27 23:54:39 CET 2012 - fixed eventhandlers not being passed to worker - fixed shared memory not beeing cleaned on exit - internal changes to support freebsd 1.2.2 Tue Feb 7 18:06:02 CET 2012 - orphaned hosts/services generate a fake result with useful error message - bypass eventhandler from hosts/services in local host/servicegroups - fixed NAGIOS_PLUGIN env in epn 1.2.0 Sun Jan 8 18:42:56 CET 2012 - added embedded perl support (see README for details) - added uniq key option for check_gearman (kgovande) - added contrib folder - added Gearman-Proxy to syncronize jobserver - splitted default config in neb module and worker 1.1.1 Thu Nov 10 11:15:48 CET 2011 - check_gearman can now send background jobs (Justin Kerr Sheckler) - fixed problem which skipped some checks when they were rescheduled by the core smart scheduler - use md5sum as uniq key for long host/servicesnames this fixes a possible lost jobs when 2 very long host/servicesnames are scheduled at the same time 1.1.0 Wed Oct 12 18:36:10 CEST 2011 - fixed send_multi performance data headers - fixed segfault when worker runs into timeout 1.0.10 Thu Aug 25 16:07:55 CEST 2011 - new option 'show_error_output' for worker - fixed failed job when host+service > 64 chars - fixed tests 1.0.9 Mon Aug 15 16:05:23 CEST 2011 - nicer error messages for send_multi when zero results transmitted - fixed sigsegv when reloading core in combination with exports options - added optional workaround for plugins exiting with rc 25 because of duplicate execution - removed version output to stderr while reloading/starting the core - check server definition for duplicates - replace died workers to maintain the worker population - better timeout handling when using fork_on_exec=off 1.0.8 Fri Jul 22 22:21:34 CEST 2011 - use identifier for error messages if set - fixed ld options (fixes debian bug #632431) thanks Ilya Barygin - fixed memory leak in gearman_top - fixed memory leak when reloading neb module 1.0.7 Sun Jul 3 15:18:16 CEST 2011 - show plugin output for exit codes > 3 - fixed send_multi timestamps when client clock is screwed - fixed send_multi for libgearman > 0.14 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 1.0.1 Sat Mar 5 15:47:22 CET 2011 - added spawn-rate option for worker - added perfdata_mode option to prevent perfdata queue getting to big - made gearmand init script work with old libevent versions - fixed make dist - fixed "make rpm" for SLES11 1.0 Mon Feb 7 11:05:29 CET 2011 - added dupserver option (Mark Clarkson) - added stderr to send_multi - added missing performance data to send_multi - added error message when using unknown option - fixed handling of unusual exit codes 0.9 Sun Jan 16 21:20:06 CET 2011 - prepared debian packaging (Stig Sandbeck Mathisen) - increased max output to 64k - fixed default paths in gearmand init script - fixed problem with too low number of workers after running for a while - fixed problem with uppercase service descriptions in send_gearman 0.8 Wed Nov 17 14:11:54 CET 2010 - added send_multi (Matthias Flacke) - fixed checks with popen/exec 0.7 Wed Nov 3 14:01:23 CET 2010 - added identifier to worker config. Usefull when running more than one worker per host - added spec file for building rpms - removed duplicate errors about connection problems - fixed logging when loaded after the livestatus module 0.6 Wed Oct 13 09:25:14 CEST 2010 - added flexible column size for gearman_top - fixed starting status worker on reload - fixed graceful shutdown of gearmand - fixed bug in latency calculation - fixed bug in returing results 0.5 Fri Oct 1 08:18:06 CEST 2010 - added check for minimum event broker options - added worker thresholds to check_gearman - added check in configure if users exists - changed performance data for check_gearman - initscript no uses su -s instead of su - added chown of logfile dir to make install 0.4 Sat Sep 25 23:15:26 CEST 2010 - added gearman_top - added version to check_gearman and send_gearman - added version to output of worker status - added worker name to error output of plugins - fixed daemon mode 0.3 Mon Sep 20 09:43:55 CEST 2010 - added check_gearman to monitor job server and worker - added send_gearman to submit passive results - fixed make dist 0.2 Tue Sep 14 09:30:31 CEST 2010 - added support for config files - fixed sending perfdata even when disabled by "process_performance_data" setting 0.1 Mon Aug 23 15:01:15 CEST 2010 - print warning if host/servicegroup does not exist - added AES-256 encryption (with base64 transport) - added host/servicegroup affinity - added exclusion by local host/servicegroups - added distribution of eventhandlers - added result queue worker - initial version mod_gearman-1.4.14/t/0000755001161000116100000000000012241511662011306 500000000000000mod_gearman-1.4.14/t/06-execvp_vs_popen.c0000644001161000116100000000313111767461236015033 00000000000000#include #include #include #include #include #include #include #ifdef EMBEDDEDPERL #include #endif mod_gm_opt_t *mod_gm_opt; int main (int argc, char **argv, char **env) { argc = argc; argv = argv; env = env; char *result, *error; char cmd[120]; int x; /* set hostname */ gethostname(hostname, GM_BUFFERSIZE-1); /* create options structure and set debug level */ mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); mod_gm_opt->debug_level = 4; #ifdef EMBEDDEDPERL char p1[150]; snprintf(p1, 150, "--p1_file=worker/mod_gearman_p1.pl"); parse_args_line(mod_gm_opt, p1, 0); init_embedded_perl(env); #endif gm_job_t * exec_job; exec_job = ( gm_job_t * )malloc( sizeof *exec_job ); set_default_job(exec_job, mod_gm_opt); strcpy(cmd, "BLAH=BLUB /bin/hostname"); printf("this should be popen\n"); run_check(cmd, &result, &error); free(result); free(error); strcpy(cmd, "/bin/hostname"); printf("this should be execvp\n"); run_check(cmd, &result, &error); free(result); free(error); mod_gm_opt->debug_level = 0; for(x=0;x<100;x++) { run_check(cmd, &result, &error); free(result); free(error); } free_job(exec_job); mod_gm_free_opt(mod_gm_opt); #ifdef EMBEDDEDPERL deinit_embedded_perl(0); #endif exit(0); } /* core log wrapper */ void write_core_log(char *data) { printf("core logger is not available for tests: %s", data); return; } mod_gearman-1.4.14/t/noepn.pl0000644001161000116100000000011111722274610012675 00000000000000#!/usr/bin/perl # nagios: -epn print "no epn should be used\n"; exit 0; mod_gearman-1.4.14/t/benchmark.t0000755001161000116100000000460412234746207013363 00000000000000#!/usr/bin/perl use warnings; use strict; use Test::More tests => 8; use Data::Dumper; use Time::HiRes qw( gettimeofday tv_interval sleep ); alarm(60); # hole test should not take longer than 60 seconds my $TESTPORT = 54730; my $NR_TST_JOBS = 2000; # check requirements ok(-f './mod_gearman_worker', 'worker present') or BAIL_OUT("no worker!"); chomp(my $gearmand = `which gearmand 2>/dev/null`); isnt($gearmand, '', 'gearmand present: '.$gearmand) or BAIL_OUT("no gearmand"); system("$gearmand --port $TESTPORT --pid-file=./gearman.pid -d --log-file=/tmp/gearmand_bench.log"); chomp(my $gearmand_pid = `cat ./gearman.pid`); isnt($gearmand_pid, '', 'gearmand running: '.$gearmand_pid) or BAIL_OUT("no gearmand"); # fill the queue open(my $ph, "|./send_gearman --server=localhost:$TESTPORT --result_queue=eventhandler") or die("failed to open send_gearman: $!"); my $t0 = [gettimeofday]; for my $x (1..$NR_TST_JOBS) { print $ph "hostname\t1\ttest\n"; } close($ph); my $elapsed = tv_interval ( $t0 ); my $rate = int($NR_TST_JOBS / $elapsed); ok($elapsed, 'filling gearman queue with '.$NR_TST_JOBS.' jobs took: '.$elapsed.' seconds'); ok($rate > 500, 'fill rate '.$rate.'/s'); # now clear the queue `>worker.log`; $t0 = [gettimeofday]; my $cmd = "./mod_gearman_worker --server=localhost:$TESTPORT --debug=0 --max-worker=1 --encryption=off --p1_file=./worker/mod_gearman_p1.pl --daemon --pidfile=./worker.pid --logfile=./worker.log"; system($cmd); chomp(my $worker_pid = `cat ./worker.pid 2>/dev/null`); isnt($worker_pid, '', 'worker running: '.$worker_pid); wait_for_empty_queue("eventhandler"); $elapsed = tv_interval ( $t0 ); $rate = int($NR_TST_JOBS / $elapsed); ok($elapsed, 'cleared gearman queue in '.$elapsed.' seconds'); ok($rate > 300, 'clear rate '.$rate.'/s'); # clean up `kill $worker_pid`; `kill $gearmand_pid`; unlink("/tmp/gearmand_bench.log"); exit(0); ################################################# sub wait_for_empty_queue { my $queue = shift; open(my $ph, "./gearman_top -b -i 0.1 -H localhost:$TESTPORT |") or die("cannot launch gearman_top: $!"); while(my $line = <$ph>) { if($line =~ m/^\s*$queue\s*\|\s*(\d+)\s*\|\s*(\d+)\s*\|\s*(\d+)/mx) { my $worker = $1; my $waiting = $2; my $running = $3; if($running == 0 and $waiting == 0) { close($ph); return; } }; } } mod_gearman-1.4.14/t/crit.pl0000755001161000116100000000014111722274610012525 00000000000000#!/usr/bin/perl print "test plugin CRITICAL\n"; print STDERR "some errors on stderr\n"; exit 2; mod_gearman-1.4.14/t/02-full.c0000644001161000116100000005022512235221750012556 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #ifdef EMBEDDEDPERL #include #endif #include "gearman_utils.h" #define GEARMAND_TEST_PORT 54730 char * worker_logfile; int gearmand_pid; int worker_pid; gearman_worker_st worker; gearman_client_st client; mod_gm_opt_t *mod_gm_opt; char * last_result; /* start the gearmand server */ void *start_gearmand(void*data); void *start_gearmand(void*data) { int sid; data = data; // warning: unused parameter 'data' pid_t pid = fork(); if(pid == 0) { sid = setsid(); char port[30]; snprintf(port, 30, "--port=%d", GEARMAND_TEST_PORT); /* for newer gearman versions */ if(atof(gearman_version()) >= 0.27) { execlp("gearmand", "gearmand", "--listen=127.0.0.1", "--threads=10", "--job-retries=0", port, "--verbose=DEBUG", "--log-file=/tmp/gearmand.log" , (char *)NULL); } else if(atof(gearman_version()) > 0.14) { execlp("gearmand", "gearmand", "--listen=127.0.0.1", "--threads=10", "--job-retries=0", port, "--verbose=999", "--log-file=/tmp/gearmand.log" , (char *)NULL); } else { /* for gearman 0.14 */ execlp("gearmand", "gearmand", "-t 10", "-j 0", port, (char *)NULL); } perror("gearmand"); exit(1); } else { gearmand_pid = pid; } return NULL; } /* start the test worker */ void *start_worker(void*data); void *start_worker(void*data) { int sid; char* key = (char*)data; pid_t pid = fork(); if(pid == 0) { sid = setsid(); char options[150]; snprintf(options, 150, "server=127.0.0.1:%d", GEARMAND_TEST_PORT); char logf[150]; snprintf(logf, 150, "logfile=%s", worker_logfile); if(key != NULL) { char encryption[150]; snprintf(encryption, 150, "key=%s", key); execl("./mod_gearman_worker", "./mod_gearman_worker", "debug=2", encryption, logf, "max-worker=1", "p1_file=./worker/mod_gearman_p1.pl", options, (char *)NULL); } else { execl("./mod_gearman_worker", "./mod_gearman_worker", "debug=2", "encryption=no", logf, "max-worker=1", "p1_file=./worker/mod_gearman_p1.pl", options, (char *)NULL); } perror("mod_gearman_worker"); exit(1); } else { worker_pid = pid; } return NULL; } /* test event handler over gearmand */ void test_eventhandler(int transportmode); void test_eventhandler(int transportmode) { char * testdata = strdup("type=eventhandler\ncommand_line=/bin/hostname\n\n\n"); int rt = add_job_to_queue( &client, mod_gm_opt->server_list, "eventhandler", NULL, testdata, GM_JOB_PRIO_NORMAL, 1, transportmode, TRUE ); ok(rt == GM_OK, "eventhandler sent successfully in mode %s", transportmode == GM_ENCODE_ONLY ? "base64" : "aes256"); free(testdata); return; } /* test service check handler over gearmand */ void test_servicecheck(int transportmode, char*cmd); void test_servicecheck(int transportmode, char*cmd) { struct timeval start_time; gettimeofday(&start_time,NULL); char temp_buffer[GM_BUFFERSIZE]; 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\ncheck_options=%i\nscheduled_check=%i\nreschedule_check=%i\nlatency=%f\ncommand_line=%s\n\n\n", GM_DEFAULT_RESULT_QUEUE, "host1", "service1", ( int )start_time.tv_sec, ( int )start_time.tv_usec, 60, 0, 1, 1, 0.0, cmd==NULL ? "/bin/hostname" : cmd ); temp_buffer[sizeof( temp_buffer )-1]='\x0'; int rt = add_job_to_queue( &client, mod_gm_opt->server_list, "service", NULL, temp_buffer, GM_JOB_PRIO_NORMAL, 1, transportmode, TRUE ); ok(rt == GM_OK, "servicecheck sent successfully in mode %s", transportmode == GM_ENCODE_ONLY ? "base64" : "aes256"); return; } /* test */ void send_big_jobs(int transportmode); void send_big_jobs(int transportmode) { struct timeval start_time; gettimeofday(&start_time,NULL); char temp_buffer[GM_BUFFERSIZE]; 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\ncheck_options=%i\nscheduled_check=%i\nreschedule_check=%i\nlatency=%f\ncommand_line=%s\n\n\n", GM_DEFAULT_RESULT_QUEUE, "host1", "service1", ( int )start_time.tv_sec, ( int )start_time.tv_usec, 60, 0, 1, 1, 0.0, "/bin/hostname" ); temp_buffer[sizeof( temp_buffer )-1]='\x0'; char * uniq = "something at least bigger than the 64 chars allowed by libgearman!"; int rt = add_job_to_queue( &client, mod_gm_opt->server_list, "service", uniq, temp_buffer, GM_JOB_PRIO_NORMAL, 1, transportmode, TRUE ); ok(rt == GM_OK, "big uniq id sent successfully in mode %s", transportmode == GM_ENCODE_ONLY ? "base64" : "aes256"); char * queue = "something at least bigger than the 64 chars allowed by libgearman!"; rt = add_job_to_queue( &client, mod_gm_opt->server_list, queue, uniq, temp_buffer, GM_JOB_PRIO_NORMAL, 1, transportmode, TRUE ); ok(rt == GM_ERROR, "big queue sent unsuccessfully in mode %s", transportmode == GM_ENCODE_ONLY ? "base64" : "aes256"); return; } /* put back the result into the core */ void *get_results( gearman_job_st *job, void *context, size_t *result_size, gearman_return_t *ret_ptr ); void *get_results( gearman_job_st *job, void *context, size_t *result_size, gearman_return_t *ret_ptr ) { int wsize; char workload[GM_BUFFERSIZE]; char *decrypted_data; /* contect is unused */ context = context; /* set size of result */ *result_size = 0; /* set result pointer to success */ *ret_ptr = GEARMAN_SUCCESS; /* get the data */ wsize = gearman_job_workload_size(job); strncpy(workload, (const char*)gearman_job_workload(job), wsize); workload[wsize] = '\x0'; /* decrypt data */ decrypted_data = malloc(GM_BUFFERSIZE); mod_gm_decrypt(&decrypted_data, workload, mod_gm_opt->transportmode); if(decrypted_data == NULL) { *ret_ptr = GEARMAN_WORK_FAIL; return NULL; } like(decrypted_data, "host_name=host1", "output contains host_name"); like(decrypted_data, "output=", "output contains output"); if(last_result != NULL) free(last_result); last_result = decrypted_data; return NULL; } /* create server / clients / worker */ void create_modules(void); void create_modules() { ok(create_client( mod_gm_opt->server_list, &client ) == GM_OK, "created test client"); ok(create_worker( mod_gm_opt->server_list, &worker ) == GM_OK, "created test worker"); ok(worker_add_function( &worker, GM_DEFAULT_RESULT_QUEUE, get_results ) == GM_OK, "added result worker"); ok(worker_add_function( &worker, "dummy", dummy ) == GM_OK, "added dummy worker"); //gearman_worker_add_options(&worker, GEARMAN_WORKER_NON_BLOCKING); gearman_worker_set_timeout(&worker, 5000); return; } /* grab one job from result queue */ void do_result_work(int); void do_result_work(int nr) { gearman_return_t ret; int x = 0; for(x=0;x 0 && mode == 1) || mode == 3) { fp = fopen(logfile, "r"); while(fgets(line, GM_BUFFERSIZE, fp) != NULL) { diag("logfile: %s", line); } fclose(fp); } ok(errors == 0, "errors in logfile: %d", errors); /* cleanup logfile */ if(errors == 0) { ok(TRUE, "not removed temporary logfile due to errors: %s", logfile); } else { ok(unlink(logfile) == 0, "removed temporary logfile: %s", logfile); } free(line); return; } /* diag queues */ void diag_queues(void); void diag_queues() { char * message = NULL; char * version = NULL; int rc, x; mod_gm_server_status_t *stats; // print some debug info stats = malloc(sizeof(mod_gm_server_status_t)); stats->function_num = 0; stats->worker_num = 0; rc = get_gearman_server_data(stats, &message, &version, "127.0.0.1", GEARMAND_TEST_PORT); diag("get_gearman_server_data: rc: %d\n", rc); diag("get_gearman_server_data: msg: %s\n", message); diag("get_gearman_server_data: ver: %s\n", version); if( rc == STATE_OK ) { diag("%-35s %-9s %-9s\n", "queue", "waiting", "running"); for(x=0; xfunction_num;x++) { diag("%-35s %-9d %-9d\n", stats->function[x]->queue, stats->function[x]->waiting, stats->function[x]->running); } } free(message); free(version); free_mod_gm_status_server(stats); return; } /* wait till the given queue is empty */ void wait_for_empty_queue(char *queue, int timeout); void wait_for_empty_queue(char *queue, int timeout) { char * message = NULL; char * version = NULL; int rc, x; mod_gm_server_status_t *stats; int tries = 0; int found = 0; while(tries <= timeout && found == 0) { tries++; stats = malloc(sizeof(mod_gm_server_status_t)); stats->function_num = 0; stats->worker_num = 0; rc = get_gearman_server_data(stats, &message, &version, "127.0.0.1", GEARMAND_TEST_PORT); if( rc == STATE_OK ) { for(x=0; xfunction_num;x++) { if(stats->function[x]->waiting == 0 && stats->function[x]->running == 0 && !strcmp( stats->function[x]->queue, queue ) ) { found = 1; } } } free(message); free(version); free_mod_gm_status_server(stats); sleep(1); } ok(tries < timeout, "queue %s empty after %d seconds", queue, tries); if(tries >= timeout) { diag_queues(); } return; } char* my_tmpfile(void); char* my_tmpfile() { char *sfn = strdup("/tmp/modgm.XXXXXX"); int fd = -1; if ((fd = mkstemp(sfn)) == -1) { fprintf(stderr, "%s: %s\n", sfn, strerror(errno)); return (NULL); } close(fd); return sfn; } void check_no_worker_running(char*); void check_no_worker_running(char* worker_logfile) { char cmd[150]; char *result, *error; int rrc; // ensure no worker are running anymore char *username=getenv("USER"); snprintf(cmd, 150, "ps -efl 2>/dev/null | grep -v grep | grep '%s' | grep mod_gearman_worker", username); rrc = real_exit_code(run_check(cmd, &result, &error)); ok(rrc == 1, "no worker running anymore"); like(result, "^\\s*$", "ps output should be empty"); like(error, "^\\s*$", "ps error output should be empty"); if(rrc != 1) { check_logfile(worker_logfile, 3); } return; } /* main tests */ int main (int argc, char **argv, char **env) { argc = argc; argv = argv; env = env; int status, chld, rc; int tests = 127; int rrc; char cmd[150]; char *result, *error, *message, *output; plan(tests); mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); #ifdef EMBEDDEDPERL char p1[150]; snprintf(p1, 150, "--p1_file=worker/mod_gearman_p1.pl"); parse_args_line(mod_gm_opt, p1, 0); init_embedded_perl(env); #endif char options[150]; snprintf(options, 150, "--server=127.0.0.1:%d", GEARMAND_TEST_PORT); ok(parse_args_line(mod_gm_opt, options, 0) == 0, "parse_args_line()"); mod_gm_opt->debug_level = GM_LOG_ERROR; worker_logfile = my_tmpfile(); if(!ok(worker_logfile != NULL, "created temp logile: %s", worker_logfile)) { diag("could not create temp logfile"); exit( EXIT_FAILURE ); } /* first fire up a gearmand server and one worker */ start_gearmand((void*)NULL); sleep(2); start_worker((void*)NULL); sleep(2); /* wait one second and catch died procs */ while((chld = waitpid(-1, &status, WNOHANG)) != -1 && chld > 0) { diag( "waitpid() %d exited with %d\n", chld, status); status = 0; } if(!ok(gearmand_pid > 0, "'gearmand started with port %d and 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 ); } if(!ok(pid_alive(gearmand_pid) == TRUE, "gearmand alive")) { check_logfile("/tmp/gearmand.log", 3); kill(gearmand_pid, SIGTERM); kill(worker_pid, SIGTERM); exit( EXIT_FAILURE ); } if(!ok(worker_pid > 0, "worker started with pid: %d", worker_pid)) diag("could not start worker"); if(!ok(pid_alive(worker_pid) == TRUE, "worker alive")) { check_logfile(worker_logfile, 3); kill(gearmand_pid, SIGTERM); kill(worker_pid, SIGTERM); exit( EXIT_FAILURE ); } skip(gearmand_pid <= 0 || worker_pid <= 0, tests-3, /* Number of tests to skip */ "Skipping all tests, no need to go on without gearmand or worker"); /* create server / clients */ mod_gm_opt->transportmode = GM_ENCODE_ONLY; create_modules(); /* send big job */ send_big_jobs(GM_ENCODE_ONLY); //diag_queues(); wait_for_empty_queue("eventhandler", 20); wait_for_empty_queue("service", 20); //diag_queues(); do_result_work(1); //diag_queues(); wait_for_empty_queue(GM_DEFAULT_RESULT_QUEUE, 5); /***************************************** * test check */ //diag_queues(); test_servicecheck(GM_ENCODE_ONLY, "./t/crit.pl"); //diag_queues(); wait_for_empty_queue("eventhandler", 20); wait_for_empty_queue("service", 5); //diag_queues(); do_result_work(1); //diag_queues(); wait_for_empty_queue(GM_DEFAULT_RESULT_QUEUE, 5); //diag_queues(); like(last_result, "test plugin CRITICAL", "stdout output from ./t/crit.pl"); like(last_result, "some errors on stderr", "stderr output from ./t/crit.pl"); /***************************************** * test check2 */ //diag_queues(); test_servicecheck(GM_ENCODE_ONLY, "./t/both"); //diag_queues(); wait_for_empty_queue("eventhandler", 20); wait_for_empty_queue("service", 5); //diag_queues(); do_result_work(1); //diag_queues(); wait_for_empty_queue(GM_DEFAULT_RESULT_QUEUE, 5); like(last_result, "stdout output", "stdout output from ./t/both"); like(last_result, "stderr output", "stderr output from ./t/both"); /* try to send some data with base64 only */ //diag_queues(); test_eventhandler(GM_ENCODE_ONLY); //diag_queues(); test_servicecheck(GM_ENCODE_ONLY, NULL); //diag_queues(); wait_for_empty_queue("eventhandler", 20); wait_for_empty_queue("service", 5); //diag_queues(); do_result_work(1); //diag_queues(); wait_for_empty_queue(GM_DEFAULT_RESULT_QUEUE, 5); sleep(1); kill(worker_pid, SIGTERM); waitpid(worker_pid, &status, 0); ok(status == 0, "worker (%d) exited with exit code %d", worker_pid, real_exit_code(status)); status = 0; check_no_worker_running(worker_logfile); check_logfile(worker_logfile, 0); char * test_keys[] = { "12345", "test", "test key 123", "me make you loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong key" }; /* ignore some signals for now */ signal(SIGTERM, SIG_IGN); int i; for(i=0;i<4;i++) { mod_gm_opt->transportmode = GM_ENCODE_AND_ENCRYPT; start_worker((void *)test_keys[i]); mod_gm_crypt_init( test_keys[i] ); ok(1, "initialized with key: %s", test_keys[i]); test_eventhandler(GM_ENCODE_AND_ENCRYPT); test_servicecheck(GM_ENCODE_AND_ENCRYPT, NULL); wait_for_empty_queue("eventhandler", 20); wait_for_empty_queue("service", 5); do_result_work(1); wait_for_empty_queue(GM_DEFAULT_RESULT_QUEUE, 5); sleep(1); kill(worker_pid, SIGTERM); waitpid(worker_pid, &status, 0); ok(status == 0, "worker (%d) exited with exit code %d", worker_pid, real_exit_code(status)); status = 0; check_no_worker_running(worker_logfile); check_logfile(worker_logfile, 0); } /***************************************** * send_gearman */ snprintf(cmd, 150, "./send_gearman --server=127.0.0.1:%d --key=testtest --host=test --service=test --message=test --returncode=0", GEARMAND_TEST_PORT); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); like(result, "^\\s*$", "output from ./send_gearman"); free(result); free(error); /***************************************** * send_multi */ snprintf(cmd, 150, "./send_multi --server=127.0.0.1:%d --host=blah < t/data/send_multi.txt", GEARMAND_TEST_PORT); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); like(result, "send_multi OK: 2 check_multi child checks submitted", "output from ./send_multi"); free(result); free(error); /***************************************** * check_gearman */ snprintf(cmd, 150, "./check_gearman -H 127.0.0.1:%d -s check -a -q worker_test", GEARMAND_TEST_PORT); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); like(result, "check_gearman OK - sending background job succeded", "output from ./check_gearman"); /* cleanup */ free(result); free(error); mod_gm_free_opt(mod_gm_opt); free_client(&client); free_worker(&worker); /* shutdown gearmand */ rc = send2gearmandadmin("shutdown\n", "127.0.0.1", GEARMAND_TEST_PORT, &output, &message); ok(rc == 0, "rc of send2gearmandadmin %d", rc); like(output, "OK", "output contains OK"); free(message); free(output); /* wait 5 seconds to shutdown */ for(i=0;i<=5;i++) { waitpid(gearmand_pid, &status, WNOHANG); if(pid_alive(gearmand_pid) == FALSE) { todo(); ok(status == 0, "gearmand (%d) exited with: %d", gearmand_pid, real_exit_code(status)); endtodo; break; } sleep(1); } if(pid_alive(gearmand_pid) == TRUE) { /* kill it the hard way */ kill(gearmand_pid, SIGTERM); waitpid(gearmand_pid, &status, 0); ok(status == 0, "gearmand (%d) exited with exit code %d", gearmand_pid, real_exit_code(status)); status = 0; ok(false, "gearmand had to be killed!"); } todo(); check_logfile("/tmp/gearmand.log", 2); endtodo; kill(worker_pid, SIGTERM); waitpid(worker_pid, &status, 0); ok(status == 0, "worker (%d) exited with exit code %d", worker_pid, real_exit_code(status)); check_no_worker_running(worker_logfile); check_logfile(worker_logfile, 2); status = 0; #ifdef EMBEDDEDPERL deinit_embedded_perl(0); #endif free(last_result); free(worker_logfile); endskip; return exit_status(); } /* core log wrapper */ void write_core_log(char *data) { printf("core logger is not available for tests: %s", data); return; } mod_gearman-1.4.14/t/tap.h0000644001161000116100000001055011622417634012172 00000000000000#ifndef __TAP_H__ #define __TAP_H__ #ifdef __cplusplus extern "C" { #endif #ifndef va_copy #define va_copy(d,s) ((d) = (s)) #endif #include #include #include int vok_at_loc (const char *file, int line, int test, const char *fmt, va_list args); int ok_at_loc (const char *file, int line, int test, const char *fmt, ...); 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); #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) #define todo(...) ctodo(0, ## __VA_ARGS__, NULL) #define endtodo cendtodo() #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 #include #include int tap_test_died (int status); #define dies_ok_common(for_death, code, ...) \ do { \ tap_test_died(1); \ int cpid = fork(); \ switch (cpid) { \ case -1: \ perror("fork error"); \ exit(1); \ case 0: \ close(1); \ close(2); \ code \ tap_test_died(0); \ exit(0); \ } \ if (waitpid(cpid, NULL, 0) < 0) { \ perror("waitpid error"); \ exit(1); \ } \ int it_died = tap_test_died(0); \ if (!it_died) \ {code} \ ok(for_death ? it_died : !it_died, ## __VA_ARGS__); \ } while (0) #endif #ifdef __cplusplus } #endif #endif mod_gearman-1.4.14/t/07-epn.c0000644001161000116100000000713412141667303012410 00000000000000#include #include #include #include #include #include #include #include #include #ifdef EMBEDDEDPERL #include #endif mod_gm_opt_t *mod_gm_opt; #ifdef EMBEDDEDPERL extern char* p1_file; #endif int main (int argc, char **argv, char **env) { argc = argc; argv = argv; env = env; #ifndef EMBEDDEDPERL plan(1); ok(1, "skipped epn tests"); return exit_status(); #endif #ifdef EMBEDDEDPERL int rc, rrc; char *result, *error; char cmd[120]; plan(21); /* create options structure and set debug level */ mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); char cmds[150]; strcpy(cmds, "--p1_file=worker/mod_gearman_p1.pl"); parse_args_line(mod_gm_opt, cmds, 0); strcpy(cmds, "--enable_embedded_perl=on"); parse_args_line(mod_gm_opt, cmds, 0); strcpy(cmds, "--use_embedded_perl_implicitly=on"); parse_args_line(mod_gm_opt, cmds, 0); /* * mod_gm_opt->debug_level=4; * dumpconfig(mod_gm_opt, GM_WORKER_MODE); */ ok(p1_file != NULL, "p1_file: %s", p1_file); /***************************************** * send_gearman */ init_embedded_perl(env); rc=file_uses_embedded_perl("t/ok.pl"); cmp_ok(rc, "==", TRUE, "ok.pl: file_uses_embedded_perl returned rc %d", rc); rc=file_uses_embedded_perl("t/noepn.pl"); cmp_ok(rc, "==", FALSE, "noepn.pl: file_uses_embedded_perl returned rc %d", rc); strcpy(cmd, "./t/fail.pl"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 3, "cmd '%s' returned rc %d", cmd, rrc); like(result, "ePN failed to compile", "returned result string"); like(error, "^$", "returned error string"); free(result); free(error); strcpy(cmd, "./t/ok.pl"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); like(result, "test plugin OK", "returned result string"); unlike(result, "plugin did not call exit", "returned result string"); like(error, "^$", "returned error string"); free(result); free(error); strcpy(cmd, "./t/crit.pl"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 2, "cmd '%s' returned rc %d", cmd, rrc); like(result, "test plugin CRITICAL", "returned result string"); like(error, "some errors on stderr", "returned error string"); free(result); free(error); strcpy(cmd, "./t/noexit.pl"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 3, "cmd '%s' returned rc %d", cmd, rrc); like(result, "sample output but no exit", "returned result string"); like(result, "plugin did not call exit", "returned result string"); like(error, "^$", "returned error string"); free(result); free(error); /* test mini epn */ strcpy(cmd, "./mod_gearman_mini_epn ./t/ok.pl"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); like(result, "plugin return code: 0", "contains return code"); like(result, "perl plugin output: 'test plugin OK", "contains plugin output"); like(error, "^$", "returned error string"); free(result); free(error); /***************************************** * clean up */ mod_gm_free_opt(mod_gm_opt); deinit_embedded_perl(0); return exit_status(); #endif } /* core log wrapper */ void write_core_log(char *data) { printf("core logger is not available for tests: %s", data); return; } mod_gearman-1.4.14/t/test_all.pl0000755001161000116100000000276411722274610013410 00000000000000#!/usr/bin/perl use warnings; use strict; use Test::More; # clean up old gearmands `ps -efl | grep gearmand | grep 54730 | awk '{ print \$4 }' | xargs kill`; `type valgrind >/dev/null 2>&1`; if($? != 0) { plan skip_all => 'valgrind required'; } my $makeout = `make clean 2>&1 && make 2>&1`; is($?, 0, "build rc is $?") or BAIL_OUT("no need to test without successful make!\n".$makeout); my $skip_perl_mem_leaks = ""; if(`grep -c '^#define EMBEDDEDPERL' config.h` > 0) { $skip_perl_mem_leaks = "--suppressions=./t/valgrind_suppress.cfg"; } my $vallog = '/tmp/valgrind.log'; my $testlog = '/tmp/mod_gearman_test.log'; my $suppressions = '/tmp/suppressions.log'; `>$suppressions`; my @tests = $ARGV[0] || split/\s+/, `grep ^check_PROGRAMS Makefile.am | awk -F = '{print \$2}'`; for my $test (@tests) { next if $test =~ m/^\s*$/; `make $test 2>/dev/null`; is($?, 0, "$test build rc is $?"); my $cmd = "yes | valgrind --tool=memcheck --leak-check=yes --leak-check=full --show-reachable=yes --track-origins=yes $skip_perl_mem_leaks --gen-suppressions=yes --log-file=$vallog ./$test >$testlog 2>&1"; #diag($cmd); `$cmd`; is($?, 0, "$test valgrind exit code is $?") or diag(`cat $testlog`); `cat $vallog >> $suppressions`; is(qx(grep "ERROR SUMMARY: " $vallog | grep -v "ERROR SUMMARY: 0 errors"), "", "valgrind Error Summary") or BAIL_OUT("check memory $test in $vallog"); } unlink($vallog); unlink($testlog); #diag(`ls -la $suppressions`); done_testing(); mod_gearman-1.4.14/t/01-utils.c0000644001161000116100000002041711722022205012745 00000000000000#include #include #include #include #include #include #include #include void printf_hex(char*, int); void printf_hex(char* text, int length) { int i; for(i=0; ikeyfile = strdup("t/data/test1.key"); read_keyfile(mod_gm_opt); //printf_hex(mod_gm_opt->crypt_key, 32); test[0]='\x0'; int i = 0; char hex[4]; for(i=0; i<32; i++) { hex[0] = '\x0'; snprintf(hex, 4, "%02x", mod_gm_opt->crypt_key[i]); strncat(test, hex, 4); } like(test, "3131313131313131313131313131313131313131313131313131313131310000", "read keyfile t/data/test1.key"); free(mod_gm_opt->keyfile); mod_gm_opt->keyfile = strdup("t/data/test2.key"); read_keyfile(mod_gm_opt); like(mod_gm_opt->crypt_key, "abcdef", "reading keyfile t/data/test2.key"); free(mod_gm_opt->keyfile); mod_gm_opt->keyfile = strdup("t/data/test3.key"); read_keyfile(mod_gm_opt); //printf_hex(mod_gm_opt->crypt_key, 32); 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"); /* encrypt */ char * key = "test1234"; char * encrypted = malloc(GM_BUFFERSIZE); char * text = "test message"; char * base = "a7HqhQEE8TQBde9uknpPYQ=="; mod_gm_crypt_init(key); int len; len = mod_gm_encrypt(&encrypted, text, GM_ENCODE_AND_ENCRYPT); ok(len == 24, "length of encrypted only"); like(encrypted, base, "encrypted string"); /* decrypt */ char * decrypted = malloc(GM_BUFFERSIZE); mod_gm_decrypt(&decrypted, encrypted, GM_ENCODE_AND_ENCRYPT); like(decrypted, text, "decrypted text"); free(decrypted); free(encrypted); /* base 64 */ char * base64 = malloc(GM_BUFFERSIZE); len = mod_gm_encrypt(&base64, text, GM_ENCODE_ONLY); ok(len == 16, "length of encode only"); like(base64, "dGVzdCBtZXNzYWdl", "base64 only string"); /* debase 64 */ char * debase64 = malloc(GM_BUFFERSIZE); mod_gm_decrypt(&debase64, base64, GM_ENCODE_ONLY); like(debase64, text, "debase64 text"); free(debase64); free(base64); /* file_exists */ ok(file_exists("01_utils") == 1, "file_exists('01_utils')"); ok(file_exists("non-exist") == 0, "file_exists('non-exist')"); /* nr2signal */ char * signame1 = nr2signal(9); like(signame1, "SIGKILL", "get SIGKILL for 9"); free(signame1); char * signame2 = nr2signal(15); like(signame2, "SIGTERM", "get SIGTERM for 15"); free(signame2); /* string2timeval */ struct timeval t; string2timeval("100.50", &t); ok(t.tv_sec == 100, "string2timeval 1"); ok(t.tv_usec == 50, "string2timeval 2"); string2timeval("100", &t); ok(t.tv_sec == 100, "string2timeval 3"); ok(t.tv_usec == 0, "string2timeval 4"); string2timeval("", &t); ok(t.tv_sec == 0, "string2timeval 5"); ok(t.tv_usec == 0, "string2timeval 6"); string2timeval(NULL, &t); ok(t.tv_sec == 0, "string2timeval 7"); ok(t.tv_usec == 0, "string2timeval 8"); /* command line parsing */ mod_gm_free_opt(mod_gm_opt); mod_gm_opt = renew_opts(); strcpy(test, "server=host:4730"); parse_args_line(mod_gm_opt, test, 0); like(mod_gm_opt->server_list[0]->host, "host", "server=host:4730"); ok(mod_gm_opt->server_list[0]->port == 4730, "server=host:4730"); ok(mod_gm_opt->server_num == 1, "server_number = %d", mod_gm_opt->server_num); mod_gm_free_opt(mod_gm_opt); mod_gm_opt = renew_opts(); strcpy(test, "server=:4730"); parse_args_line(mod_gm_opt, test, 0); like(mod_gm_opt->server_list[0]->host, "localhost", "server=:4730"); ok(mod_gm_opt->server_list[0]->port == 4730, "server=:4730"); ok(mod_gm_opt->server_num == 1, "server_number = %d", mod_gm_opt->server_num); mod_gm_free_opt(mod_gm_opt); mod_gm_opt = renew_opts(); strcpy(test, "server=localhost:4730"); parse_args_line(mod_gm_opt, test, 0); strcpy(test, "server=localhost:4730"); parse_args_line(mod_gm_opt, test, 0); like(mod_gm_opt->server_list[0]->host, "localhost", "duplicate server"); ok(mod_gm_opt->server_list[0]->port == 4730, "duplicate server"); ok(mod_gm_opt->server_num == 1, "server_number = %d", mod_gm_opt->server_num); mod_gm_free_opt(mod_gm_opt); mod_gm_opt = renew_opts(); strcpy(test, "server=localhost:4730,localhost:4730,:4730,host:4730,"); parse_args_line(mod_gm_opt, test, 0); like(mod_gm_opt->server_list[0]->host, "localhost", "duplicate server"); ok(mod_gm_opt->server_list[0]->port == 4730, "duplicate server"); like(mod_gm_opt->server_list[1]->host, "host", "duplicate server"); ok(mod_gm_opt->server_list[1]->port == 4730, "duplicate server"); ok(mod_gm_opt->server_num == 2, "server_number = %d", mod_gm_opt->server_num); /* escape newlines */ char * escaped = gm_escape_newlines(" test\n", GM_DISABLED); is(escaped, " test\\n", "untrimmed escape string"); free(escaped); escaped = gm_escape_newlines(" test\n", GM_ENABLED); is(escaped, "test", "trimmed escape string"); free(escaped); /* md5 sum */ char * sum = NULL; strcpy(test, ""); sum = md5sum(test); like(sum, "d41d8cd98f00b204e9800998ecf8427e", "md5sum()"); free(sum); strcpy(test, "The quick brown fox jumps over the lazy dog."); sum = md5sum(test); like(sum, "e4d909c290d0fb1ca068ffaddf22cbd0", "md5sum()"); free(sum); mod_gm_free_opt(mod_gm_opt); return exit_status(); } /* core log wrapper */ void write_core_log(char *data) { printf("core logger is not available for tests: %s", data); return; } mod_gearman-1.4.14/t/valgrind_suppress.cfg0000644001161000116100000061276012026024631015471 00000000000000{ Memcheck:Cond fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_ck_eval fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_bind_match fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_newSLICEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_newWHILEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_newWHILEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_newBINOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_newWHILEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_convert fun:Perl_newANONHASH fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_convert fun:Perl_newANONLIST fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newSLICEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_ck_subr fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_newLOOPEX fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_append_list fun:Perl_newWHILEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_newSTATEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newLISTOP fun:Perl_scope fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_append_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_convert fun:Perl_newANONHASH fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_convert fun:Perl_newANONLIST fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_convert fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newSLICEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_newLOOPEX fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_force_list fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newLISTOP fun:Perl_prepend_elem fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newNULLLIST fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newNULLLIST fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newWHILEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_newWHILEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_scalarseq fun:Perl_block_end fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_scope fun:Perl_newPROG fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_scope fun:Perl_newWHILEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_scope fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_scope fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_ck_ftst fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_ck_fun fun:Perl_ck_open fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_ck_fun fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_ck_fun fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_ck_shift fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_ck_shift fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPADOP fun:Perl_newGVOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_ck_fun fun:Perl_ck_spair fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPMOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newPMOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPMOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newPMOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newPVOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newSTATEOP fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newSTATEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_fold_constants fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_fold_constants fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_fold_constants fun:Perl_newBINOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_fold_constants fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_scan_num fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_scan_num fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_scan_num fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newSVOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newSVOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newSVOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newSVOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_bind_match fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_ck_fun fun:Perl_ck_spair fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_ck_shift fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_ck_shift fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_ck_subr fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newAVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newAVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newAVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newCVREF fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newCVREF fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newCVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newCVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newGVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newGVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newGVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newHVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newHVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newLOOPEX fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newSVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newSVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newSVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_newSVREF obj:/usr/lib/libperl.so.5.10.1 fun:Perl_ck_fun fun:Perl_ck_spair fun:Perl_newOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newWHILEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_newUNOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newWHILEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_newWHILEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:PerlIO_allocate fun:PerlIO_stdstreams fun:PerlIO_resolve_layers fun:PerlIO_openn fun:PerlIO_open obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:PerlIO_list_alloc fun:PerlIO_default_layers fun:PerlIO_resolve_layers fun:PerlIO_openn fun:PerlIO_open obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:PerlIO_list_alloc fun:PerlIO_define_layer fun:PerlIO_default_layers fun:PerlIO_resolve_layers fun:PerlIO_openn fun:PerlIO_open obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:PerlIO_push fun:PerlIOBuf_open fun:PerlIO_openn fun:PerlIO_fdopen fun:PerlIO_stdstreams fun:PerlIO_resolve_layers fun:PerlIO_openn fun:PerlIO_open obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:PerlIO_push fun:PerlIOUnix_open fun:PerlIOBuf_open fun:PerlIO_openn fun:PerlIO_fdopen fun:PerlIO_stdstreams fun:PerlIO_resolve_layers fun:PerlIO_openn fun:PerlIO_open obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_sv_setpv fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_mro_isa_changed_in fun:Perl_magic_setisa fun:Perl_mg_set fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_hv_common_key_len obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_method_named fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_mro_isa_changed_in fun:Perl_magic_setisa fun:Perl_mg_set fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_mro_register fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_pp_hslice fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common fun:Perl_scan_version fun:Perl_upg_version fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_pp_bless fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_pp_tie } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version fun:Perl_upg_version } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_mro_isa_changed_in fun:Perl_magic_setisa fun:Perl_mg_set fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_common obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_mro_isa_changed_in fun:Perl_magic_setisa fun:Perl_mg_set fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_hv_ksplit fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free fun:Perl_leave_scope fun:Perl_pop_scope fun:Perl_die_where fun:Perl_vdie } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newATTRSUB fun:Perl_newSUB fun:Perl_sv_2cv fun:Perl_pp_rv2cv fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_mro_meta_init fun:Perl_mro_method_changed_in fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmeth_autoload fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmeth_autoload fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmethod_autoload fun:Perl_pp_untie fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmethod_autoload obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_method_named fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_get_sv obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_get_sv obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_ck_fun fun:Perl_ck_open fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_ck_rvconst fun:Perl_newUNOP fun:Perl_newCVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_pp_sassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2sv fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_sv_2cv fun:Perl_pp_rv2cv fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_init_argv_symbols obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_newIO fun:Perl_gv_IOadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free fun:Perl_leave_scope fun:Perl_pop_scope } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free fun:Perl_sv_clear fun:Perl_sv_free2 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_pp_bless fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_pp_tie fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_av_store fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_do_kv fun:Perl_runops_standard fun:perl_run fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_fbm_compile fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_fbm_compile fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_fbm_compile fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_get_sv obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_magicname obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_mg_copy fun:Perl_hv_common fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_mg_copy fun:Perl_hv_common fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_mg_copy fun:Perl_hv_common fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_mg_copy fun:Perl_hv_common fun:Perl_hv_common_key_len obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_pp_vec fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_magicext fun:Perl_sv_magic obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc fun:Perl_sv_upgrade fun:Perl_newSV_type obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_newIO fun:Perl_gv_IOadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_regexec_flags fun:Perl_pp_match fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_regexec_flags fun:Perl_pp_subst fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc fun:Perl_safesyscalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_regexec_flags fun:Perl_pp_substcont fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_newCONDOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newLOGOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newWHILEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newWHILEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:calloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:PerlIO_list_push fun:PerlIO_default_layers fun:PerlIO_resolve_layers fun:PerlIO_openn fun:PerlIO_open obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_ck_rvconst fun:Perl_newUNOP fun:Perl_newAVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_ck_rvconst fun:Perl_newUNOP fun:Perl_newAVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_ck_rvconst fun:Perl_newUNOP fun:Perl_newSVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newBINOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newBINOP fun:Perl_newASSIGNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newBINOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newBINOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newUNOP fun:Perl_newAVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newUNOP fun:Perl_newAVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_peep fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_peep fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_peep fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_peep fun:Perl_newPROG fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_peep fun:Perl_peep fun:Perl_newPROG fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_newATTRSUB } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_fetch fun:Perl_pp_aelem fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push fun:Perl_av_create_and_push obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push fun:Perl_newPMOP obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push fun:Perl_op_clear fun:Perl_op_free fun:Perl_op_free fun:Perl_op_free fun:Perl_op_free fun:Perl_op_free fun:Perl_leave_scope } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push fun:Perl_scan_version fun:Perl_upg_version fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_pp_bless fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmeth fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_mro_isa_changed_in fun:Perl_magic_setisa fun:Perl_mg_set fun:Perl_pp_aassign fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_mro_isa_changed_in fun:Perl_magic_setisa fun:Perl_mg_set fun:Perl_pp_aassign } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_av_push obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_add_anon fun:Perl_ck_anoncode fun:Perl_newSVOP fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_add_name obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pad_findmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_new fun:Perl_start_subparse fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_new fun:Perl_start_subparse fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_new fun:Perl_start_subparse fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_new obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_new obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_new obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_av_store obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_new_stackinfo fun:Perl_init_stacks fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_new_stackinfo fun:Perl_pp_tie fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_pad_tidy fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmeth_autoload fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_ck_fun fun:Perl_ck_open fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_ck_rvconst fun:Perl_newUNOP fun:Perl_newCVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_sv_2cv fun:Perl_pp_rv2cv fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_newIO fun:Perl_gv_IOadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_av_extend fun:Perl_sv_add_backref fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_gv_init fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmeth_autoload fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_newSV_type fun:Perl_newIO fun:Perl_gv_IOadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_newSV_type fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_newSV_type fun:Perl_new_stackinfo fun:Perl_init_stacks fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_newSV_type fun:Perl_start_subparse fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_newSV_type fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_newSV_type obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_newSV_type obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_mro_get_linear_isa fun:Perl_mro_isa_changed_in fun:Perl_magic_setisa fun:Perl_mg_set } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_pp_vec fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_sv_2nv fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_sv_setnv fun:Perl_scan_num obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_sv_setpv fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_get_arena obj:/usr/lib/libperl.so.5.10.1 fun:Perl_sv_upgrade fun:Perl_sv_setsv_flags fun:Perl_sv_mortalcopy fun:Perl_pp_leavesub fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_hv_ksplit fun:Perl_magic_setnkeys fun:Perl_mg_set fun:Perl_pp_sassign fun:Perl_runops_standard fun:perl_run fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_init_stacks fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_my_setenv fun:Perl_magic_setenv fun:Perl_mg_set fun:Perl_pp_sassign fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_new_stackinfo fun:Perl_init_stacks fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_new_stackinfo fun:Perl_pp_tie fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_reentrant_init fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv fun:Perl_find_script obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv fun:Perl_new_collate fun:Perl_init_i18nl10n fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv fun:Perl_new_numeric fun:Perl_init_i18nl10n fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepv obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_regexec_flags fun:Perl_pp_match fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_regexec_flags fun:Perl_pp_match fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_regexec_flags fun:Perl_pp_subst fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free fun:Perl_leave_scope } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_gv_handler fun:Perl_sv_clear fun:Perl_sv_free2 fun:Perl_sv_free fun:Perl_gp_free fun:Perl_sv_clear } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_pp_bless fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_pp_tie fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_get_sv obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_magicname obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_mg_copy fun:Perl_hv_common fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_savepvn fun:Perl_sv_magicext fun:Perl_sv_magic fun:Perl_mg_copy fun:Perl_hv_common fun:Perl_hv_common_key_len obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_do_join fun:Perl_pp_join fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_method fun:Perl_pp_print fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_newSV fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_newSV fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_pp_quotemeta fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_2pv_flags fun:Perl_pp_concat fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_2pv_flags fun:Perl_pp_concat fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_newXS_flags fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_pad_add_name obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pad_findmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_pad_add_name obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pad_findmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:Perl_pp_caller fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpv obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_magic_get fun:Perl_mg_get fun:Perl_sv_setsv_flags fun:Perl_pp_sassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_my_stat fun:Perl_pp_ftis fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpv fun:Perl_pp_caller fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpv fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpv obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:Perl_scan_version fun:Perl_upg_version fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn_flags obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn_flags obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_newSVpvn_flags obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_pad_add_anon fun:Perl_ck_anoncode fun:Perl_newSVOP fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_pp_concat fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_pp_concat fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_pp_substr fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_method fun:Perl_pp_print fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_reg_numbered_buff_fetch fun:Perl_magic_get fun:Perl_mg_get fun:Perl_sv_2pv_flags fun:Perl_pp_unpack fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_sv_copypv fun:Perl_pp_stringify fun:Perl_runops_standard fun:Perl_fold_constants fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_sv_copypv fun:Perl_pp_stringify fun:Perl_runops_standard fun:Perl_fold_constants fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setpvn obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_do_readline fun:Perl_pp_readline fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_newSVsv fun:Perl_hv_common fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_newSVsv fun:Perl_hv_common fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_newSVsv fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_newSVsv fun:Perl_save_item fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_newSVsv fun:Perl_save_item fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_newSVsv fun:Perl_save_item fun:Perl_start_subparse fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_newSVsv fun:Perl_save_item fun:Perl_start_subparse fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_pp_tie fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_complement fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_sassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_sassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_sassign fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_sv_mortalcopy fun:Perl_pp_return fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_sv_mortalcopy fun:Perl_pp_return fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc fun:Perl_sv_grow obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmethod_autoload fun:Perl_pp_untie fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchfile_flags fun:Perl_gv_fetchfile fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchmeth fun:Perl_gv_fetchmeth_autoload fun:Perl_Gv_AMupdate fun:Perl_sv_bless fun:Perl_newSVrv fun:Perl_scan_version fun:Perl_upg_version } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_get_sv obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_get_sv obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_ck_fun fun:Perl_ck_open fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_ck_rvconst fun:Perl_newUNOP fun:Perl_newCVREF fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_sv_2cv fun:Perl_pp_rv2cv fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_init_argv_symbols obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_newIO fun:Perl_gv_IOadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_hv_common_key_len obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_mro_register fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_pp_helem fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_pp_hslice fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_common fun:Perl_scan_version fun:Perl_upg_version fun:Perl_new_version fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_convert fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_fold_constants fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_av_fetch fun:Perl_pad_alloc fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_gv_SVadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_hv_common fun:Perl_hv_common_key_len fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV fun:Perl_scan_num fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV_type fun:Perl_gv_fetchpvn_flags fun:Perl_newIO fun:Perl_gv_IOadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV_type fun:Perl_pad_add_name fun:Perl_allocmy fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV_type fun:Perl_pad_new fun:Perl_start_subparse fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV_type obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSV_type obj:/usr/lib/libperl.so.5.10.1 fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSVhek fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSVpv fun:Perl_call_method fun:Perl_pp_print fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSVpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSVpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSVpvn fun:perl_construct fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSVpvn_share fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newSVsv fun:Perl_save_item fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_regexec_flags fun:Perl_pp_match fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_xsutils obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_UNIVERSAL obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_newXS_flags fun:Perl_boot_core_mro obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:xs_init obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_softref2xv fun:Perl_pp_rv2av fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags fun:Perl_newIO fun:Perl_gv_IOadd obj:/usr/lib/libperl.so.5.10.1 fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_hv_name_set fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchpv fun:Perl_newXS fun:Perl_boot_core_PerlIO obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_fetchsv fun:Perl_newATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_gv_stashpvn fun:Perl_gv_stashsv fun:Perl_package fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_newGP fun:Perl_gv_init fun:Perl_gv_fetchpvn_flags obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_newSVpvn_share fun:Perl_utilize fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_share_hek fun:Perl_newSVpvn_share obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp } { Memcheck:Leak fun:malloc fun:Perl_safesysmalloc obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_savesharedpv fun:Perl_newSTATEOP fun:Perl_newATTRSUB fun:Perl_newANONATTRSUB fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:malloc fun:Perl_savesharedpv fun:Perl_newSTATEOP fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:malloc fun:Perl_savesharedpv fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_entereval fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:malloc fun:Perl_savesharedpv fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:malloc fun:Perl_savesharedpv fun:Perl_newSTATEOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:Perl_savesharedpv obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:init_embedded_perl fun:main } { Memcheck:Leak fun:malloc fun:perl_alloc fun:init_embedded_perl fun:main } { Memcheck:Leak fun:realloc fun:Perl_newFOROP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:PerlIO_list_push fun:PerlIO_define_layer fun:PerlIO_default_layers fun:PerlIO_resolve_layers fun:PerlIO_openn fun:PerlIO_open obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_push_scope fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep fun:Perl_peep } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_savestack_grow fun:Perl_save_pushptrptr fun:Perl_save_sptr fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_do_vecset fun:Perl_magic_setvec fun:Perl_mg_set fun:Perl_pp_sassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_do_vop fun:Perl_pp_bit_or fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_fbm_compile fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_pp_sysread fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_catpvn_flags fun:Perl_ck_require fun:Perl_newUNOP fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_catpvn_flags fun:Perl_do_vop fun:Perl_pp_bit_or fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_catpvn_flags fun:Perl_pp_concat fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_catpvn_flags fun:Perl_pp_concat fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_catpvn_flags fun:Perl_pp_concat fun:Perl_runops_standard obj:/usr/lib/libperl.so.5.10.1 fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_catpvn_flags fun:Perl_sv_catsv_flags fun:Perl_pp_regcomp fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_catpvn_flags obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_die_where fun:Perl_vdie fun:Perl_die fun:Perl_pp_die fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_my_stat fun:Perl_pp_ftis fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_setpvn fun:Perl_sv_copypv fun:Perl_pp_stringify fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_aassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_sassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_setsv_flags fun:Perl_pp_sassign fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_vcatpvfn fun:Perl_sv_vcatpvf fun:Perl_sv_catpvf fun:Perl_vnumify fun:Perl_gv_fetchpvn_flags fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_vcatpvfn fun:Perl_sv_vcatpvf fun:Perl_sv_catpvf obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_vcatpvfn fun:Perl_sv_vcatpvf fun:Perl_sv_catpvf obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 obj:/usr/lib/libperl.so.5.10.1 } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_sv_grow fun:Perl_sv_vcatpvfn fun:Perl_sv_vsetpvfn fun:Perl_do_sprintf fun:Perl_pp_sprintf fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_pv fun:run_epn_check fun:run_check } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc fun:Perl_yylex fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:perl_parse fun:init_embedded_perl fun:main } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_iterinit fun:Perl_do_kv fun:Perl_pp_padhv fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_hv_iterinit fun:Perl_do_kv fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize fun:Perl_yyparse } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pmruntime fun:Perl_yyparse obj:/usr/lib/libperl.so.5.10.1 fun:Perl_pp_require fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list } { Memcheck:Leak fun:realloc fun:Perl_safesysrealloc obj:/usr/lib/libperl.so.5.10.1 fun:Perl_re_compile fun:Perl_pregcomp fun:Perl_pp_regcomp fun:Perl_runops_standard fun:Perl_call_sv fun:Perl_call_list obj:/usr/lib/libperl.so.5.10.1 fun:Perl_newATTRSUB fun:Perl_utilize } mod_gearman-1.4.14/t/both0000755001161000116100000000010411722022205012074 00000000000000#!/usr/bin/env bash echo "stdout output" echo "stderr output" >&2 mod_gearman-1.4.14/t/rc0000755001161000116100000000007611722022205011554 00000000000000#!/usr/bin/env bash echo "exiting with exit code $1" exit $1 mod_gearman-1.4.14/t/04-log.c0000644001161000116100000000211711552052143012373 00000000000000#include #include #include #include #include #include #include #include #include #include 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; } mod_gearman-1.4.14/t/03-exec_checks.c0000644001161000116100000003367012212675260014072 00000000000000#include #include #include #include #include #include #include #include #include #ifdef EMBEDDEDPERL #include #endif #include "gearman_utils.h" mod_gm_opt_t *mod_gm_opt; int main (int argc, char **argv, char **env) { argc = argc; argv = argv; env = env; int rc, rrc; char *result, *error; char cmd[120]; char hostname[GM_BUFFERSIZE]; plan(60); /* set hostname */ gethostname(hostname, GM_BUFFERSIZE-1); /* create options structure and set debug level */ mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); mod_gm_opt->debug_level = 0; #ifdef EMBEDDEDPERL char p1[150]; snprintf(p1, 150, "--p1_file=worker/mod_gearman_p1.pl"); parse_args_line(mod_gm_opt, p1, 0); init_embedded_perl(env); #endif /***************************************** * arg parsing test 1 */ char *args[MAX_CMD_ARGS]; strcpy(cmd, "/bin/hostname"); parse_command_line(cmd, args); like(args[0], cmd, "parsing args cmd 1"); /***************************************** * arg parsing test 2 */ strcpy(cmd, "/bin/cmd blah blub foo"); parse_command_line(cmd,args); like(args[0], "/bin/cmd", "parsing args cmd 2"); like(args[1], "blah", "parsing args cmd 2"); like(args[2], "blub", "parsing args cmd 2"); like(args[3], "foo", "parsing args cmd 2"); /***************************************** * send_gearman 1 */ strcpy(cmd, "./send_gearman --server=blah --key=testtest --host=test --service=test --message=test --returncode=0"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 3, "cmd '%s' returned rc %d", cmd, rrc); if(atof(gearman_version()) >= 0.31) { like(result, "send_gearman UNKNOWN:", "result"); } else { like(result, "sending job to gearmand failed:", "result"); } free(result); free(error); /***************************************** * send_gearman 2 */ strcpy(cmd, "./send_gearman --server=blah < t/data/send_gearman_results.txt"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 3, "cmd '%s' returned rc %d", cmd, rrc); if(atof(gearman_version()) >= 0.31) { like(result, "send_gearman UNKNOWN:", "result"); } else { like(result, "sending job to gearmand failed:", "result"); } free(result); free(error); /***************************************** * send_multi */ strcpy(cmd, "./send_multi --server=blah --host=blah < t/data/send_multi.txt"); rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 3, "cmd '%s' returned rc %d", cmd, rrc); if(atof(gearman_version()) >= 0.31) { like(result, "send_multi UNKNOWN:", "result"); } else { like(result, "sending job to gearmand failed:", "result"); } free(result); free(error); /***************************************** * simple test command 1 */ strcpy(cmd, "/bin/hostname"); rc = run_check(cmd, &result, &error); cmp_ok(rc, "==", 0, "pclose for cmd '%s' returned rc %d", cmd, rc); rrc = real_exit_code(rc); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); free(result); free(error); /***************************************** * simple test command 2 */ strcpy(cmd, "/bin/hostname 2>&1"); rc = run_check(cmd, &result, &error); cmp_ok(rc, "==", 0, "pclose for cmd '%s' returned rc %d", cmd, rc); rrc = real_exit_code(rc); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); free(result); free(error); /***************************************** * simple test command 3 */ strcpy(cmd, "/usr/lib/nagios/plugins/check_icmp -H 127.0.0.1"); rc = run_check(cmd, &result, &error); cmp_ok(rc, "==", 0, "pclose for cmd '%s' returned rc %d", cmd, rc); rrc = real_exit_code(rc); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); free(result); free(error); /***************************************** * simple test command 4 */ strcpy(cmd, "echo -n 'test'; exit 2"); rc = run_check(cmd, &result, &error); rrc = real_exit_code(rc); cmp_ok(rrc, "==", 2, "cmd '%s' returned rc %d", cmd, rrc); like(result, "test", "returned result string"); free(result); free(error); gm_job_t * exec_job; exec_job = ( gm_job_t * )malloc( sizeof *exec_job ); set_default_job(exec_job, mod_gm_opt); /***************************************** * non existing command 1 */ exec_job->command_line = strdup("/bin/doesntexist"); exec_job->type = strdup("service"); exec_job->timeout = 10; int fork_on_exec = 0; execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 127 is out of bounds. Make sure the plugin you're trying to run actually exists. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); fork_on_exec = 1; lives_ok({execute_safe_command(exec_job, fork_on_exec, hostname);}, "executing command using fork on exec"); free(exec_job->output); free(exec_job->error); /* non existing command 2 */ free(exec_job->command_line); exec_job->command_line = strdup("/bin/doesntexist 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 127 is out of bounds. Make sure the plugin you're trying to run actually exists. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /***************************************** * non executable command 1 */ free(exec_job->command_line); exec_job->command_line = strdup("./THANKS"); fork_on_exec = 0; execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 126 is out of bounds. Make sure the plugin you're trying to run is executable. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /* non existing command 2 */ fork_on_exec = 1; free(exec_job->command_line); exec_job->command_line = strdup("./THANKS 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 126 is out of bounds. Make sure the plugin you're trying to run is executable. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /***************************************** * unknown exit code 1 */ free(exec_job->command_line); exec_job->command_line = strdup("./t/rc 5"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 5 is out of bounds. \\(worker:.*exiting with exit code 5", "returned result string"); free(exec_job->output); free(exec_job->error); /* unknown exit code 2 */ fork_on_exec = 0; free(exec_job->command_line); exec_job->command_line = strdup("./t/rc 5 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 5 is out of bounds. \\(worker:.*exiting with exit code 5", "returned result string"); free(exec_job->output); free(exec_job->error); /* unknown exit code 3 */ free(exec_job->command_line); exec_job->command_line = strdup("./t/rc 128 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 128 is out of bounds. Plugin exited by signal signal 0. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /* unknown exit code 4 */ free(exec_job->command_line); exec_job->command_line = strdup("./t/rc 137 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 137 is out of bounds. Plugin exited by signal SIGKILL. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /* unknown exit code 5 */ free(exec_job->command_line); exec_job->command_line = strdup("./t/rc 255 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 255 is out of bounds. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /***************************************** * signaled exit code SIGINT */ free(exec_job->command_line); exec_job->command_line = strdup("./t/killer INT"); fork_on_exec = 1; execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 130 is out of bounds. Plugin exited by signal SIGINT. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /* signaled exit code SIGINT 2 */ fork_on_exec = 0; free(exec_job->command_line); exec_job->command_line = strdup("./t/killer INT 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "CRITICAL: Return code of 130 is out of bounds. Plugin exited by signal SIGINT. \\(worker:", "returned result string"); free(exec_job->output); free(exec_job->error); /***************************************** * timed out check */ free(exec_job->command_line); exec_job->command_line = strdup("./t/sleep 30"); exec_job->timeout = 1; fork_on_exec = 1; signal(SIGTERM, SIG_IGN); signal(SIGINT, SIG_IGN); setenv("MODGEARMANTEST", "1", TRUE); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "\\(Service Check Timed Out On Worker: ", "returned result string"); free(exec_job->output); free(exec_job->error); /* timed out check 2 */ fork_on_exec = 0; free(exec_job->command_line); exec_job->command_line = strdup("./t/sleep 30 2>&1"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 2, "cmd '%s' returns rc 2", exec_job->command_line); like(exec_job->output, "\\(Service Check Timed Out On Worker: ", "returned result string"); free(exec_job->output); free(exec_job->error); signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); /* reset timeout */ exec_job->timeout = 30; /***************************************** * capture stderr */ free(exec_job->command_line); exec_job->command_line = strdup("./t/both"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 0, "cmd '%s' returns rc 0", exec_job->command_line); like(exec_job->output, "out", "returned result string"); like(exec_job->error, "err", "returned error string"); free(exec_job->output); free(exec_job->error); free(exec_job->command_line); exec_job->command_line = strdup("./t/both;"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 0, "cmd '%s' returns rc 0", exec_job->command_line); like(exec_job->output, "out", "returned result string"); like(exec_job->error, "err", "returned error string"); free(exec_job->output); free(exec_job->error); fork_on_exec = 1; free(exec_job->command_line); exec_job->command_line = strdup("./t/both"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 0, "cmd '%s' returns rc 0", exec_job->command_line); like(exec_job->output, "out", "returned result string"); like(exec_job->error, "err", "returned error string"); free(exec_job->output); free(exec_job->error); free(exec_job->command_line); exec_job->command_line = strdup("./t/both;"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 0, "cmd '%s' returns rc 0", exec_job->command_line); like(exec_job->output, "out", "returned result string"); like(exec_job->error, "err", "returned error string"); free(exec_job->output); free(exec_job->error); /***************************************** * cmd env */ free(exec_job->command_line); exec_job->command_line = strdup("BLAH=BLUB ./t/ok.pl"); execute_safe_command(exec_job, fork_on_exec, hostname); cmp_ok(exec_job->return_code, "==", 0, "cmd '%s' returns rc 0", exec_job->command_line); like(exec_job->output, "test plugin OK", "returned result string"); /***************************************** * clean up */ free_job(exec_job); mod_gm_free_opt(mod_gm_opt); #ifdef EMBEDDEDPERL deinit_embedded_perl(0); #endif return exit_status(); } /* core log wrapper */ void write_core_log(char *data) { printf("core logger is not available for tests: %s", data); return; } mod_gearman-1.4.14/t/killer0000755001161000116100000000016511722022205012431 00000000000000#!/usr/bin/env bash SIG="INT" if [ ! -z "$1" ]; then SIG="$1" fi echo "exiting with signal SIG$SIG" kill -$SIG $$ mod_gearman-1.4.14/t/make_valgrind_suppressions.pl0000755001161000116100000000466211741377350017246 00000000000000#!/usr/bin/perl use strict; use warnings; die("please run from project root") unless -d 't'; if(defined $ARGV[0] and $ARGV[0] eq '-c') { create_suppressions(); } else { print "merging only, use -c to create new files...\n"; } split_suppressions(); exit 0; ################################################# sub create_suppressions { `make clean >/dev/null && ./configure --enable-embedded-perl --enable-debug && make >/dev/null`; `>t/valgrind_suppress.cfg`; my @tests = split/\s+/, `grep ^check_PROGRAMS Makefile.am | awk -F = '{print \$2}'`; for my $test (@tests) { next if $test =~ m/^\s*$/; print "$test...\n"; `make $test >/dev/null 2>&1 && yes | valgrind --tool=memcheck --leak-check=yes --leak-check=full --show-reachable=yes --track-origins=yes --gen-suppressions=yes ./$test >> t/valgrind_suppress.cfg 2>&1`; } } ################################################# sub make_uniq { my($file) = @_; open(my $fh, '<', $file) or die($!); my $text; my $all_suppressions = {}; while(my $line = <$fh>) { next if $line =~ m/^\s*$/; next if $line =~ m/^{$/; next if $line =~ m/^#/; next if $line =~ m/^==/; next if $line =~ m/^ok/; next if $line =~ m/^not\s+ok/; next if $line =~ m/^1\.\.\d+$/; next if $line =~ m/^\[\d+\-\d+\-\d+\s+/; next if $line =~ m/^core logger is not available/; if($line =~ m/^\s+{$text} = 1 if $text =~ m/Perl_/; $all_suppressions->{$text} = 1 if $text =~ m/init_embedded_perl/; undef $text; } } die("unmatched entry") if defined $text; close($fh); my @sorted = sort keys %{$all_suppressions}; open($fh, '>', $file) or die("cannot open file: $!"); print $fh join("\n", @sorted); close($fh); return; } ################################################# sub split_suppressions { my $x = 1; if(-f '/tmp/suppressions.log') { print `cat /tmp/suppressions.log >> t/valgrind_suppress.cfg`; } make_uniq('t/valgrind_extra_manual.cfg'); print `cat t/valgrind_extra_manual.cfg >> t/valgrind_suppress.cfg`; make_uniq('t/valgrind_suppress.cfg'); print `ls -la t/valgrind_suppress.cfg`; return; } mod_gearman-1.4.14/t/noexit.pl0000755001161000116100000000010511727447424013104 00000000000000#!/usr/bin/perl # nagios: +epn print "sample output but no exit\n"; mod_gearman-1.4.14/t/fail.pl0000755001161000116100000000003111722274610012475 00000000000000#!/usr/bin/perl my $a = mod_gearman-1.4.14/t/ok.pl0000755001161000116100000000010211722274610012172 00000000000000#!/usr/bin/perl # nagios: +epn print "test plugin OK\n"; exit 0; mod_gearman-1.4.14/t/tap.c0000644001161000116100000001676111722022205012162 00000000000000#include #include #include #include #include "tap.h" static int expected_tests = NO_PLAN; static int failed_tests; static int current_test; static char *todo_mesg; static char * vstrdupf (const char *fmt, va_list args) { char *str; int size; va_list args2; va_copy(args2, args); if (!fmt) fmt = ""; size = vsnprintf(NULL, 0, fmt, args2) + 2; str = malloc(size); vsprintf(str, fmt, args); va_end(args2); 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) { char *name = vstrdupf(fmt, args); printf("%sok %d", test ? "" : "not ", ++current_test); if (*name) printf(" - %s", name); if (todo_mesg) { printf(" # TODO"); if (*todo_mesg) printf(" %s", todo_mesg); } printf("\n"); if (!test) { if (*name) diag(" Failed%s test '%s'\n at %s line %d.", todo_mesg ? " (TODO)" : "", name, file, line); else diag(" Failed%s test at %s line %d.", todo_mesg ? " (TODO)" : "", file, line); if (!todo_mesg) failed_tests++; } free(name); return test; } int ok_at_loc (const char *file, int line, int test, const char *fmt, ...) { va_list args; va_start(args, fmt); vok_at_loc(file, line, test, fmt, args); va_end(args); return test; } static int mystrcmp (const char *a, const char *b) { return a == b ? 0 : !a ? -1 : !b ? 1 : strcmp(a, b); } #define eq(a, b) (!mystrcmp(a, b)) #define ne(a, b) (mystrcmp(a, b)) int is_at_loc (const char *file, int line, const char *got, const char *expected, const char *fmt, ...) { int test = eq(got, expected); va_list args; va_start(args, fmt); vok_at_loc(file, line, test, fmt, args); va_end(args); if (!test) { diag(" got: '%s'", got); diag(" expected: '%s'", expected); } return test; } int isnt_at_loc (const char *file, int line, const char *got, const char *expected, const char *fmt, ...) { int test = ne(got, expected); va_list args; va_start(args, fmt); vok_at_loc(file, line, test, fmt, args); va_end(args); if (!test) { diag(" got: '%s'", got); diag(" expected: anything else"); } return test; } int cmp_ok_at_loc (const char *file, int line, int a, const char *op, int b, const char *fmt, ...) { int test = eq(op, "||") ? a || b : eq(op, "&&") ? a && b : eq(op, "|") ? a | b : eq(op, "^") ? a ^ b : eq(op, "&") ? a & b : eq(op, "==") ? a == b : eq(op, "!=") ? a != b : eq(op, "<") ? a < b : eq(op, ">") ? a > b : eq(op, "<=") ? a <= b : eq(op, ">=") ? a >= b : eq(op, "<<") ? a << b : eq(op, ">>") ? a >> b : eq(op, "+") ? a + b : eq(op, "-") ? a - b : eq(op, "*") ? a * b : eq(op, "/") ? a / b : eq(op, "%") ? a % b : diag("unrecognized operator '%s'", op); va_list args; va_start(args, fmt); vok_at_loc(file, line, test, fmt, args); va_end(args); if (!test) { diag(" %d", a); diag(" %s", op); diag(" %d", b); } return test; } static void vdiag_to_fh (FILE *fh, const char *fmt, va_list args) { char *mesg, *line; int i; if (!fmt) return; mesg = vstrdupf(fmt, args); line = mesg; for (i = 0; *line; i++) { char c = mesg[i]; if (!c || c == '\n') { mesg[i] = '\0'; fprintf(fh, "# %s\n", line); if (!c) break; mesg[i] = c; line = &mesg[i+1]; } } free(mesg); return; } int diag (const char *fmt, ...) { va_list args; va_start(args, fmt); vdiag_to_fh(stderr, fmt, args); va_end(args); return 0; } int note (const char *fmt, ...) { va_list args; va_start(args, fmt); vdiag_to_fh(stdout, fmt, args); va_end(args); return 0; } int exit_status () { int retval = 0; if (expected_tests == NO_PLAN) { printf("1..%d\n", current_test); } else if (current_test != expected_tests) { diag("Looks like you planned %d test%s but ran %d.", expected_tests, expected_tests > 1 ? "s" : "", current_test); retval = 255; } if (failed_tests) { diag("Looks like you failed %d test%s of %d run.", failed_tests, failed_tests > 1 ? "s" : "", current_test); if (expected_tests == NO_PLAN) retval = failed_tests; else retval = expected_tests - current_test + failed_tests; } 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; va_list args; va_start(args, fmt); why = vstrdupf(fmt, args); va_end(args); while (n --> 0) { printf("ok %d ", ++current_test); note("skip %s\n", why); } free(why); } void ctodo (int ignore, const char *fmt, ...) { va_list args; va_start(args, fmt); todo_mesg = vstrdupf(fmt, args); va_end(args); } void cendtodo () { free(todo_mesg); todo_mesg = NULL; } #ifndef _WIN32 #include #include #ifdef __APPLE__ #define MAP_ANONYMOUS MAP_ANON #endif #include #ifdef BSD #include #define MAP_ANONYMOUS MAP_ANON #endif /* Create a shared memory int to keep track of whether a piece of code executed dies. to be used in the dies_ok and lives_ok macros */ int tap_test_died (int status) { static int *test_died = NULL; int prev; if (!test_died) { test_died = mmap(0, sizeof (int), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); *test_died = 0; } prev = *test_died; *test_died = status; return prev; } int like_at_loc (int for_match, const char *file, int line, const char *got, const char *expected, const char *fmt, ...) { int test; regex_t re; int err = regcomp(&re, expected, REG_EXTENDED); if (err) { char errbuf[256]; regerror(err, &re, errbuf, sizeof errbuf); fprintf(stderr, "Unable to compile regex '%s': %s at %s line %d\n", expected, errbuf, file, line); exit(255); } err = regexec(&re, got, 0, NULL, 0); regfree(&re); test = for_match ? !err : err; va_list args; va_start(args, fmt); vok_at_loc(file, line, test, fmt, args); va_end(args); if (!test) { if (for_match) { diag(" '%s'", got); diag(" doesn't match: '%s'", expected); } else { diag(" '%s'", got); diag(" matches: '%s'", expected); } } return test; } #endif mod_gearman-1.4.14/t/sleep0000755001161000116100000000020111722022205012246 00000000000000#!/usr/bin/env bash seconds=10 if [ ! -z "$1" ]; then seconds="$1" fi echo "sleeping $seconds seconds..." sleep $seconds exit mod_gearman-1.4.14/t/data/0000755001161000116100000000000012241511662012217 500000000000000mod_gearman-1.4.14/t/data/send_gearman_results.txt0000644001161000116100000000021011770062655017106 00000000000000host_name svc_description 0 plugin_output host_name svc_description 0 plugin_output host_name 1 plugin_output host_name 1 plugin_output mod_gearman-1.4.14/t/data/test2.key0000644001161000116100000000004111540350744013710 00000000000000abcdef read only the first line mod_gearman-1.4.14/t/data/test3.key0000644001161000116100000000005111540350744013712 000000000000001111111111111111111111111111111111111111 mod_gearman-1.4.14/t/data/test1.key0000644001161000116100000000003711540350744013714 00000000000000111111111111111111111111111111 mod_gearman-1.4.14/t/data/send_multi.txt0000644001161000116100000000513411622417634015054 00000000000000
0 none 1301601686.14919 68616d582e666a616b30304336 2 2 0 0 5.28176784515381 0 1301601680.86743 1301601815.86743 head 1 critical, 1 warning, 0 unknown, 30 ok 1 test.pl 1 1301601680.94953 test1 1 test1 output test.pl test.pl 1 0 0.0820419788360596 1301601680.86749 50 command 2 test2.pl 1 1301601681.00426 test2 2 test2 test2.pl test2.pl 1 0 0.0538640022277832 1301601680.95039 50 command
mod_gearman-1.4.14/t/05-neb.c0000644001161000116100000000735312234745226012377 00000000000000#include #include #include #include #include #include #include "nagios/nagios.h" #include "nagios/nebmodules.h" #include "nagios/nebstructs.h" #include "nagios/nebcallbacks.h" #include "nagios/broker.h" int service_check_timeout; int host_check_timeout; int currently_running_service_checks; int currently_running_host_checks; int event_broker_options; check_result *check_result_list; check_result check_result_info; int process_performance_data; void check_neb(char * nebargs); void check_neb(char * nebargs) { int (*initfunc)(int,char *,void *); int (*deinitfunc)(int,int); int *module_version_ptr=NULL; void* neb_handle; lt_ptr init_func; lt_ptr deinit_func; char *err; /* set some external variables */ service_check_timeout = 30; host_check_timeout = 30; currently_running_service_checks = 0; currently_running_host_checks = 0; event_broker_options = 1048575; /* BROKER_EVERYTHING */ check_result_list = NULL; check_result_info.check_options = 1; /* CHECK_OPTION_FORCE_EXECUTION */ process_performance_data = 1; /* load neb module */ neb_handle=(void *)dlopen("./mod_gearman.o",RTLD_LAZY|RTLD_GLOBAL); ok(neb_handle != NULL, "neb module loaded"); err = dlerror(); if(err != NULL) { BAIL_OUT("cannot load module: %s\n", err ); } module_version_ptr=(int *)dlsym(neb_handle,"__neb_api_version"); ok((*module_version_ptr) == CURRENT_NEB_API_VERSION, "got module api version %i", CURRENT_NEB_API_VERSION); /* init neb module */ dlerror(); init_func=(void *)dlsym(neb_handle,"nebmodule_init"); ok(init_func != NULL, "located nebmodule_init()"); err = dlerror(); if(err != NULL) { BAIL_OUT("cannot load module: %s\n", err ); } initfunc = init_func; int result=(*initfunc)(NEBMODULE_NORMAL_LOAD, nebargs, neb_handle); ok(result == 0, "run nebmodule_init() -> %d", result); /* deinit neb module */ dlerror(); deinit_func=(void *)dlsym(neb_handle,"nebmodule_deinit"); ok(deinit_func != NULL, "located nebmodule_deinit()"); err = dlerror(); if(err != NULL) { BAIL_OUT("cannot load module: %s\n", err ); } deinitfunc=deinit_func; result=(*deinitfunc)(NEBMODULE_FORCE_UNLOAD,NEBMODULE_NEB_SHUTDOWN); ok(result == 0, "run nebmodule_deinit() -> %d", result); err = dlerror(); if(err != NULL) { BAIL_OUT("cannot load module: %s\n", err ); } result=dlclose(neb_handle); ok(result == 0, "dlclose() -> %d", result); return; } /* core log wrapper */ void write_core_log(char *data); void write_core_log(char *data) { printf("logger: %s", data); return; } /* fake some core functions */ int neb_set_module_info(void *handle, int type, char *data) { handle=handle; type=type; data=data; return 0; } int neb_register_callback(int callback_type, void *mod_handle, int priority, int (*callback_func)(int,void *)) { callback_type=callback_type; mod_handle=mod_handle; priority=priority; callback_func=callback_func; return 0; } int neb_deregister_callback(int callback_type, int (*callback_func)(int,void *)) { callback_type=callback_type; callback_func=callback_func; return 0; } int main(void) { int i; plan(28); char * test_nebargs[] = { "encryption=no server=localhost", "key=test12345 server=localhost", "encryption=no server=localhost export=log_queue:1:NEBCALLBACK_LOG_DATA", "encryption=no server=localhost export=log_queue:1:NEBCALLBACK_LOG_DATA export=proc_queue:0:NEBCALLBACK_PROCESS_DATA", }; int num = sizeof(test_nebargs) / sizeof(test_nebargs[0]); for(i=0;i. # # This program 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 2, or (at your option) # any later version. # # This program 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 this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: mod_gearman-1.4.14/README0000644001161000116100000012657712236143154011666 00000000000000Nagios Gearman Module ===================== What is Mod-Gearman ------------------- http://labs.consol.de/nagios/mod-gearman[Mod_Gearman] is an easy way of distributing active Nagios checks across your network and increasing Nagios scalability. Mod-Gearman can even help to reduce the load on a single Nagios host, because its much smaller and more efficient in executing checks. It consists of three parts: * There is a NEB module which resides in the Nagios core and adds servicechecks, hostchecks and eventhandler to a Gearman queue. * The counterpart is one or more worker clients executing the checks. Worker can be configured to only run checks for specific host- or servicegroups. * And you need at least one http://gearman.org[Gearman Job Server] running. * See the <<_common_scenarios,common scenarios>> for some examples. Presentations ------------- * http://mod-gearman.org/slides/Mod-Gearman-2012-10-18.pdf[Monitoring Conference 2012 in Nürnberg] * http://mod-gearman.org/slides/Mod-Gearman-2011-05-24.pdf[Nagios Workshop 2011 in Hannover] Features -------- * Reduce load of your central Nagios machine * Make Nagios scalable up to thousands of checks per second * Easy distributed setups without configuration overhead * Real loadbalancing across all workers * Real failover for redundant workers * Embedded Perl support for very fast execution of perl scripts * Fast transport of passive check results with included tools like send_gearman and send_multi Download -------- * Latest stable http://www.mod-gearman.org/download/v1.4.12/src/mod_gearman-1.4.12.tar.gz[version 1.4.12], released November 05 2013 * Mod Gearman is available for download at: http://mod-gearman.org/download.html * Source is available on GitHub: http://github.com/sni/mod_gearman * Older versions are available in the <<_archive,download archive>>. * Mod-Gearman is also included in http://omdistro.org[OMD]. * Debian users should use the http://packages.debian.org/source/wheezy/mod-gearman[official packages] * SLES/RHEL/Centos users should use the http://mod-gearman.org/download/[prebuild packages] * Debian/Ubuntu users might also want to check out the http://mod-gearman.org/download/[unoffical packages] Support ------- * Professional support and consulting is available via http://www.consol.de/open-source-monitoring/support/[www.consol.de] * https://groups.google.com/group/mod_gearman[google groups mailinglist] * http://www.monitoring-portal.org[german monitoring portal] * Mod-Gearman has been succesfully tested with latest Nagios. See <<_supported_dependencies,Supported Dependencies>> for details. * There are no known bugs at the moment. Let me know if you find one. Changelog --------- The changelog is available on https://github.com/sni/mod_gearman/blob/master/Changes[github]. How does it work ---------------- When the Mod-Gearman broker module is loaded, it intercepts all servicechecks, hostchecks and the eventhandler events. Eventhandler are then sent to a generic 'eventhandler' queue. Checks for hosts which are in one of the specified hostgroups, are sent into a seperate hostgroup queue. All non matching hosts are sent to a generic 'hosts' queue. Checks for services are first checked against the list of servicegroups, then against the hostgroups and if none matches they will be sent into a generic 'service' queue. The NEB module starts a single thread, which monitors the 'check_results' where all results come in. ++++ mod_gearman architecture ++++ A simple example queue would look like: ---- +---------------+------------------+--------------+--------------+ | Queue Name | Worker Available | Jobs Waiting | Jobs Running | +---------------+------------------+--------------+--------------+ | check_results | 1 | 0 | 0 | | eventhandler | 50 | 0 | 0 | | host | 50 | 0 | 1 | | service | 50 | 0 | 13 | +---------------+------------------+--------------+--------------+ ---- There is one queue for the results and two for the checks plus the eventhandler queue. The workflow is simple: 1. Nagios wants to execute a service check. 2. The check is intercepted by the Mod-Gearman neb module. 3. Mod-Gearman puts the job into the 'service' queue. 4. A worker grabs the job and puts back the result into the 'check_results' queue 5. Mod-Gearman grabs the result job and puts back the result onto the check result list 6. The Nagios reaper reads all checks from the result list and updates hosts and services You can set some host or servicegroups for special worker. This example uses a seperate hostgroup for Japan and a seperate servicegroup for resource intensive selenium checks. It would look like this: ---- +-----------------------+------------------+--------------+--------------+ | Queue Name | Worker Available | Jobs Waiting | Jobs Running | +-----------------------+------------------+--------------+--------------+ | check_results | 1 | 0 | 0 | | eventhandler | 50 | 0 | 0 | | host | 50 | 0 | 1 | | hostgroup_japan | 3 | 1 | 3 | | service | 50 | 0 | 13 | | servicegroup_selenium | 2 | 0 | 2 | +-----------------------+------------------+--------------+--------------+ ---- You still have the generic queues and in addition there are two queues for the specific groups. The worker processes will take jobs from the queues and put the result back into the check_result queue which will then be taken back by the neb module and put back into the Nagios core. A worker can work on one or more queues. So you could start a worker which only handles the 'hostgroup_japan' group. One worker for the 'selenium' checks and one worker which covers the other queues. There can be more than one worker on each queue to share the load. ++++ mod_gearman architecture ++++ Common Scenarios ---------------- Load Balancing ~~~~~~~~~~~~~~ ++++ Load Balancing ++++ The easiest variant is a simple load balancing. For example if your single Nagios box just cannot handle the load, you could just add a worker in the same network (or even on the same host) to reduce your load on the Nagios box. Therefor we just enable hosts, services and eventhandler on the server and the worker. Pro: * reduced load on your monitoring box Contra: * no failover Distributed Monitoring ~~~~~~~~~~~~~~~~~~~~~~ ++++ Distributed Monitoring ++++ If your checks have to be run from different network segments, then you can use the hostgroups (or servicegroups) to define a hostgroup for specific worker. The general hosts and services queue is disabled for this worker and just the hosts and services from the given hostgroup will be processed. Pro: * reduced load on your monitoring box * ability to access remote networks Contra: * no failover Distributed Monitoring with Load Balancing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++++ Distributed Monitoring with Load Balancing ++++ Your distributed setup could easily be extended to a load balanced setup with just adding more worker of the same config. Pro: * reduced load on your monitoring box * ability to access remote networks * automatic failover and load balancing for worker Contra: * no failover for the master NSCA Replacement ~~~~~~~~~~~~~~~~ ++++ NSCA Replacement ++++ 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 or use the 'accept_clear_results' option. Pro: * easy to setup in existing environments Distributed Setup With Remote Scheduler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++++ Distributed Setup With Remote Scheduler ++++ In case your network is unstable or you need a gui view from the remote location or any other reason which makes a remote core unavoidable you may want this setup. Thist setup consists of 2 independent Mod-Gearman setups and the slave worker just send their results to the master via the 'dup_server' option. The master objects configuration must contain all slave services and hosts. The configuration sync is not part of Mod-Gearman. Pro: * independent from network outtakes * local view Contra: * more complex setup * requires configuration sync Gearman Proxy ~~~~~~~~~~~~~ ++++ Gearman Proxy ++++ Sometimes you may need to reverse the direction of the initial connection attempt. Usually the worker and the neb module open the initial connection so they need to access the gearmand port. In cases where no direct connection is possible use ssh tunnel or the Gearman proxy. The Gearman proxy just puts jobs from one gearmand into another gearmand and vice versa. Just copy the gearman_proxy.pl from the contrib or share directory and adjust the first few lines to match you needs. Pro: * changes direction of initial connection setup * buffers network outages Contra: * two more daemon to monitor and maintain Installation ------------ OMD ~~~ Using OMD is propably the easiest way of installing and using Mod-Gearman. You just have to run 'omd config' or set Mod-Gearman to 'on'. OMD is available for Debian, Ubuntu, Centos/Redhat and SLES. -------------------------------------- OMD[test]:~$ omd config set MOD_GEARMAN on -------------------------------------- NOTE: Mod-Gearman is included in http://omdistro.org[OMD] since version 0.48. Debian / Ubuntu ~~~~~~~~~~~~~~~ It is strongly recommended to use the http://packages.debian.org/source/wheezy/mod-gearman[official packages] or the http://mod-gearman.org/download/[unoffical packages] which contains Debian Squeeze and various Ubuntu packages. Centos/Redhat ~~~~~~~~~~~~~ The easy and proper way is to build RPM packages. The following steps assume a Centos 5.7. Other releases may have different versions but should behave similar. NOTE: use the http://mod-gearman.org/download/[prebuild packages] if available. Build/install Gearmand rpms -------------------------------------- #> yum install autoconf automake libtool boost141-devel boost141-program-options #> cd /tmp #> wget http://launchpad.net/gearmand/trunk/0.33/+download/gearmand-0.33.tar.gz #> tar zxf gearmand-0.33.tar.gz #> ln -s gearmand-0.33/support/gearmand.init /tmp/gearmand.init #> vi gearmand-0.33/support/gearmand.spec change in line 9 and 25: Requires: sqlite, libevent >= 1.4, boost-program-options >= 1.39 in Requires: sqlite, libevent >= 1.4, boost141-program-options >= 1.39 #> tar cfz gearmand-0.33.tar.gz gearmand-0.33 #> LIBRARY_PATH=/usr/lib64/boost141:/usr/lib/boost141 \ LD_LIBRARY_PATH=/usr/lib64/boost141:/usr/lib/boost141 \ CPATH=/usr/include/boost141 \ rpmbuild -tb gearmand-0.33.tar.gz #> yum --nogpgcheck install /usr/src/redhat/RPMS/*/gearmand*-0.33-1*.rpm -------------------------------------- NOTE: The link to gearmand.init is a workaround, otherwise the build will fail. It may not be necessary for future gearman versions. Build/install Mod-Gearman rpms -------------------------------------- #> wget http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.2.0.tar.gz #> rpmbuild -tb mod_gearman-1.2.0.tar.gz #> yum --nogpgcheck install /usr/src/redhat/RPMS/*/mod_gearman-1.2.0-1.*.rpm -------------------------------------- Finally start and check your installation -------------------------------------- #> /etc/init.d/gearmand start #> /etc/init.d/mod_gearman_worker start #> gearman_top -------------------------------------- From Source ~~~~~~~~~~~ NOTE: source installation should be avoided if possible. Prebuild packages are way easier to maintain. Pre Requirements: - gcc / g++ - autoconf / automake / autoheader - libtool - libgearman (>= 0.14) Download the tarball and perform the following steps: -------------------------------------- #> ./configure #> make #> make install -------------------------------------- Then add the mod_gearman.o to your Nagios installation and add a broker line to your nagios.cfg: -------------------------------------- broker_module=.../mod_gearman.o server=localhost:4730 eventhandler=yes services=yes hosts=yes -------------------------------------- see <<_configuration,Configuration>> for details on all parameters The next step is to start one or more worker. You may use the same configuration file as for the neb module. -------------------------------------- ./mod_gearman_worker --server=localhost:4730 --services --hosts -------------------------------------- or use the supplied init script. NOTE: Make sure you have started your Gearmand job server. Usually it can be started with -------------------------------------- /usr/sbin/gearmand -t 10 -j 0 -------------------------------------- or a supplied init script (extras/gearmand-init). Command line arguments have change in recent gearman versions and you now should use something like: -------------------------------------- /usr/sbin/gearmand --threads=10 --job-retries=0 -------------------------------------- Patch Nagios ^^^^^^^^^^^^ NOTE: The needed patch is already applied to Nagios 3.2.2. Use the patch if you have an older version. It is not possible to distribute eventhandler with Nagios versions prior 3.2.2. Just apply the patch from the ./extras/patches directory to your Nagios sources and build Nagios again if you want to use an older version. You only need to replace the Nagios binary. Nothing else has changed. If you plan to distribute only Host/Servicechecks, no patch is needed. Configuration ------------- Nagios Core ~~~~~~~~~~~ A sample broker in your nagios.cfg could look like: -------------------------------------- broker_module=/usr/local/share/nagios/mod_gearman.o keyfile=/usr/local/share/nagios/secret.txt server=localhost eventhandler=yes hosts=yes services=yes -------------------------------------- See the following list for a detailed explanation of available options: Common Options ~~~~~~~~~~~~~~ Shared options for worker and the NEB module: config:: include config from this file. Options are the same as described here. 'include' is an alias for 'config'. + ===== config=/etc/nagios3/mod_gm_worker.conf ===== debug:: use debug to increase the verbosity of the module. Possible values are: + -- * `0` - only errors * `1-4` - debug verbosity * `5` - trace and all gearman related logs are going to stdout -- + Default is 0. + ==== 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. + ==== logmode=automatic ==== 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 the first server available. + ==== server=localhost:4730,remote_host:4730 ==== eventhandler:: defines if the module should distribute execution of eventhandlers. + ==== eventhandler=yes ==== services:: defines if the module should distribute execution of service checks. + ==== services=yes ==== hosts:: defines if the module should distribute execution of host checks. + ==== hosts=yes ==== hostgroups:: sets a list of hostgroups which will go into seperate queues. + ==== hostgroups=name1,name2,name3 ==== servicegroups:: sets a list of servicegroups which will go into seperate queues. + ==== servicegroups=name1,name2,name3 ==== encryption:: enables or disables encryption. It is strongly advised to not disable encryption. Anybody will be able to inject packages to your worker. Encryption is enabled by default and you have to explicitly disable it. When using encryption, you will either have to specify a shared password with `key=...` or a keyfile with `keyfile=...`. Default is On. + ==== encryption=yes ==== key:: A shared password which will be used for encryption of data pakets. Should be at least 8 bytes long. Maximum length is 32 characters. + ==== key=secret ==== keyfile:: The shared password will be read from this file. Use either key or keyfile. Only the first 32 characters from the first line will be used. Whitespace to the right will be trimmed. + ==== keyfile=/path/to/secret.file ==== use_uniq_jobs:: Using uniq keys prevents the gearman queues from filling up when there is no worker. However, gearmand seems to have problems with the uniq key and sometimes jobs get stuck in the queue. Set this option to 'off' when you run into problems with stuck jobs but make sure your worker are running. Default is On. + ==== use_uniq_jobs=on ==== Server Options ~~~~~~~~~~~~~~ Additional options for the NEB module only: localhostgroups:: sets a list of hostgroups which will not be executed by gearman. They are just passed through. + ==== localhostgroups=name1,name2,name3 ==== localservicegroups:: sets a list of servicegroups which will not be executed by gearman. They are just passed through. + ==== localservicegroups=name1,name2,name3 ==== queue_custom_variable:: Can be used to define the target queue by a custom variable in addition to host/servicegroups. When set for ex. to 'WORKER' you then could define a '_WORKER' custom variable for your hosts and services to directly set the worker queue. The host queue is inherited unless overwritten by a service custom variable. Set the value of your custom variable to 'local' to bypass Mod-Gearman (Same behaviour as in localhostgroups/localservicegroups). + ==== queue_custom_variable=WORKER ==== do_hostchecks:: Set this to 'no' if you want Mod-Gearman to only take care of 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: `yes` + ==== do_hostchecks=yes ==== result_workers:: Number of result worker threads. Usually one is enough. You may increase the value if your result queue is not processed fast enough. + ==== result_workers=3 ==== perfdata:: Defines if the module should distribute perfdata to gearman. + ==== perfdata=yes ==== NOTE: processing of perfdata is not part of mod_gearman. You will need additional worker for handling performance data. For example: http://www.pnp4nagios.org[PNP4Nagios]. Performance data is just written to the gearman queue. perfdata_mode:: There will be only a single job for each host or servier when putting performance data onto the perfdata_queue in overwrite mode. In append mode perfdata will be stored as long as there is memory left. Setting this to 'overwrite' helps preventing the perf_data queue from getting to big. Monitor your perfdata carefully when using the 'append' mode. Possible values are: + -- * `1` - overwrite * `2` - append -- + Default is 1. + ==== perfdata_mode=1 ==== result_queue:: sets the result queue. Necessary when putting jobs from several Nagios instances onto the same gearman queues. Default: `check_results` + ==== result_queue=check_results_nagios1 ==== orphan_host_checks:: The Mod-Gearman NEB module will submit a fake result for orphaned host checks with a message saying there is no worker running for this queue. Use this option to get better reporting results, otherwise your hosts will keep their last state as long as there is no worker running. Default is yes. + ==== orphan_host_checks=yes ==== orphan_service_checks:: Same like 'orphan_host_checks' but for services. Default is yes. + ==== orphan_service_checks=yes ==== accept_clear_results:: When enabled, the NEB module will accept unencrypted results too. This is quite useful if you have lots of passive checks and make use of send_gearman/send_multi where you would have to spread the shared key to all clients using these tools. Default is no. + ==== accept_clear_results=yes ==== Worker Options ~~~~~~~~~~~~~~ Additional options for worker: identifier:: Identifier for this worker. Will be used for the 'worker_identifier' queue for status requests. You may want to change it if you are using more than one worker on a single host. Defaults to the current hostname. + ==== identifier=hostname_test ==== pidfile:: Path to the pidfile. + ==== pidfile=/path/to/pid.file ==== job_timeout:: Default job timeout in seconds. Currently this value is only used for eventhandler. The worker will use the values from the core for host and service checks. Default: 60 + ==== job_timeout=60 ==== max-age:: Threshold for discarding too old jobs. When a new job is older than this amount of seconds it will not be executed and just discarded. This will result in a message like "(Could Not Start Check In Time)". Possible reasons for this are time differences between core and worker (use NTP!) or the smart rescheduler of the core which should be disabled. Set to zero to disable this check. Default: 0 + ==== max-age=600 ==== min-worker:: Minimum number of worker processes which should run at any time. Default: 1 + ==== min-worker=1 ==== max-worker:: Maximum number of worker processes which should run at any time. You may set this equal to min-worker setting to disable dynamic starting of workers. When setting this to 1, all services from this worker will be executed one after another. Default: 20 + ==== max-worker=20 ==== spawn-rate:: Defines the rate of spawned worker per second as long as there are jobs waiting. Default: 1 + ==== spawn-rate=1 ==== load_limit1:: Set a limit based on the 1min load average. When exceding the load limit, no new worker will be started until the current load is below the limit. No limit will be used when set to 0. Default: no limit + ==== load_limit1=0 ==== load_limit5:: Set a limit based on the 5min load average. See 'load_limit1' for details. Default: no limit + ==== load_limit5=0 ==== load_limit15:: Set a limit based on the 15min load average. See 'load_limit1' for details. Default: no limit + ==== load_limit15=0 ==== idle-timeout:: Time in seconds after which an idling worker exits. This parameter controls how fast your waiting workers will exit if there are no jobs waiting. Set to 0 to disable the idle timeout. Default: 10 + ==== idle-timeout=30 ==== max-jobs:: Controls the amount of jobs a worker will do before he exits. Use this to control how fast the amount of workers will go down after high load times. Disabled when set to 0. Default: 1000 + ==== max-jobs=500 ==== fork_on_exec:: Use this option to disable an extra fork for each plugin execution. Disabling this option will reduce the load on the worker host, but may cause trouble with unclean plugins. Default: no + ==== fork_on_exec=no ==== 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. + ==== dupserver=logserver:4730,logserver2:4730 ==== show_error_output:: Use this option to show stderr output of plugins too. When set to no, only stdout will be displayed. Default is yes. + ==== show_error_output=yes ==== timeout_return:: Defines the return code for timed out checks. Accepted return codes are 0 (Ok), 1 (Warning), 2 (Critical) and 3 (Unknown) Default: 2 + ==== timeout_return=2 ==== dup_results_are_passive:: Use this option to set if the duplicate result send to the 'dupserver' will be passive or active. Default is yes (passive). + ==== dup_results_are_passive=yes ==== debug-result:: When enabled, the hostname of the executing worker will be put in front of the plugin output. This may help with debugging your plugin results. Default is off. + ==== debug-result=yes ==== enable_embedded_perl:: When embedded perl has been compiled in, you can use this switch to enable or disable the embedded perl interpreter. See <<_embedded_perl,Embedded Perl>> for details on EPN. + ==== enable_embedded_perl=on ==== use_embedded_perl_implicitly:: Default value used when the perl script does not have a "nagios: +epn" or "nagios: -epn" set. Perl scripts not written for epn support usually fail with epn, so its better to set the default to off. + ==== use_embedded_perl_implicitly=off ==== use_perl_cache:: Cache compiled perl scripts. This makes the worker process a little bit bigger but makes execution of perl scripts even faster. When turned off, Mod-Gearman will still use the embedded perl interpreter, but will not cache the compiled script. + ==== use_perl_cache=on ==== workaround_rc_25:: Duplicate jobs from gearmand result sometimes in exit code 25 of plugins because they are executed twice and get killed because of using the same ressource. Sending results (when exit code is 25 ) will be skipped with this enabled. Only needed if you experience problems with plugins exiting with exit code 25 randomly. Default is off. + ==== workaround_rc_25=off ==== Queue Names ----------- You may want to watch your gearman server job queue. The shipped gearman_top does this. It polls the gearman server every second and displays the current queue statistics. -------------------------------------- +-----------------------+--------+-------+-------+---------+ | Name | Worker | Avail | Queue | Running | +-----------------------+--------+-------+-------+---------+ | check_results | 1 | 1 | 0 | 0 | | host | 3 | 3 | 0 | 0 | | service | 3 | 3 | 0 | 0 | | eventhandler | 3 | 3 | 0 | 0 | | servicegroup_jmx4perl | 3 | 3 | 0 | 0 | | hostgroup_japan | 3 | 3 | 0 | 0 | +-----------------------+--------+-------+-------+---------+ -------------------------------------- check_results:: this queue is monitored by the neb module to fetch results from the worker. You don't need an extra worker for this queue. The number of result workers can be set to a maximum of 256, but usually one is enough. One worker is capable of processing several thousand results per second. host:: This is the queue for generic host checks. If you enable host checks with the hosts=yes switch. Before a host goes into this queue, it is checked if any of the local groups matches or a seperate hostgroup machtes. If nothing matches, then this queue is used. service:: This is the queue for generic service checks. If you enable service checks with the `services=yes` switch. Before a service goes into this queue it is checked against the local host- and service-groups. Then the normal host- and servicegroups are checked and if none matches, this queue is used. hostgroup_:: This queue is created for every hostgroup which has been defined by the hostgroups=... option. Make sure you have at least one worker for every hostgroup you specify. Start the worker with `--hostgroups=...` to work on hostgroup queues. Note that this queue may also contain service checks if the hostgroup of a service matches. servicegroup_:: This queue is created for every servicegroup which has been defined by the `servicegroup=...` option. eventhandler:: This is the generic queue for all eventhandler. Make sure you have a worker for this queue if you have eventhandler enabled. Start the worker with `--events` to work on this queue. perfdata:: This is the generic queue for all performance data. It is created and used if you switch on `--perfdata=yes`. Performance data cannot be processed by the gearman worker itself. You will need http://www.pnp4nagios.org[PNP4Nagios] therefor. Performance ----------- While the main motivation was to ease distributed configuration, this plugin also helps to spread the load on multiple worker. Throughput is mainly limited by the amount of jobs a single Nagios instance can put onto the Gearman job server. Keep the Gearman job server close to the Nagios box. Best practice is to put both on the same machine. Both processes will utilize one core. Some testing with my workstation (Dual Core 2.50GHz) and two worker boxes gave me these results. I used a sample Nagios installation with 20.000 Services at a 1 minute interval and a sample plugin which returns just a single line of output. I got over 300 Servicechecks per second, which means you could easily setup 100.000 services at a 5 minute interval with a single Nagios box. The amount of worker boxes depends on your check types. ++++ mod_gearman performance mod_gearman performance ++++ See this article about benchmarks with https://labs.consol.de/blog/nagios/monitoring-core-benchmarks/[Nagios3, Nagios4 and Mod-Gearman]. Exports ------- Exports export data structures from the Nagios core as JSON data. For each configurable event one job will be created. At the moment, the only useful event type is the logdata event which allows you to create a json data job for every logged line. This can be very useful for external reporting tools. exports:: Set the queue name to create the jobs in. The return code will be sent back to the core (Not all callbacks support return codes). Callbacks are a list of callbacks for which you want to export json data. + ==== export=::[,,...] export=log_queue:1:NEBCALLBACK_LOG_DATA ==== Embedded Perl ------------- Since 1.2.0 Mod-Gearman has builtin embedded Perl support which means generally a big performance boost when you have lots of perl plugins. To enable embedded Perl you need to run configure with --enable-embedded-perl -------------------------------------- ./configure --enable-embedded-perl otheroptions... -------------------------------------- The --with-perlcache configure option has been replace by a runtime configure option 'use_perl_cache'. NOTE: Not all perl plugins support EPN. You can fix them, add '# nagios: -epn' in the first 10 lines of the script or set 'use_embedded_perl_implicitly=off' so all scripts without the explicit tag are run without embedded Perl. The default configuration of Mod-Gearman enables embedded Perl, but only uses it for Perl scripts which explicitly set '# nagios: +epn'. This is a very safe way of using embedded Perl but you probably miss some plugins which do not set the header and still would run with EPN. You may want to use the 'mini_epn' from your Nagios installation to verify if a plugin works with EPN or not. General EPN documentation is valid for Mod-Gearman as well: * http://nagios.sourceforge.net/docs/3_0/embeddedperl.html[Embedded Perl] * http://nagios.sourceforge.net/docs/3_0/epnplugins.html[Plugin Guidelines] NOTE: Mod-Gearman does not fix all of the memory leaks introduced with Nagios and Embedded Perl, but it moves the leaks away from the core. And they do not affect Mod-Gearman at all, as they are only in the preforked worker processes which will be restarted automatically from time to time (see 'max-jobs'). How To ------ How to Monitor Job Server and Worker ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use the supplied check_gearman to monitor your worker and job server. Worker have a own queue for status requests. -------------------------------------- %> ./check_gearman -H -q worker_ -t 10 -s check check_gearman OK - localhost has 10 worker and is working on 1 jobs|worker=10 running=1 total_jobs_done=1508 -------------------------------------- This will send a test job to the given job server and the worker will respond with some statistical data. Job server can be monitored with: -------------------------------------- %> ./check_gearman -H localhost -t 20 check_gearman OK - 6 jobs running and 0 jobs waiting.|check_results=0;0;1;10;100 host=0;0;9;10;100 service=0;6;9;10;100 -------------------------------------- How to Submit Passive Checks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can use send_gearman to submit active and passive checks to a gearman job server where they will be processed just like a finished check would do. -------------------------------------- %> ./send_gearman --server= --encryption=no --host="" --service="" --message="message" -------------------------------------- How to build send_gearman.exe ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ After installing strawberry perl, you need to install the 'PAR::Packer' module and run pp: -------------------------------------- pp -z 9 -M Class::Load::XS -M Moose -M Nagios::Passive::Base -M Params::Validate::XS -o send_gearman.exe send_gearman.pl -------------------------------------- Or just use the prebuild one from labs.consol.de: http://labs.consol.de/wp-content/uploads/2010/09/send_gearman.exe[send_gearman.exe]. How to Submit check_multi Results ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ check_multi is a plugin which executes multiple child checks. See more details about the feed_passive mode at: http://www.my-plugin.de/wiki/projects/check_multi/feed_passive[www.my-plugin.de] You can pass such child checks to Nagios via the mod_gearman neb module: -------------------------------------- %> check_multi -f multi.cmd -r 256 | ./send_multi --server= --encryption=no --host="" --service="" -------------------------------------- If you want to use only check_multi and no other workers, you can achieve this with the following neb module settings: broker_module=/usr/local/share/nagios/mod_gearman.o server=localhost encryption=no eventhandler=no hosts=no services=no hostgroups=does_not_exist NOTE: encryption is not necessary if you both run the check_multi checks and the Nagios check_results queue on the same server. How to Set Queue by Custom Variable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set 'queue_custom_variable=worker' in your Mod-Gearman NEB configuration. Then adjust your nagios host/service configuration and add the custom variable: ------- define host { ... _WORKER hostgroup_test } ------- The test hostgroup does not have to exist, it is a virtual queue name which is used by the worker. Adjust your Mod-Gearman worker configuration and put 'test' in the 'hostgroups' attribute. From then on, the worker will work on all jobs in the 'hostgroup_test' queue. What About Notifications ------------------------ Notifications are currently not possible to distribute via Mod-Gearman. The Nagios core would have to be patched to support this. And i think its not very useful at all. So don't expect this feature to be implemented in the near future. Supported Dependencies ---------------------- NOTE: Mod-Gearman works best with libgearman/gearmand 0.33 and Nagios 3.2.3. If in doubt, use these versions. Lib-Gearman ~~~~~~~~~~~ Mod-Gearman has successfully been tested on the following Gearmand Versions. It is recommended to always use the latest listed version of libgearman. * https://launchpad.net/gearmand/trunk/0.33[libgearman 0.33] * https://launchpad.net/gearmand/trunk/0.32[libgearman 0.32] * https://launchpad.net/gearmand/trunk/0.25[libgearman 0.25] * https://launchpad.net/gearmand/trunk/0.23[libgearman 0.23] * https://launchpad.net/gearmand/trunk/0.14[libgearman 0.14] Nagios ~~~~~~ Mod-Gearman works best since version 3.2.2 up to the latest stable Nagios 3.5.1. Nagios 4 is not fully tested yet, but there is a preview version available here http://mod-gearman.org/download/v1.4.0nagios4/ or in the nagios4 branch of the source tree. * http://nagios.org[Nagios] Naemon ~~~~~~ Mod-Gearman works on the Naemon core as well with the same remarks as Nagios 4. Icinga ~~~~~~ To be clear, Icinga is not the recommended platform for Mod-Gearman and not supported in any way. However, people have reported it works with Icinga 1.2.0, 1.8 and 1.10.1 but it seems like some statistics are not updated. * http://icinga.org[Icinga] Hints ----- - Make sure you have at least one worker for every queue. You should monitor that (check_gearman). - Add Logfile checks for your gearmand server and mod_gearman worker. - Make sure all gearman checks are in local groups. Gearman self checks should not be monitored through gearman. - Checks which write directly to the Nagios command file (ex.: check_mk) have to run on a local worker or have to be excluded by the localservicegroups. - Keep the gearmand server close to Nagios for better performance. - If you have some checks which should not run parallel, just setup a single worker with --max-worker=1 and they will be executed one after another. For example for cpu intesive checks with selenium. - Make sure all your worker have the Nagios-Plugins available under the same path. Otherwise they could'nt be found by the worker. Archive ------- * http://www.mod-gearman.org/download/v1.4.12/src/mod_gearman-1.4.12.tar.gz[version 1.4.12 - November 05 2013] * http://www.mod-gearman.org/download/v1.4.10/src/mod_gearman-1.4.10.tar.gz[version 1.4.10 - August 05 2013] * http://www.mod-gearman.org/download/v1.4.8/src/mod_gearman-1.4.8.tar.gz[version 1.4.8 - July 27 2013] * http://www.mod-gearman.org/download/v1.4.6/src/mod_gearman-1.4.6.tar.gz[version 1.4.6 - June 04 2013] * http://www.mod-gearman.org/download/v1.4.4/src/mod_gearman-1.4.4.tar.gz[version 1.4.4 - May 03 2013] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.4.2.tar.gz[version 1.4.2 - January 10 2013] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.3.8.tar.gz[version 1.3.8 - August 19 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.3.6.tar.gz[version 1.3.6 - July 19 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.3.4.tar.gz[version 1.3.4 - June 19 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.3.2.tar.gz[version 1.3.2 - May 27 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.3.0.tar.gz[version 1.3.0 - April 27 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.2.8.tar.gz[version 1.2.8 - April 12 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.2.6.tar.gz[version 1.2.6 - March 15 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.2.4.tar.gz[version 1.2.4 - February 27 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.2.2.tar.gz[version 1.2.2 - February 07 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.2.0.tar.gz[version 1.2.0 - January 08 2012] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.1.tar.gz[version 1.1.1 - November 10 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.0.tar.gz[version 1.1.0 - October 12 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.10.tar.gz[version 1.0.10 - August 28 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.9.tar.gz[version 1.0.9 - August 16 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.8.tar.gz[version 1.0.8 - July 22 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.7.tar.gz[version 1.0.7 - July 03 2011] * 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] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.tar.gz[version 1.0 - February 08 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-0.9.tar.gz[version 0.9 - January 17 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-0.8.tar.gz[version 0.8 - November 17 2010] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-0.7.tar.gz[version 0.7 - November 03 2010] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-0.6.tar.gz[version 0.6 - October 13 2010] * 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] mod_gearman-1.4.14/etc/0000755001161000116100000000000012241511662011616 500000000000000mod_gearman-1.4.14/etc/mod_gearman_worker.conf.in0000644001161000116100000001212712111650145016653 00000000000000############################################################################### # # Mod-Gearman - distribute checks with gearman # # Copyright (c) 2010 Sven Nierlein # # Worker Module Config # ############################################################################### # Identifier, hostname will be used if undefined #identifier=hostname # use debug to increase the verbosity of the module. # Possible values are: # 0 = only errors # 1 = debug messages # 2 = trace messages # 3 = trace and all gearman related logs are going to stdout. # Default is 0. debug=0 # Path to the logfile. logfile=%LOGFILE_WORKER% # sets the addess of your gearman job server. Can be specified # more than once to add more server. server=localhost:4730 # sets the address of your 2nd (duplicate) gearman job server. Can # be specified more than once o add more servers. #dupserver=: # defines if the worker should execute eventhandlers. eventhandler=yes # defines if the worker should execute # service checks. services=yes # defines if the worker should execute # host checks. hosts=yes # sets a list of hostgroups which this worker will work # on. Either specify a comma seperated list or use # multiple lines. #hostgroups=name1 #hostgroups=name2,name3 # sets a list of servicegroups which this worker will # work on. #servicegroups=name1,name2,name3 # enables or disables encryption. It is strongly # advised to not disable encryption. Anybody will be # able to inject packages to your worker. # Encryption is enabled by default and you have to # explicitly disable it. # When using encryption, you will either have to # specify a shared password with key=... or a # keyfile with keyfile=... # Default is On. encryption=yes # A shared password which will be used for # encryption of data pakets. Should be at least 8 # bytes long. Maximum length is 32 characters. key=should_be_changed # The shared password will be read from this file. # Use either key or keyfile. Only the first 32 # characters will be used. #keyfile=/path/to/secret.file # Path to the pidfile. Usually set by the init script #pidfile=%PIDFILE% # Default job timeout in seconds. Currently this value is only used for # eventhandler. The worker will use the values from the core for host and # service checks. job_timeout=60 # Minimum number of worker processes which should # run at any time. min-worker=5 # Maximum number of worker processes which should # run at any time. You may set this equal to # min-worker setting to disable dynamic starting of # workers. When setting this to 1, all services from # this worker will be executed one after another. max-worker=50 # Time after which an idling worker exists # This parameter controls how fast your waiting workers will # exit if there are no jobs waiting. idle-timeout=30 # Controls the amount of jobs a worker will do before he exits # Use this to control how fast the amount of workers will go down # after high load times max-jobs=1000 # max-age is the threshold for discarding too old jobs. When a new job is older # than this amount of seconds it will not be executed and just discarded. Set to # zero to disable this check. #max-age=0 # defines the rate of spawned worker per second as long # as there are jobs waiting spawn-rate=1 # Use this option to disable an extra fork for each plugin execution. Disabling # this option will reduce the load on the worker host but can lead to problems with # unclean plugin. Default: yes fork_on_exec=no # Set a limit based on the 1min load average. When exceding the load limit, # no new worker will be started until the current load is below the limit. # No limit will be used when set to 0. load_limit1=0 # Same as load_limit1 but for the 5min load average. load_limit5=0 # Same as load_limit1 but for the 15min load average. load_limit15=0 # Use this option to show stderr output of plugins too. # Default: yes show_error_output=yes # Use dup_results_are_passive to set if the duplicate result send to the dupserver # will be passive or active. # Default is yes (passive). #dup_results_are_passive=yes # When embedded perl has been compiled in, you can use this # switch to enable or disable the embedded perl interpreter. enable_embedded_perl=on # Default value used when the perl script does not have a # "nagios: +epn" or "nagios: -epn" set. # Perl scripts not written for epn support usually fail with epn, # so its better to set the default to off. use_embedded_perl_implicitly=off # Cache compiled perl scripts. This makes the worker process a little # bit bigger but makes execution of perl scripts even faster. # When turned off, Mod-Gearman will still use the embedded perl # interpreter, but will not cache the compiled script. use_perl_cache=on # path to p1 file which is used to execute and cache the # perl scripts run by the embedded perl interpreter p1_file=%P1FILE% # Workarounds # workaround for rc 25 bug # duplicate jobs from gearmand result in exit code 25 of plugins # because they are executed twice and get killed because of using # the same ressource. # Sending results (when exit code is 25 ) will be skipped with this # enabled. workaround_rc_25=off mod_gearman-1.4.14/etc/mod_gearman_logrotate0000644001161000116100000000044612212675260016021 00000000000000/var/log/mod_gearman/mod_gearman_worker.log { missingok notifempty sharedscripts postrotate /etc/init.d/mod_gearman_worker reload > /dev/null 2>/dev/null || true endscript } /var/log/mod_gearman/mod_gearman_neb.log { missingok notifempty copytruncate } mod_gearman-1.4.14/etc/mod_gearman_neb.conf.in0000644001161000116100000001246012141667303016115 00000000000000############################################################################### # # Mod-Gearman - distribute checks with gearman # # Copyright (c) 2010 Sven Nierlein # # Mod-Gearman NEB Module Config # ############################################################################### # use debug to increase the verbosity of the module. # Possible values are: # 0 = only errors # 1 = debug messages # 2 = trace messages # 3 = trace and all gearman related logs are going to stdout. # Default is 0. debug=0 # Path to the logfile. logfile=%LOGFILE_NEB% # sets the addess of your gearman job server. Can be specified # more than once to add more server. server=localhost:4730 # sets the address of your 2nd (duplicate) gearman job server. Can # be specified more than once o add more servers. #dupserver=: # defines if the module should distribute execution of # eventhandlers. eventhandler=yes # defines if the module should distribute execution of # service checks. services=yes # defines if the module should distribute execution of # host checks. hosts=yes # sets a list of hostgroups which will go into seperate # queues. Either specify a comma seperated list or use # multiple lines. #hostgroups=name1 #hostgroups=name2,name3 # sets a list of servicegroups which will go into seperate # queues. #servicegroups=name1,name2,name3 # Set this to 'no' if you want Mod-Gearman to only take care of # 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 # This settings determines if all eventhandlers go into a single # 'eventhandlers' queue or into the same queue like normal checks # would do. route_eventhandler_like_checks=no # enables or disables encryption. It is strongly # advised to not disable encryption. Anybody will be # able to inject packages to your worker. # Encryption is enabled by default and you have to # explicitly disable it. # When using encryption, you will either have to # specify a shared password with key=... or a # keyfile with keyfile=... # Default is On. encryption=yes # A shared password which will be used for # encryption of data pakets. Should be at least 8 # bytes long. Maximum length is 32 characters. key=should_be_changed # The shared password will be read from this file. # Use either key or keyfile. Only the first 32 # characters will be used. #keyfile=/path/to/secret.file # use_uniq_jobs # Using uniq keys prevents the gearman queues from filling up when there # is no worker. However, gearmand seems to have problems with the uniq # key and sometimes jobs get stuck in the queue. Set this option to 'off' # when you run into problems with stuck jobs but make sure your worker # are running. use_uniq_jobs=on ############################################################################### # # NEB Module Config # # the following settings are for the neb module only and # will be ignored by the worker. # ############################################################################### # sets a list of hostgroups which will not be executed # by gearman. They are just passed through. # Default is none localhostgroups= # sets a list of servicegroups which will not be executed # by gearman. They are just passed through. # Default is none localservicegroups= # The queue_custom_variable can be used to define the target queue # by a custom variable in addition to host/servicegroups. When set # for ex. to 'WORKER' you then could define a '_WORKER' custom # variable for your hosts and services to directly set the worker # queue. The host queue is inherited unless overwritten # by a service custom variable. Set the value of your custom # variable to 'local' to bypass Mod-Gearman (Same behaviour as in # localhostgroups/localservicegroups). #queue_custom_variable=WORKER # Number of result worker threads. Usually one is # enough. You may increase the value if your # result queue is not processed fast enough. # Default: 1 result_workers=1 # defines if the module should distribute perfdata # to gearman. # Note: processing of perfdata is not part of # mod_gearman. You will need additional worker for # handling performance data. For example: pnp4nagios # Performance data is just written to the gearman # queue. # Default: no perfdata=no # perfdata mode overwrite helps preventing the perdata queue getting to big # 1 = overwrote # 2 = append perfdata_mode=1 # The Mod-Gearman NEB module will submit a fake result for orphaned host # checks with a message saying there is no worker running for this # queue. Use this option to get better reporting results, otherwise your # hosts will keep their last state as long as there is no worker # running. # Default: yes orphan_host_checks=yes # Same like 'orphan_host_checks' but for services. # Default: yes orphan_service_checks=yes # When accept_clear_results is enabled, the NEB module will accept unencrypted # results too. This is quite useful if you have lots of passive checks and make # use of send_gearman/send_multi where you would have to spread the shared key to # all clients using these tools. # Default is no. accept_clear_results=no mod_gearman-1.4.14/TODO0000644001161000116100000000053111552775016011463 00000000000000TODO LIST ========= General ------- - handle sync host checks correctly - maybe use libmcrypt for encryption - "include" directorys for the config file Bugs ---- - none known WISH LIST ========= - no need to fork for clean plugins. (check_icmp, check_http...) - implement some plugins directly into worker - sync command for worker