[Nagiosplug-devel] check_procs, check_ldap compile errors

Andreas Ericsson ae at op5.se
Thu Dec 2 11:04:02 CET 2004


Andreas Ericsson wrote:
> While localization is all good and dandy, try once in a while building 
> with --disable-nls. It throws an error on check_dns, check_procs and 
> check_ldap without this patch.
> 

Sorry for reposting, and sorry for posting the patch here in the first 
place. I've added the patch to the tracker thingie at sourceforge.

> The patch is trivial and I'm sure it'll work (although I haven't tested 
> running the plugins, they build cleanly).
> 
> Apply with patch -p1.
> 
> 
> ------------------------------------------------------------------------
> 
> diff -urN ../nagiosplug.orig/plugins/check_ldap.c ./plugins/check_ldap.c
> --- ../nagiosplug.orig/plugins/check_ldap.c	Thu Dec  2 14:12:56 2004
> +++ ./plugins/check_ldap.c	Thu Dec  2 14:18:19 2004
> @@ -335,6 +335,13 @@
>  Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n\
>    [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n\
>  (Note: all times are in seconds.)\n"),
> -	        progname, (HAVE_LDAP_SET_OPTION ? "[-2|-3] [-4|-6]" : ""));
> +	        progname,
> +#ifdef HAVE_LDAP_SET_OPTION
> +			" [-2|-3] [-4|-6]"
> +#else
> +			""
> +#endif
> +			);
> +
>  	printf (_(UT_HLP_VRS), progname, progname);
>  }
> diff -urN ../nagiosplug.orig/plugins/check_procs.c ./plugins/check_procs.c
> --- ../nagiosplug.orig/plugins/check_procs.c	Thu Dec  2 13:43:43 2004
> +++ ./plugins/check_procs.c	Thu Dec  2 14:16:27 2004
> @@ -278,7 +278,7 @@
>  			printf (_("%d crit, %d warn out of "), crit, warn);
>  		}
>  	} 
> -	printf (ngettext ("%d process", "%d processes", (unsigned long) procs), procs);
> +	printf ("%d %s", procs, procs == 1 ? _("process") : _("processes"));
>  	
>  	if (strcmp(fmt,"") != 0) {
>  		printf (_(" with %s"), fmt);
> diff -urN ../nagiosplug.orig/plugins/check_dns.c ./plugins/check_dns.c
> --- ../nagiosplug.orig/plugins/check_dns.c	Thu Dec  2 13:43:43 2004
> +++ ./plugins/check_dns.c	Thu Dec  2 14:25:26 2004
> @@ -198,7 +198,7 @@
>  			multi_address = TRUE;
>  
>  		printf ("DNS %s: ", _("OK"));
> -		printf (ngettext("%.3f second response time, ", "%.3f seconds response time, ", elapsed_time), elapsed_time);
> +		printf (_("%.3f seconds response time), ", elapsed_time);
>  		printf (_("%s returns %s"), query_address, address);
>  		printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
>  	}

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer




More information about the Devel mailing list