From b0307d7a99c56b2d77bc80f7f931e7016b9d4e39 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Thu, 1 Feb 2007 06:53:12 +0000 Subject: Fix progname being partly set to upper case Change formating of invalid hostname output git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1604 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_tcp.c | 4 ++-- plugins/t/check_jabber.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index d4d03223..66bf4489 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -112,7 +112,7 @@ main (int argc, char **argv) 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 @@ process_arguments (int argc, char **argv) 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; } diff --git a/plugins/t/check_jabber.t b/plugins/t/check_jabber.t index 07742214..6a3d4ef7 100644 --- a/plugins/t/check_jabber.t +++ b/plugins/t/check_jabber.t @@ -34,7 +34,7 @@ my $jabberOK = '/JABBER OK\s-\s\d+\.\d+\ssecond response time on port 5222/'; my $jabberUnresponsive = '/CRITICAL\s-\sSocket timeout after\s\d+\sseconds/'; -my $jabberInvalid = '/check_JABBER: Invalid hostname, address or socket\s-\s.+/'; +my $jabberInvalid = '/JABBER CRITICAL - Invalid hostname, address or socket:\s.+/'; my $r; -- cgit v1.2.3-74-g34f1