[Nagiosplug-checkins] nagiosplug/plugins Makefile.am,1.39,1.40 check_by_ssh.c,1.33,1.34 check_game.c,1.20,1.21 check_http.c,1.77,1.78 check_ide_smart.c,1.1,1.2 check_ldap.c,1.27,1.28 check_snmp.c,1.49,1.50 check_tcp.c,1.57,1.58
Benoit Mortier
opensides at users.sourceforge.net
Tue Dec 7 16:37:05 CET 2004
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24255/plugins
Modified Files:
Makefile.am check_by_ssh.c check_game.c check_http.c
check_ide_smart.c check_ldap.c check_snmp.c check_tcp.c
Log Message:
patch 1028033
minor internationalization fixes
Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- check_tcp.c 4 Dec 2004 12:12:29 -0000 1.57
+++ check_tcp.c 8 Dec 2004 00:36:19 -0000 1.58
@@ -479,7 +479,7 @@
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 */
Index: Makefile.am
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/Makefile.am,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- Makefile.am 7 Dec 2004 06:51:53 -0000 1.39
+++ Makefile.am 8 Dec 2004 00:36:18 -0000 1.40
@@ -140,8 +140,9 @@
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)
Index: check_game.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_game.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- check_game.c 3 Dec 2004 23:55:28 -0000 1.20
+++ check_game.c 8 Dec 2004 00:36:19 -0000 1.21
@@ -300,9 +300,9 @@
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 ();
Index: check_ldap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ldap.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- check_ldap.c 3 Dec 2004 23:55:28 -0000 1.27
+++ check_ldap.c 8 Dec 2004 00:36:19 -0000 1.28
@@ -57,6 +57,10 @@
double crit_time = UNDEFINED;
struct timeval tv;
+/* for ldap tls */
+
+char *SERVICE = "LDAP";
+
int
main (int argc, char *argv[])
{
@@ -69,11 +73,20 @@
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"));
@@ -87,12 +100,19 @@
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) !=
@@ -101,6 +121,51 @@
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) {
Index: check_by_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_by_ssh.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- check_by_ssh.c 4 Dec 2004 12:31:41 -0000 1.33
+++ check_by_ssh.c 8 Dec 2004 00:36:19 -0000 1.34
@@ -393,13 +393,13 @@
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));
}
Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- check_snmp.c 5 Dec 2004 22:07:30 -0000 1.49
+++ check_snmp.c 8 Dec 2004 00:36:19 -0000 1.50
@@ -656,7 +656,7 @@
}
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);
}
Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- check_http.c 5 Dec 2004 00:54:09 -0000 1.77
+++ check_http.c 8 Dec 2004 00:36:19 -0000 1.78
@@ -1490,11 +1490,11 @@
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: check_ide_smart.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ide_smart.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- check_ide_smart.c 4 Dec 2004 12:12:29 -0000 1.1
+++ check_ide_smart.c 8 Dec 2004 00:36:19 -0000 1.2
@@ -498,7 +498,7 @@
printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar at lightside.dhis.org>\n");
printf (COPYRIGHT, copyright, email);
- printf (_("\
+ printf ("\
Usage: %s [DEVICE] [OPTION]\n\
-d, --device=DEVICE\n\
Select device DEVICE\n\
More information about the Commits
mailing list