[Nagiosplug-checkins] nagiosplug/plugins check_http.c,1.65,1.66

Matthew Kent mattkent at users.sourceforge.net
Wed Nov 24 12:19:15 CET 2004


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

Modified Files:
	check_http.c 
Log Message:
Added support for sending port in host header (913633)


Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- check_http.c	24 Nov 2004 00:46:38 -0000	1.65
+++ check_http.c	24 Nov 2004 04:25:52 -0000	1.66
@@ -330,6 +330,8 @@
 		/* Note: H, I, and u must be malloc'd or will fail on redirects */
 		case 'H': /* Host Name (virtual host) */
  			host_name = strdup (optarg);
+			if (strstr (optarg, ":"))
+				sscanf (optarg, "%*[^:]:%d", &server_port);
 			break;
 		case 'I': /* Server IP-address */
  			server_address = strdup (optarg);
@@ -1381,6 +1383,7 @@
 	printf (_("\
  -H, --hostname=ADDRESS\n\
     Host name argument for servers using host headers (virtual host)\n\
+    Append a port to include it in the header (eg: example.com:5000)\n\
  -I, --IP-address=ADDRESS\n\
    IP address or name (use numeric address if possible to bypass DNS lookup).\n\
  -p, --port=INTEGER\n\





More information about the Commits mailing list