[Nagiosplug-checkins] nagiosplug/plugins check_tcp.c,1.85,1.86

Thomas Guyot dermoth at users.sourceforge.net
Thu Feb 1 07:53:14 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9331/plugins

Modified Files:
	check_tcp.c 
Log Message:
Fix progname being partly set to upper case
Change formating of invalid hostname output


Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- check_tcp.c	31 Jan 2007 04:47:30 -0000	1.85
+++ check_tcp.c	1 Feb 2007 06:53:11 -0000	1.86
@@ -112,7 +112,7 @@
 
 	len = strlen(progname);
 	if(len > 6 && !memcmp(progname, "check_", 6)) {
-		SERVICE = progname + 6;
+		SERVICE = strdup(progname + 6);
 		for(i = 0; i < len - 6; i++)
 			SERVICE[i] = toupper(SERVICE[i]);
 	}
@@ -588,7 +588,7 @@
 	if (server_address == NULL)
 		usage4 (_("You must provide a server address"));
 	else if (server_address[0] != '/' && is_host (server_address) == FALSE)
-		die (STATE_CRITICAL, "%s: %s - %s\n", progname, _("Invalid hostname, address or socket"), server_address);
+		die (STATE_CRITICAL, "%s %s - %s: %s\n", SERVICE, state_text(STATE_CRITICAL), _("Invalid hostname, address or socket"), server_address);
 
 	return TRUE;
 }





More information about the Commits mailing list