summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 911af3e)
raw | patch | inline | side by side (parent: 911af3e)
author | Benoit Mortier <opensides@users.sourceforge.net> | |
Wed, 8 Dec 2004 00:36:19 +0000 (00:36 +0000) | ||
committer | Benoit Mortier <opensides@users.sourceforge.net> | |
Wed, 8 Dec 2004 00:36:19 +0000 (00:36 +0000) |
minor internationalization fixes
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1013 f882894a-f735-0410-b71e-b25c423dba1c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1013 f882894a-f735-0410-b71e-b25c423dba1c
diff --git a/configure.in b/configure.in
index 36f86051808c3fb7867ff134387f856f2d58f128..65dc698a95ddf174b1270a9a75ab0346abda098b 100644 (file)
--- a/configure.in
+++ b/configure.in
AC_SUBST(LDAPINCLUDE)
AC_CHECK_FUNCS(ldap_set_option)
EXTRAS="$EXTRAS check_ldap"
+ AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
else
AC_MSG_WARN([Skipping LDAP plugin])
AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index eb67e458e2446f9da6363ecfac4d128267afa5b1..2c0a5c2d97d1c39c7abf7fcee9e185d251b8beb2 100644 (file)
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
install-exec-hook:
cd $(DESTDIR)$(libexecdir) && \
- for i in $(check_tcp_programs) ; do rm -f $$i; ln -s check_tcp $$i ; done
-
+ for i in $(check_tcp_programs) ; do rm -f $$i; ln -s check_tcp $$i ; done ;\
+ rm -f check_ldaps ; ln -s -f check_ldap check_ldaps
+
clean-local:
rm -f $(check_tcp_programs)
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index dd2230a00f26b80867eff26a9bb5ca848cfb6c74..f31c9c61b6984536e7a872030cdd1f1593b6b7a4 100644 (file)
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
all of -O, -s, and -n options (servicelist order must match '-C'\n\
options)\n"));
- printf (_("\n\
+ printf ("\n\
$ check_by_ssh -H localhost -n lh -s c1:c2:c3 \\\n\
-C uptime -C uptime -C uptime -O /tmp/foo\n\
$ cat /tmp/foo\n\
[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c1;0; up 2 days...\n\
[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days...\n\
-[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days...\n"));
+[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days...\n");
printf (_(UT_SUPPORT));
}
diff --git a/plugins/check_game.c b/plugins/check_game.c
index 9a6e53e70480efdc0fe4df16661512882f8d1120..6699c71dddc7f3992e8b99e83ed76ad369aaa41f 100644 (file)
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
print_revision (progname, revision);
printf ("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n");
- printf (_(COPYRIGHT), copyright, email);
+ printf (COPYRIGHT, copyright, email);
- printf (_("This plugin tests game server connections with the specified host."), progname);
+ printf (_("This plugin tests game server connections with the specified host."));
print_usage ();
diff --git a/plugins/check_http.c b/plugins/check_http.c
index dd0582199fdd721583ba54bf04331eeeed414ad5..5f96e31e78b23bc49e5f482f74a8a8850564b841 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
void
print_usage (void)
{
- printf (_("\
+ printf ("\
Usage: %s -H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>]\n\
[-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\
[-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\
[-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
[-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>]\n\
- [-A string] [-k string]\n"), progname);
+ [-A string] [-k string]\n", progname);
}
index 1c0af310873303ae2acb559153bd0570ba3707ac..644dc4881c0c48d0b363fb9e7ff27ea06f890585 100644 (file)
printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>\n");
printf (COPYRIGHT, copyright, email);
- printf (_("\
+ printf ("\
Usage: %s [DEVICE] [OPTION]\n\
-d, --device=DEVICE\n\
Select device DEVICE\n\
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index e77ad30835da50f2f2e6631149ca328bd693c6c9..29bc01b212d001f8805edda0b103a4e7cb2bce20 100644 (file)
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
double crit_time = UNDEFINED;
struct timeval tv;
+/* for ldap tls */
+
+char *SERVICE = "LDAP";
+
int
main (int argc, char *argv[])
{
int status = STATE_UNKNOWN;
long microsec;
double elapsed_time;
+
+ /* for ldap tls */
+
+ int tls;
+ int version=3;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ if (strstr(argv[0],"check_ldaps")) {
+ asprintf (&progname, "check_ldaps");
+ }
+
if (process_arguments (argc, argv) == ERROR)
usage4 (_("Could not parse arguments"));
gettimeofday (&tv, NULL);
/* initialize ldap */
+#ifdef HAVE_LDAP_INIT
+ if (!(ld = ldap_init (ld_host, ld_port))) {
+ printf ("Could not connect to the server at port %i\n", ld_port);
+ return STATE_CRITICAL;
+ }
+#else
if (!(ld = ldap_open (ld_host, ld_port))) {
/*ldap_perror(ld, "ldap_open"); */
printf (_("Could not connect to the server at port %i\n"), ld_port);
return STATE_CRITICAL;
}
-
+#endif /* HAVE_LDAP_INIT */
+
#ifdef HAVE_LDAP_SET_OPTION
/* set ldap options */
if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) !=
return STATE_CRITICAL;
}
#endif
+
+ if (strstr(argv[0],"check_ldaps")) {
+ /* with TLS */
+ if ( ld_port == LDAPS_PORT ) {
+ asprintf (&SERVICE, "LDAPS");
+#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)
+ /* ldaps: set option tls */
+ tls = LDAP_OPT_X_TLS_HARD;
+
+ if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS)
+ {
+ /*ldap_perror(ld, "ldaps_option"); */
+ printf ("Could not init TLS at port %i!\n", ld_port);
+ return STATE_CRITICAL;
+ }
+#else
+ printf ("TLS not supported by the libraries!\n", ld_port);
+ return STATE_CRITICAL;
+#endif /* LDAP_OPT_X_TLS */
+ } else {
+ asprintf (&SERVICE, "LDAP-TLS");
+#if defined(HAVE_LDAP_SET_OPTION) && defined(HAVE_LDAP_START_TLS_S)
+ /* ldap with startTLS: set option version */
+ if (ldap_get_option(ld,LDAP_OPT_PROTOCOL_VERSION, &version) == LDAP_OPT_SUCCESS )
+ {
+ if (version < LDAP_VERSION3)
+ {
+ version = LDAP_VERSION3;
+ ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version);
+ }
+ }
+ /* call start_tls */
+ if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)
+ {
+ /*ldap_perror(ld, "ldap_start_tls"); */
+ printf ("Could not init startTLS at port %i!\n", ld_port);
+ return STATE_CRITICAL;
+ }
+#else
+ printf ("startTLS not supported by the library, needs LDAPv3!\n");
+ return STATE_CRITICAL;
+#endif /* HAVE_LDAP_START_TLS_S */
+ }
+ }
+
/* bind to the ldap server */
if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) !=
LDAP_SUCCESS) {
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index ab110fbd0fb86c0593f92ac191127754c973a46c..c1c4ea831b7db57093296956fe12ebb9fbde1e94 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
}
else if ( strcmp(seclevel, "authPriv") == 0 ) {
if ( secname == NULL || authpasswd == NULL || privpasswd == NULL ) {
- printf (("Missing secname (%s), authpassword (%s), or privpasswd (%s)! \n"),secname, authpasswd,privpasswd );
+ printf (_("Missing secname (%s), authpassword (%s), or privpasswd (%s)! \n"),secname, authpasswd,privpasswd );
print_usage ();
exit (STATE_UNKNOWN);
}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index ce57631a5c89543d35043ec855f36fcc012039cb..7d8d814962aef737daf1a505bec8c2b24e21d783 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
- usage2 (_("invalid hostname/address"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
server_address = optarg;
break;
case 'c': /* critical */