SF.net SVN: nagiosplug: [1985] nagiosplug/trunk/plugins-root

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 1985
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1985&view=rev
Author:   dermoth
Date:     2008-04-29 02:01:31 -0700 (Tue, 29 Apr 2008)

Log Message:
-----------
--help output cleanup (plus removal of spaces on blank lines)

Modified Paths:
--------------
    nagiosplug/trunk/plugins-root/check_dhcp.c
    nagiosplug/trunk/plugins-root/check_icmp.c

Modified: nagiosplug/trunk/plugins-root/check_dhcp.c
===================================================================
--- nagiosplug/trunk/plugins-root/check_dhcp.c	2008-04-27 14:35:26 UTC (rev 1984)
+++ nagiosplug/trunk/plugins-root/check_dhcp.c	2008-04-29 09:01:31 UTC (rev 1985)
@@ -274,7 +274,7 @@
 
 	/* this plugin almost certainly needs root permissions. */
 	np_warn_if_not_root();
-	
+
 	/* create socket for DHCP communications */
 	dhcp_socket=create_dhcp_socket();
 
@@ -316,7 +316,7 @@
 
 	strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name)-1);
 	ifr.ifr_name[sizeof(ifr.ifr_name)-1]='\0';
-	
+
 	/* try and grab hardware address of requested interface */
 	if(ioctl(sock,SIOCGIFHWADDR,&ifr)<0){
                 printf(_("Error: Could not get hardware address of interface '%s'\n"),interface_name);
@@ -506,7 +506,7 @@
 		opts += sizeof(requested_address);
 	        }
 	discover_packet.options[opts++]=DHCP_OPTION_END;
-	
+
 	/* unicast fields */
 	if(unicast)
 		discover_packet.giaddr.s_addr = my_ip.s_addr;
@@ -571,7 +571,7 @@
 
 		result=OK;
 		result=receive_dhcp_packet(&offer_packet,sizeof(offer_packet),sock,dhcpoffer_timeout,&source);
-		
+
 		if(result!=OK){
 			if(verbose)
 				printf(_("Result=ERROR\n"));
@@ -952,7 +952,7 @@
 		next_server=this_server->next;
 		free(this_server);
 	        }
-	
+
 	return OK;
         }
 
@@ -977,7 +977,7 @@
 				/* get max lease time we were offered */
 				if(temp_offer->lease_time>max_lease_time || temp_offer->lease_time==DHCP_INFINITE_TIME)
 					max_lease_time=temp_offer->lease_time;
-				
+
 				/* see if we got the address we requested */
 				if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address)))
 					received_requested_address=TRUE;
@@ -1009,7 +1009,7 @@
 			/* get max lease time we were offered */
 			if(temp_offer->lease_time>max_lease_time || temp_offer->lease_time==DHCP_INFINITE_TIME)
 				max_lease_time=temp_offer->lease_time;
-				
+
 			/* see if we got the address we requested */
 			if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address)))
 				received_requested_address=TRUE;
@@ -1387,7 +1387,7 @@
 
 	printf("Copyright (c) 2001-2004 Ethan Galstad ([email protected])\n");
 	printf (COPYRIGHT, copyright, email);
-	
+
 	printf("%s\n", _("This plugin tests the availability of DHCP servers on a network."));
 
   printf ("\n\n");
@@ -1411,17 +1411,18 @@
   printf (" %s\n", "-u, --unicast");
   printf ("    %s\n", _("Unicast testing: mimic a DHCP relay, requires -s"));
 
+  printf (_(UT_SUPPORT));
 	return;
 	}
 
 
 void
 print_usage(void){
-	
+
   printf (_("Usage:"));
   printf (" %s [-v] [-u] [-s serverip] [-r requestedip] [-t timeout]\n",progname);
   printf ("                  [-i interface] [-m mac]\n");
-  
+
 	return;
 	}
 

Modified: nagiosplug/trunk/plugins-root/check_icmp.c
===================================================================
--- nagiosplug/trunk/plugins-root/check_icmp.c	2008-04-27 14:35:26 UTC (rev 1984)
+++ nagiosplug/trunk/plugins-root/check_icmp.c	2008-04-29 09:01:31 UTC (rev 1985)
@@ -378,7 +378,7 @@
 	setlocale (LC_ALL, "");
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
-	
+
 	/* print a helpful error message if geteuid != 0 */
 	np_warn_if_not_root();
 
@@ -646,7 +646,7 @@
 								 table[t]->name);
 				continue;
 			}
-			
+
 			/* we're still in the game, so send next packet */
 			(void)send_icmp_ping(icmp_sock, table[t]);
 			result = wait_for_reply(icmp_sock, target_interval);
@@ -1253,16 +1253,16 @@
 {
 
   /*print_revision (progname, revision);*/ /* FIXME: Why? */
-  
+
   printf ("Copyright (c) 2005 Andreas Ericsson <[email protected]>\n");
   printf (COPYRIGHT, copyright, email);
-  
+
   printf ("\n\n");
-  
+
   print_usage ();
-  
+
   printf (_(UT_HELP_VRSN));
-  
+
   printf (" %s\n", "-H");
   printf ("    %s\n", _("specify a target"));
   printf (" %s\n", "-w");
@@ -1297,23 +1297,25 @@
   printf ("    %s\n", _("verbose"));
 
   printf ("\n");
-	printf ("%s\n\n", _("The -H switch is optional. Naming a host (or several) to check is not."));
-  printf ("%s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"));
-  printf ("%s\n", _("packet loss.  The default values should work well for most users."));
-  printf ("%s\n", _("You can specify different RTA factors using the standardized abbreviations"));
-  printf ("%s\n\n", _("us (microseconds), ms (milliseconds, default) or just plain s for seconds."));
+  printf ("%s\n", _("Notes:"));
+  printf (" %s\n", _("The -H switch is optional. Naming a host (or several) to check is not."));
+  printf ("\n");
+  printf (" %s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"));
+  printf (" %s\n", _("packet loss.  The default values should work well for most users."));
+  printf (" %s\n", _("You can specify different RTA factors using the standardized abbreviations"));
+  printf (" %s\n", _("us (microseconds), ms (milliseconds, default) or just plain s for seconds."));
 /* -d not yet implemented */
 /*  printf ("%s\n", _("Threshold format for -d is warn,crit.  12,14 means WARNING if >= 12 hops"));
   printf ("%s\n", _("are spent and CRITICAL if >= 14 hops are spent."));
   printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/
-  printf ("%s\n\n", _("The -v switch can be specified several times for increased verbosity."));
+  printf ("\n");
+  printf (" %s\n", _("The -v switch can be specified several times for increased verbosity."));
 
 /*  printf ("%s\n", _("Long options are currently unsupported."));
   printf ("%s\n", _("Options marked with * require an argument"));
 */
+
   printf (_(UT_SUPPORT));
-  
-  printf (_(UT_NOWARRANTY));
 }
 
 
@@ -1322,5 +1324,5 @@
 print_usage (void)
 {
   printf (_("Usage:"));
-  printf(" %s [options] [-H] host1 host2 hostn\n", progname);
+  printf(" %s [options] [-H] host1 host2 hostN\n", progname);
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.