Преглед изворни кода

Merge branch 'maint' into gcc73-fixes

Mario Trangoni пре 7 година
родитељ
комит
2562c6833a
59 измењених фајлова са 1837 додато и 1460 уклоњено
  1. 2 2
      CODING
  2. 11 10
      NEWS
  3. 1 1
      NPTest.pm
  4. 7 7
      ROADMAP
  5. 2 0
      THANKS.in
  6. 1 1
      build-aux/ltmain.sh
  7. 4 4
      configure.ac
  8. 5 5
      doc/developer-guidelines.sgml
  9. 2 2
      gl/m4/libtool.m4
  10. 1 1
      gl/m4/ltsugar.m4
  11. 1 1
      gl/mountlist.h
  12. 1 1
      gl/regexec.c
  13. 2 2
      lib/parse_ini.c
  14. 1 1
      lib/tests/test_cmd.c
  15. 2 2
      lib/tests/test_disk.c
  16. 1 1
      lib/tests/test_utils.c
  17. 1 1
      m4/np_mysqlclient.m4
  18. 1644 1314
      plugins-root/check_icmp.c
  19. 1 1
      plugins-root/pst3.c
  20. 5 5
      plugins-scripts/check_ifoperstatus.pl
  21. 2 2
      plugins-scripts/check_ifstatus.pl
  22. 2 2
      plugins-scripts/check_ircd.pl
  23. 7 3
      plugins-scripts/check_log.sh
  24. 1 1
      plugins-scripts/check_mailq.pl
  25. 3 3
      plugins-scripts/check_ntp.pl
  26. 7 7
      plugins/check_disk.c
  27. 1 1
      plugins/check_dns.c
  28. 2 2
      plugins/check_fping.c
  29. 2 2
      plugins/check_http.c
  30. 3 3
      plugins/check_ide_smart.c
  31. 1 1
      plugins/check_ldap.c
  32. 1 1
      plugins/check_load.c
  33. 1 1
      plugins/check_mrtg.c
  34. 1 1
      plugins/check_mrtgtraf.c
  35. 7 7
      plugins/check_ntp.c
  36. 4 4
      plugins/check_ntp_peer.c
  37. 2 2
      plugins/check_ntp_time.c
  38. 2 2
      plugins/check_pgsql.c
  39. 1 1
      plugins/check_procs.c
  40. 2 2
      plugins/check_radius.c
  41. 2 2
      plugins/check_real.c
  42. 1 1
      plugins/check_smtp.c
  43. 1 1
      plugins/check_snmp.c
  44. 24 14
      plugins/check_swap.c
  45. 1 1
      plugins/check_tcp.c
  46. 30 0
      plugins/netutils.c
  47. 2 2
      plugins/remove_perfdata.c
  48. 5 5
      plugins/t/check_by_ssh.t
  49. 4 4
      plugins/t/check_disk.t
  50. 1 1
      plugins/t/check_mysql.t
  51. 1 1
      plugins/t/check_nagios.t
  52. 2 2
      plugins/tests/check_snmp.t
  53. 1 1
      plugins/utils.h
  54. 6 6
      po/nagios-plugins.pot
  55. 2 2
      tap/tap.3
  56. 1 1
      tap/tap.h
  57. 3 3
      tools/build_perl_modules.in
  58. 1 1
      tools/p1.pl
  59. 2 2
      tools/tinderbox_build

+ 2 - 2
CODING

@@ -136,7 +136,7 @@ $service_port instead of $ServicePort as the former is much more readable.
 -4, (use IPv4)
 -6, (use IPv6)
 
-Recommended, but not reserverd: 
+Recommended, but not reserved:
 
 -I, --ipaddress = STRING
 -C, --community = STRING
@@ -146,6 +146,6 @@ Recommended, but not reserverd:
 -P, --port = INT
 -u, --url = STRING (also --username if --url is not needed)
 
-Port really should alway be '-P' (uppercase) -- but the plugins
+Port really should always be '-P' (uppercase) -- but the plugins
 are currently inconsistent in that regard and may be hard to change
 as we do not want to break compatibility with earlier syntax.

+ 11 - 10
NEWS

@@ -18,6 +18,7 @@ This file documents the major additions and syntax changes between releases.
 	check_ldap: Add support for checking LDAP cert age (Guillaume Rousse)
 	check_icmp: Add Jitter, MOS, Score (Alessandro Ren)
 	check_radius: Add calling-station-id (cejkar)
+	check_swap: Add --no-swap flag (Mario Trangoni)
 	ssl_utils: Added certificate expiry data in OK status (check_http, check_smtp, check_tcp) (Matt Capra)
 
 
@@ -160,20 +161,20 @@ This file documents the major additions and syntax changes between releases.
 	check_dig honor the -4 and -6 switches
 	check_ntp_peer: do not use uninitialized results for max state
 	check_log.sh, check_oracle.sh, check_sensors.sh: Setting PATH at first
-	check_log.sh: droping path from basename while evaluating PROGNAME
+	check_log.sh: dropping path from basename while evaluating PROGNAME
 	check_tcp: Fix check_jabber to work with Openfire servers
 	check_ifstatus.pl: Fix "-n" and "-u" options to ignore if either is set, not just both
 	check_mrtgtraf: Fix perfdata to comply with perfdata UOM definition
 	check_real, check_ntp: fix null termination
 	check_apt: fix memset
-	check_ssh: change warning to critical for protocal/version errors
+	check_ssh: change warning to critical for protocol/version errors
 	utils_cmd.c: avoid a segfault, if ulimit is set to unlimited
 	utils_cmd.c: make constants from maxfd values
 	configure.ac: Added particular ps command for HP-UX
 	check_disk: Fix pthread start routine type
 	check_http: Make header_value() and chunked-encoding decoding more robust
 	check_http: fix Host header if explicitly set with -k
-	sslutils.c: Forcing furter restriction of ciphers for current security concerns
+	sslutils.c: Forcing further restriction of ciphers for current security concerns
 	check_nagios, check_procs: Enable check_proc to monitor processes in PID name-spaced environments.
 	check_dhcp.c: use /dev/urandom if available
 	check_http.c: Don't decode page if it's not there
@@ -211,7 +212,7 @@ This file documents the major additions and syntax changes between releases.
 	test.pl.in: Use "C" locale when running test suite
 	check_http.t: Adjust date strings to the now-localized output
 	check_dns.t - Fix Perl Warning. perl doesn't understand /d within "".
-	check_snmp.t: skip extented snmp tests if snmpd has no perl support
+	check_snmp.t: skip extended snmp tests if snmpd has no perl support
 	check_snmp.t: fix snmp test for included threshold
 	check_http.t: fix tests for certificates expire date with seconds
 	check_http.t: add faketime based tests for check_http
@@ -304,7 +305,7 @@ This file documents the major additions and syntax changes between releases.
 	check_nt.c - Changed 'Mb' to 'MB' in MEMUSE output for clarity (abrist)
 
 2.0.1 15th April 2014
-	ENHANCMENTS
+	ENHANCEMENTS
 	check_snmp.c - Added thresholds to performance data (jccomputing)
 	check_http.c - Added */* MIME support (Alex Gottschalk)
 	check_mailq.pl - Added autodetection for mailq implementation (evgeni)
@@ -414,10 +415,10 @@ This file documents the major additions and syntax changes between releases.
 	New check_procs -k option to ignore kernel threads (on Linux)
 	Let check_procs use /proc/<PID>/exe (if available) instead of getpid(2), unless -T is specified
 	Let check_mysql support SSL
-	Let check_mysql add perfromance metrics for all checks
+	Let check_mysql add performance metrics for all checks
 	New check_mysql -f option to specify a client options file
 	New check_mysql -g option to specify a client options group
-	New check_snmp --offset option to allow for adding/substracting an offset value to sensor data
+	New check_snmp --offset option to allow for adding/subtracting an offset value to sensor data
 	Let check_snmp support an arbitrary number of OIDs
 	Let check_ide_smart support NetBSD
 
@@ -432,7 +433,7 @@ This file documents the major additions and syntax changes between releases.
 	Fix deprecated imports of check_nmap.py (Fabio Rueda)
 
 	WARNINGS
-	check_http behaviour of -k/--header changed since it does not seperate multiple headers by semicolons anymore. Use multiple -k switches instead.
+	check_http behaviour of -k/--header changed since it does not separate multiple headers by semicolons anymore. Use multiple -k switches instead.
 	check_http's --proxy_authorization option is now called --proxy-authorization (it was always documented this way)
 	The contrib directory has been removed from this distribution
 
@@ -583,7 +584,7 @@ This file documents the major additions and syntax changes between releases.
 	check_ntp and check_ntp_peer now show proper jitter/stratum thresholds longopts in --help
 	check_dns now allow to repeat -a to match multiple possibly returned address (common with load balancers)
 	check_mysql and check_radius now try clearing password in processlist just like check_mysql_query
-	check_mysql and check_mysql_query now support sockets explicitely (-s, --socket)
+	check_mysql and check_mysql_query now support sockets explicitly (-s, --socket)
 	negate now has the ability to replace the status text as well (-s, --substitute)
 	Added performance data to check_ping (Christian Schneemann)
 	Added support for --extra-opts in all C plugins (disabled by default, see configure --help)
@@ -623,7 +624,7 @@ This file documents the major additions and syntax changes between releases.
 	New check_disk option -L: Only check local filesystems, but call stat() on remote ones, too.
 	  Thus accessibility of remote filesystems can be checked without any threshold comparison.
 	Check_disk's --help now prints some examples for the new features introduced in 1.4.8
-	New check_disk -i/-I option to ignore pathes/partitions based on regular expressions
+	New check_disk -i/-I option to ignore paths/partitions based on regular expressions
 	New check_disk -A option to select all filesystems explicitly
 	WARNING: check_disk's -E option must now be passed before -p or -r/-R arguments
 	  Passing -E after -p or -r results in UNKNOWN state, now

+ 1 - 1
NPTest.pm

@@ -209,7 +209,7 @@ under the same terms as the Nagios Plugins release.
 
 my( %CACHE ) = ();
 
-# I'm not really sure wether to house a site-specific cache inside
+# I'm not really sure whether to house a site-specific cache inside
 # or outside of the extracted source / build tree - lets default to outside
 my( $CACHEFILENAME ) = ( exists( $ENV{'NPTEST_CACHE'} ) && $ENV{'NPTEST_CACHE'} )
                        ? $ENV{'NPTEST_CACHE'} : "/var/tmp/NPTest.cache"; # "../Cache.pdd";

+ 7 - 7
ROADMAP

@@ -41,7 +41,7 @@ GNU getopt.
 
 Bu I would like to urge that all standard plugins contain
 validate_arguments(). I think this will help convey the idea that
-validations hould be done, even if we don't insist on the specific
+validations should be done, even if we don't insist on the specific
 extent that each plugin must do that validation.
 
 This is the set of standard options I envision:
@@ -53,15 +53,15 @@ Reserved:
 -v, --verbose
 -q, --quiet
 -t, --timeout = INTEGER (senonds)
--c, --critical = (INT|FLOAT|RANGE|LIST) 
+-c, --critical = (INT|FLOAT|RANGE|LIST)
 -w, --warning = (INT|FLOAT|RANGE|LIST)
 -H, --hostname = STRING
--F, --file = STRING (usually input) 
--O, --output = STRING (output file) 
+-F, --file = STRING (usually input)
+-O, --output = STRING (output file)
 -4, (Use IPv4)
 -6, (Use IPv6)
 
-Recommended, but not reserverd: 
+Recommended, but not reserved:
 
 -I, --ipaddress = STRING
 -C, --community = STRING
@@ -71,7 +71,7 @@ Recommended, but not reserverd:
 -P, --port = INT
 -u, --url = STRING (also --username if --url is not needed)
 
-I am suggesting that port alway be '-P' (uppercase) -- we are
+I am suggesting that port always be '-P' (uppercase) -- we are
 currently inconsistent in that regard.
 
 I am also adding '-q' for silent running. This is totally self
@@ -89,7 +89,7 @@ Programming:
   length character assignments, at least to the extent possible,
   from the C-based plugins. To that end, I have made strscpy and
   friends in utils.c -- I'd like to deploy them. I have comments 
-  that there is alot of duplicated code, and techniques used that
+  that there is a lot of duplicated code, and techniques used that
   should be cleaned up. Details in a separate thread.
 
 Remote checks:

+ 2 - 0
THANKS.in

@@ -205,6 +205,7 @@ Konstantin Khomoutov
 Kyle Tucker
 Lance Albertson
 Larry Low
+Lars Michelsen
 Lars Stavholm
 Lars Vogdt
 Laurent Licour
@@ -378,6 +379,7 @@ Tom Shields
 Tomasz Pilat
 Torsten Werner
 Trevor McDonald
+Troy Lea
 Truongchinh Nguyen
 Vaclav Ovsik
 Valdimir Ivaschenko

+ 1 - 1
build-aux/ltmain.sh

@@ -522,7 +522,7 @@ func_mkdir_p ()
       # While some portion of DIR does not yet exist...
       while test ! -d "$my_directory_path"; do
         # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
+        # list in case some portion of path contains whitespace.
         my_dir_list="$my_directory_path:$my_dir_list"
 
         # If the last portion added has no slash in it, the list is done

+ 4 - 4
configure.ac

@@ -934,7 +934,7 @@ elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
 then
 	ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
 	ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
-	# There must be no space between the %s and %n due to a wierd problem in sscanf where
+	# There must be no space between the %s and %n due to a weird problem in sscanf where
 	# it will return %n as longer than the line length
 	ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
 	ac_cv_ps_cols=9
@@ -1564,7 +1564,7 @@ if test -n "$PATH_TO_SUDO"
 then
 	AC_DEFINE_UNQUOTED(PATH_TO_SUDO,"$PATH_TO_SUDO",[path to sudo])
 else
-	AC_MSG_WARN([Could not find sudo or eqivalent])
+	AC_MSG_WARN([Could not find sudo or equivalent])
 fi
 
 AC_PATH_PROG(PATH_TO_MAILQ,mailq)
@@ -1575,7 +1575,7 @@ if test -n "$PATH_TO_MAILQ"
 then
 	AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
 else
-	AC_MSG_WARN([Could not find mailq or eqivalent])
+	AC_MSG_WARN([Could not find mailq or equivalent])
 fi
 
 AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
@@ -1858,7 +1858,7 @@ AM_GNU_GETTEXT([external], [need-ngettext])
 AM_GNU_GETTEXT_VERSION(0.15)
 
 dnl Check for Redhat spopen problem
-dnl Wierd problem where ECHILD is returned from a wait call in error
+dnl Weird problem where ECHILD is returned from a wait call in error
 dnl Only appears to affect nslookup and dig calls. Only affects redhat around
 dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
 dnl We patch plugins/popen.c

+ 5 - 5
doc/developer-guidelines.sgml

@@ -373,7 +373,7 @@
 			<listitem><para>s - seconds (also us, ms)</para></listitem>
 			<listitem><para>% - percentage</para></listitem>
 			<listitem><para>B - bytes (also KB, MB, TB)</para></listitem>
-			<listitem><para>c - a continous counter (such as bytes
+			<listitem><para>c - a continuous counter (such as bytes
 				transmitted on an interface)</para></listitem>
 			</orderedlist>
 			</listitem>
@@ -396,7 +396,7 @@
 		<section><title>Don't execute system commands without specifying their
 		full path</title>
 		<para>Don't use exec(), popen(), etc. to execute external
-		commands without explicity using the full path of the external
+		commands without explicitly using the full path of the external
 		program.</para>
 
 		<para>Doing otherwise makes the plugin vulnerable to hijacking
@@ -651,7 +651,7 @@
 	  <para>If possible when writing lists, use tokens to make the
 	  list easy to remember and non-order dependent - so
 	  check_disk uses '-c 10000,10%' so that it is clear which is
-	  the precentage and which is the KB values (note that due to
+	  the percentage and which is the KB values (note that due to
 	  my own lack of foresight, that used to be '-c 10000:10%' but
 	  such constructs should all be changed for consistency,
 	  though providing reverse compatibility is fairly
@@ -682,7 +682,7 @@ all the current tests and report an overall success rate.
 <para>These use perl's Test::More. To do a one time test, run "cd plugins && perl t/check_disk.t".
 </para>
 
-<para>There will somtimes be failures seen in this output which are known failures that
+<para>There will sometimes be failures seen in this output which are known failures that
 need to be fixed. As long as the return code is 0, it will be reported as "test pass".
 (If you have a fix so that the specific test passes, that will be gratefully received!)
 </para>
@@ -842,7 +842,7 @@ update the THANKS.in file.</para>
 	  <para>It is determined to be not redundant (for instance, we would not 
 		add a new version of check_disk just because someone had provide 
 		a plugin that had perf checking - we would incorporate the features 
-		into an exisiting plugin)</para>
+		into an existing plugin)</para>
 	</listitem>
 	<listitem>
 	  <para>One of the developers has had the time to audit the code and declare

+ 2 - 2
gl/m4/libtool.m4

@@ -604,7 +604,7 @@ m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 # LT_OUTPUT
 # ---------
 # This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
+# AC_OUTPUT is called), in case it is used in configure for compilation
 # tests.
 AC_DEFUN([LT_OUTPUT],
 [: ${CONFIG_LT=./config.lt}
@@ -641,7 +641,7 @@ configured by $[0], generated by m4_PACKAGE_STRING.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
+gives unlimited permission to copy, distribute and modify it."
 
 while test $[#] != 0
 do

+ 1 - 1
gl/m4/ltsugar.m4

@@ -75,7 +75,7 @@ m4_define([lt_combine],
 
 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
 # -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# If MACRO-NAME does not yet contain VARNAME, then append it (delimited
 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
 m4_define([lt_if_append_uniq],
 [m4_ifdef([$1],

+ 1 - 1
gl/mountlist.h

@@ -30,7 +30,7 @@ struct mount_entry
   char *me_type;                /* "nfs", "4.2", etc. */
   dev_t me_dev;                 /* Device number of me_mountdir. */
   unsigned int me_dummy : 1;    /* Nonzero for dummy file systems. */
-  unsigned int me_remote : 1;   /* Nonzero for remote fileystems. */
+  unsigned int me_remote : 1;   /* Nonzero for remote filesystems. */
   unsigned int me_type_malloced : 1; /* Nonzero if me_type was malloced. */
   struct mount_entry *me_next;
 };

+ 1 - 1
gl/regexec.c

@@ -2269,7 +2269,7 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
 			    dfa->nexts[node_idx]))
     /* The node can't accept the "multi byte", or the
        destination was already thrown away, then the node
-       could't accept the current input "multi byte".   */
+       couldn't accept the current input "multi byte".   */
     naccepted = 0;
   /* Otherwise, it is sure that the node could accept
      'naccepted' bytes input.  */

+ 2 - 2
lib/parse_ini.c

@@ -79,7 +79,7 @@ static char* default_file_in_path(void);
 
 /* parse_locator decomposes a string of the form
  * 	[stanza][@filename]
- * into its seperate parts
+ * into its separate parts
  */
 static void parse_locator(const char *locator, const char *def_stanza, np_ini_info *i){
 	size_t locator_len=0, stanza_len=0;
@@ -187,7 +187,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){
 		/* gobble up leading whitespace */
 		if(isspace(c)) continue;
 		switch(c){
-			/* globble up coment lines */
+			/* globble up comment lines */
 			case ';':
 			case '#':
 				GOBBLE_TO(f, c, '\n');

+ 1 - 1
lib/tests/test_cmd.c

@@ -180,7 +180,7 @@ main (int argc, char **argv)
 	result = cmd_run (command, &chld_out, &chld_err, 0);
 
 	ok (chld_out.lines == 0,
-			"Non existant command, so no output");
+			"Non existent command, so no output");
 	ok (chld_err.lines == 0,
 			"No stderr either");
 	ok (result == 3, "Get return code 3 (?) for non-existant command");

+ 2 - 2
lib/tests/test_disk.c

@@ -88,10 +88,10 @@ main (int argc, char **argv)
 		                  cflags, 3,strdup("regex on dev names:"));
 	np_test_mount_entry_regex(dummy_mount_list, strdup("/foo"),
 		                  cflags, 0,
-			 	  strdup("regex on non existant dev/path:"));
+			 	  strdup("regex on non existent dev/path:"));
 	np_test_mount_entry_regex(dummy_mount_list, strdup("/Foo"),
 		                  cflags | REG_ICASE,0,
-			 	  strdup("regi on non existant dev/path:"));
+			 	  strdup("regi on non existent dev/path:"));
 	np_test_mount_entry_regex(dummy_mount_list, strdup("/c.t0"),
 		                  cflags, 3,
 			 	  strdup("partial devname regex match:"));

+ 1 - 1
lib/tests/test_utils.c

@@ -394,7 +394,7 @@ main (int argc, char **argv)
 	ok( temp_state_data==NULL, "Older data version gives NULL" );
 	temp_state_key->data_version=54;
 
-	temp_state_key->_filename="var/nonexistant";
+	temp_state_key->_filename="var/nonexistent";
 	temp_state_data = np_state_read();
 	ok( temp_state_data==NULL, "Missing file gives NULL" );
 	ok( this_nagios_plugin->state->state_data==NULL, "No state information" );

+ 1 - 1
m4/np_mysqlclient.m4

@@ -65,7 +65,7 @@ AC_DEFUN([np_mysqlclient],
   fi
 ])
 
-dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH
+dnl Will take $1, find last occurrence of -LDIR and add DIR to LD_RUN_PATH
 AC_DEFUN([np_add_to_runpath], 
 [
   dnl Need [[ ]] so autoconf gives us just one set

Разлика између датотеке није приказан због своје велике величине
+ 1644 - 1314
plugins-root/check_icmp.c


+ 1 - 1
plugins-root/pst3.c

@@ -257,6 +257,6 @@ void usage() {
   printf("\tRSS      - Real memory usage (kilobytes)\n");
   printf("\t%%CPU     - CPU usage\n");
   printf("\tCOMMAND  - Command being run\n");
-  printf("\tARGS     - Full command line with arguements\n");
+  printf("\tARGS     - Full command line with arguments\n");
   return;
 }

+ 5 - 5
plugins-scripts/check_ifoperstatus.pl

@@ -134,7 +134,7 @@ if (defined $ifdescr || defined $iftype) {
 	}
 	if ($status==0) {
 		$state = "UNKNOWN";
-		printf "$state: could not retrive ifdescr/iftype snmpkey - $status-$snmpkey\n";
+		printf "$state: could not retrieve ifdescr/iftype snmpkey - $status-$snmpkey\n";
 		$session->close;
 		exit $ERRORS{$state};
 	}
@@ -187,7 +187,7 @@ if (defined $ifXTable) {
 	 $name = $response->{$snmpIfDescr} ;
 }
 
-## if AdminStatus is down - some one made a consious effort to change config
+## if AdminStatus is down - some one made a conscious effort to change config
 ##
 if ( not ($response->{$snmpIfAdminStatus} == 1) ) {
 	$answer = "Interface $name (index $snmpkey) is administratively down.";
@@ -286,7 +286,7 @@ sub print_usage() {
 	printf "check_ifoperstatus -k <IF_KEY> -H <HOSTNAME> [-C <community>]\n";
 	printf "Copyright (C) 2000 Christoph Kron\n";
 	printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n";
-	printf "This programm is licensed under the terms of the ";
+	printf "This program is licensed under the terms of the ";
 	printf "GNU General Public License\n(check source code for details)\n";
 	printf "\n\n";
 }
@@ -325,7 +325,7 @@ sub print_help() {
 	printf "                     (Implies the use of -I)\n";
 	printf "   -w (--warn =i|w|c) ignore|warn|crit if the interface is dormant (default critical)\n";
 	printf "   -D (--admin-down =i|w|c) same for administratively down interfaces (default warning)\n";
-	printf "   -M (--maxmsgsize) Max message size - usefull only for v1 or v2c\n";
+	printf "   -M (--maxmsgsize) Max message size - useful only for v1 or v2c\n";
 	printf "   -t (--timeout)    seconds before the plugin times out (default=$TIMEOUT)\n";
 	printf "   -V (--version)    Plugin version\n";
 	printf "   -h (--help)       usage help \n\n";
@@ -424,7 +424,7 @@ sub process_arguments() {
 		if (defined $seclevel && defined $secname) {
 			$session_opts{'-username'} = $secname;
 		
-			# Must define a security level even though defualt is noAuthNoPriv
+			# Must define a security level even though default is noAuthNoPriv
 			unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) {
 				usage("Must define a valid security level even though default is noAuthNoPriv");
 			}

+ 2 - 2
plugins-scripts/check_ifstatus.pl

@@ -281,7 +281,7 @@ sub print_help() {
 	printf "                     in hex with 0x prefix generated by using \"snmpkey\" utility\n"; 
 	printf "                     privacy password and authEngineID\n";
 	printf "   -P (--privproto)  privacy protocol (DES or AES; default: DES)\n";
-	printf "   -M (--maxmsgsize) Max message size - usefull only for v1 or v2c\n";
+	printf "   -M (--maxmsgsize) Max message size - useful only for v1 or v2c\n";
 	printf "   -t (--timeout)    seconds before the plugin times out (default=$TIMEOUT)\n";
 	printf "   -V (--version)    Plugin version\n";
 	printf "   -h (--help)       usage help \n\n";
@@ -355,7 +355,7 @@ sub process_arguments() {
 		if (defined $seclevel && defined $secname) {
 			$session_opts{'-username'} = $secname;
 		
-			# Must define a security level even though defualt is noAuthNoPriv
+			# Must define a security level even though default is noAuthNoPriv
 			unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) {
 				usage("Must define a valid security level even though default is noAuthNoPriv");
 			}

+ 2 - 2
plugins-scripts/check_ircd.pl

@@ -63,7 +63,7 @@ sub print_usage ();
 sub connection ($$$$);
 sub bindRemote ($$);
 
-# -------------------------------------------------------------[ Enviroment ]--
+# ------------------------------------------------------------[ Environment ]--
 
 $ENV{'PATH'}='@TRUSTED_PATH@';
 $ENV{'BASH_ENV'}=''; 
@@ -209,7 +209,7 @@ MAIN:
 
 	# Just in case of problems, let's not hang Nagios
 	$SIG{'ALRM'} = sub {
-		print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n";
+		print "Something is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n";
 		exit $ERRORS{"UNKNOWN"};
 	};
 	

+ 7 - 3
plugins-scripts/check_log.sh

@@ -73,7 +73,7 @@ print_usage() {
     echo "Usage: $PROGNAME -F logfile -O oldlog -q query"
     echo "Usage: $PROGNAME --help"
     echo "Usage: $PROGNAME --version"
-    echo "     Aditional parameter:"
+    echo "     Additional parameter:"
     echo "        -w (--max_warning) If used, determines the maximum matching value to return as warning, when finding more matching lines than this parameter will return as critical. If not used, will consider as default 0 (any matching will consider as critical)"
     echo "Usage: $PROGNAME -F logfile -O oldlog -q query -w <number>"
 }
@@ -214,8 +214,12 @@ fi
 
 diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff"
 
-# Count the number of matching log entries we have
-count=$(egrep -c "$query" "$tempdiff")
+# Count the number of matching log entries we have and handle errors when grep fails
+count=$(grep -c "$query" "$tempdiff" 2>&1)
+if [[ $? -gt 1 ]];then
+    echo "Log check error: $count"
+    exit "$STATE_UNKNOWN"
+fi
 
 # Get the last matching entry in the diff file
 lastentry=$(egrep "$query" "$tempdiff" | tail -1)

+ 1 - 1
plugins-scripts/check_mailq.pl

@@ -4,7 +4,7 @@
 #   transmittal.  
 #
 # Initial version support sendmail's mailq command
-#  Support for mutiple sendmail queues (Carlos Canau)
+#  Support for multiple sendmail queues (Carlos Canau)
 #  Support for qmail (Benjamin Schmid)
 
 # License Information:

+ 3 - 3
plugins-scripts/check_ntp.pl

@@ -28,7 +28,7 @@
 # (c) 1999 Bo Kersey, VirCIO - Managed Server Solutions <bo@vircio.com>
 # 22-10-99, 12:17
 #
-# Modified the script to give useage if no parameters are input.
+# Modified the script to give usage if no parameters are input.
 #
 # Modified the script to check for negative as well as positive 
 # time differences.
@@ -46,7 +46,7 @@
 #           source. This happens while starting up and if contact
 #           with master has been lost.
 #
-# Modifed to run under Embedded Perl  (sghosh@users.sf.net)
+# Modified to run under Embedded Perl  (sghosh@users.sf.net)
 #   - combined logic some blocks together..
 # 
 # Added ntpdate check for stratum 16 desynch peer (James Fidell) Feb 03, 2003
@@ -272,7 +272,7 @@ if ( $? && !$ignoreret ) {
 #          broadcast (b); not sure about multicast/broadcast
 # Field 6: last packet receive (in seconds)
 # Field 7: polling interval
-# Field 8: reachability resgister (octal) 
+# Field 8: reachability register (octal) 
 # Field 9: delay
 # Field 10: offset
 # Field 11: dispersion/jitter

+ 7 - 7
plugins/check_disk.c

@@ -28,7 +28,7 @@
 
 const char *progname = "check_disk";
 const char *program_name = "check_disk";  /* Required for coreutils libs */
-const char *copyright = "1999-2014";
+const char *copyright = "1999-2018";
 const char *email = "devel@nagios-plugins.org";
 
 
@@ -316,7 +316,7 @@ main (int argc, char **argv)
       get_stats (path, &fsp);
 
       if (verbose >= 3) {
-        printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
+        printf ("For %s, used_pct=%g free_pct=%g used_units=%i free_units=%i total_units=%i used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n",
           me->me_mountdir, path->dused_pct, path->dfree_pct, path->dused_units, path->dfree_units, path->dtotal_units, path->dused_inodes_percent, path->dfree_inodes_percent, fsp.fsu_blocksize, mult);
       }
 
@@ -385,7 +385,7 @@ main (int argc, char **argv)
       if (disk_result==STATE_OK && erronly && !verbose)
         continue;
 
-      xasprintf (&output, "%s%s%s%s %.0f %s (%.2f%%",
+      xasprintf (&output, "%s%s%s%s %i %s (%.2f%%",
                 output,
                 newlines ? "" : " ",
                 status_lit,
@@ -550,7 +550,7 @@ process_arguments (int argc, char **argv)
 
     /* Awful mistake where the range values do not make sense. Normally,
        you alert if the value is within the range, but since we are using
-       freespace, we have to alert if outside the range. Thus we artifically
+       freespace, we have to alert if outside the range. Thus we artificially
        force @ at the beginning of the range, so that it is backwards compatible
     */
     case 'c':                 /* critical threshold */
@@ -1005,7 +1005,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
         get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp);
         get_path_stats(p_list, &tmpfsp); 
         if (verbose >= 3)
-          printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n",
+          printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%i free_units=%i total_units=%i fsu_blocksize=%llu mult=%llu\n",
                  p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units,
                  p_list->dtotal_units, mult);
 
@@ -1026,7 +1026,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
         first = 0;
       }
       if (verbose >= 3) 
-        printf("Group %s now has: used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n",
+        printf("Group %s now has: used_units=%1 free_units=%1 total_units=%1 fsu_blocksize=%llu mult=%llu\n",
                p->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p->best_match->me_mountdir, p->dused_units,
                p->dfree_units, p->dtotal_units, mult);
     }
@@ -1050,7 +1050,7 @@ get_path_stats (struct parameter_list *p, struct fs_usage *fsp) {
   p->available_to_root = fsp->fsu_bfree;
   p->used = fsp->fsu_blocks - fsp->fsu_bfree;
   if (freespace_ignore_reserved) {
-    /* option activated : we substract the root-reserved space from the total */
+    /* option activated : we subtract the root-reserved space from the total */
     p->total = fsp->fsu_blocks - p->available_to_root + p->available;
   } else {
     /* default behaviour : take all the blocks into account */

+ 1 - 1
plugins/check_dns.c

@@ -95,7 +95,7 @@ main (int argc, char **argv)
 {
   char *command_line = NULL;
   char input_buffer[MAX_INPUT_BUFFER];
-  char *address = NULL; /* comma seperated str with addrs/ptrs (sorted) */
+  char *address = NULL; /* comma separated str with addrs/ptrs (sorted) */
   char **addresses = NULL;
   int n_addresses = 0;
   char *msg = NULL;

+ 2 - 2
plugins/check_fping.c

@@ -71,7 +71,7 @@ int wrta_p = FALSE;
 int
 main (int argc, char **argv)
 {
-/* normaly should be  int result = STATE_UNKNOWN; */
+/* normally should be  int result = STATE_UNKNOWN; */
 
   int status = STATE_UNKNOWN;
   int result = 0;
@@ -184,7 +184,7 @@ textscan (char *buf)
   int status = STATE_UNKNOWN;
 
   if (strstr (buf, "not found")) {
-    die (STATE_CRITICAL, _("FPING UNKNOW - %s not found\n"), server_name);
+    die (STATE_CRITICAL, _("FPING UNKNOWN - %s not found\n"), server_name);
 
   }
   else if (strstr (buf, "is unreachable") || strstr (buf, "Unreachable")) {

+ 2 - 2
plugins/check_http.c

@@ -1075,7 +1075,7 @@ check_http (void)
     }
 
     /* Inform server we accept any MIME type response
-     * TODO: Take an arguement to determine what type(s) to accept,
+     * TODO: Take an argument to determine what type(s) to accept,
      * so that we can alert if a response is of an invalid type.
     */
     if (!have_accept)
@@ -1781,7 +1781,7 @@ print_help (void)
     printf ("%s\n", _("Notes:"));
     printf (" %s\n", _("This plugin will attempt to open an HTTP connection with the host."));
     printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL"));
-    printf (" %s\n", _("other errors return STATE_UNKNOWN.  Successful connects, but incorrect reponse"));
+    printf (" %s\n", _("other errors return STATE_UNKNOWN.  Successful connects, but incorrect response"));
     printf (" %s\n", _("messages from the host result in STATE_WARNING return values.  If you are"));
     printf (" %s\n", _("checking a virtual server that uses 'host headers' you must supply the FQDN"));
     printf (" %s\n", _("(fully qualified domain name) as the [host_name] argument."));

+ 3 - 3
plugins/check_ide_smart.c

@@ -281,7 +281,7 @@ main (int argc, char *argv[])
 		smart_read_values (fd, &values);
 		smart_read_thresholds (fd, &thresholds);
 		retval = nagios (&values, &thresholds);
-		printf( _("-n, This flag is depricated, and will be removed in a future release. Nagios output is now the default.\n") );
+		printf( _("-n, This flag is deprecated, and will be removed in a future release. Nagios output is now the default.\n") );
 		break;
 	default:
 		smart_read_values (fd, &values);
@@ -304,7 +304,7 @@ get_offline_text (int status)
 			return offline_status_text[i].text;
 		}
 	}
-	return "UNKNOW";
+	return "UNKNOWN";
 }
 
 
@@ -439,7 +439,7 @@ nagios (values_t * p, thresholds_t * t)
 		status=STATE_OK;
 		break;
 	default:
-		printf (_("ERROR - Status '%d' unkown. %d/%d tests passed\n"), status,
+		printf (_("ERROR - Status '%d' unknown. %d/%d tests passed\n"), status,
 						passed, total);
 		status = STATE_UNKNOWN;
 		break;

+ 1 - 1
plugins/check_ldap.c

@@ -263,7 +263,7 @@ main (int argc, char *argv[])
 	if(entries_thresholds != NULL) {
 		if (verbose) {
 			printf ("entries found: %d\n", num_entries);
-			print_thresholds("entry threasholds", entries_thresholds);
+			print_thresholds("entry thresholds", entries_thresholds);
 		}
 		status_entries = get_status(num_entries, entries_thresholds);
 		if (status_entries == STATE_CRITICAL) {

+ 1 - 1
plugins/check_load.c

@@ -101,7 +101,7 @@ main (int argc, char **argv)
 	int i;
 	long numcpus;
 
-	double la[3] = { 0.0, 0.0, 0.0 };	/* NetBSD complains about unitialized arrays */
+	double la[3] = { 0.0, 0.0, 0.0 };	/* NetBSD complains about uninitialized arrays */
 #ifndef HAVE_GETLOADAVG
 	char input_buffer[MAX_INPUT_BUFFER];
 # ifdef HAVE_PROC_LOADAVG

+ 1 - 1
plugins/check_mrtg.c

@@ -356,7 +356,7 @@ print_help (void)
 	printf (" %s\n", _("This plugin is useful for monitoring MRTG data that does not correspond to"));
   printf (" %s\n", _("bandwidth usage.  (Use the check_mrtgtraf plugin for monitoring bandwidth)."));
   printf (" %s\n", _("It can be used to monitor any kind of data that MRTG is monitoring - errors,"));
-  printf (" %s\n", _("packets/sec, etc.  I use MRTG in conjuction with the Novell NLM that allows"));
+  printf (" %s\n", _("packets/sec, etc.  I use MRTG in conjunction with the Novell NLM that allows"));
   printf (" %s\n", _("me to track processor utilization, user connections, drive space, etc and"));
   printf (" %s\n\n", _("this plugin works well for monitoring that kind of data as well."));
 

+ 1 - 1
plugins/check_mrtgtraf.c

@@ -375,7 +375,7 @@ print_help (void)
   printf (" %s\n", "-c, --critical");
   printf ("    %s\n", _("Critical threshold pair <incoming>,<outgoing>"));
   printf (" %s\n", _("-v, --verbose"));
-  printf ("    %s\n", _("Verbose output durring plugin runtime."));
+  printf ("    %s\n", _("Verbose output during plugin runtime."));
 
   printf ("\n");
   printf ("%s\n", _("Notes:"));

+ 7 - 7
plugins/check_ntp.c

@@ -10,7 +10,7 @@
 * 
 * This file contains the check_ntp plugin
 * 
-* This plugin to check ntp servers independant of any commandline
+* This plugin to check ntp servers independent of any commandline
 * programs or external libraries.
 * 
 * 
@@ -79,7 +79,7 @@ typedef struct {
 /* this structure holds data about results from querying offset from a peer */
 typedef struct {
 	time_t waiting;         /* ts set when we started waiting for a response */
-	int num_responses;      /* number of successfully recieved responses */
+	int num_responses;      /* number of successfully received responses */
 	uint8_t stratum;        /* copied verbatim from the ntp_message */
 	double rtdelay;         /* converted from the ntp_message */
 	double rtdisp;          /* converted from the ntp_message */
@@ -100,7 +100,7 @@ typedef struct {
 	                        /* NB: not necessarily NULL terminated! */
 } ntp_control_message;
 
-/* this is an association/status-word pair found in control packet reponses */
+/* this is an association/status-word pair found in control packet responses */
 typedef struct {
 	uint16_t assoc;
 	uint16_t status;
@@ -548,7 +548,7 @@ double jitter_request(const char *host, int *status){
 		DBG(print_ntp_control_message(&req));
 		/* Attempt to read the largest size packet possible */
 		req.count=htons(MAX_CM_SIZE);
-		DBG(printf("recieving READSTAT response"))
+		DBG(printf("receiving READSTAT response"))
 		read(conn, &req, SIZEOF_NTPCM(req));
 		DBG(print_ntp_control_message(&req));
 		/* Each peer identifier is 4 bytes in the data section, which
@@ -575,7 +575,7 @@ double jitter_request(const char *host, int *status){
 			}
 		}
 	}
-	if(verbose) printf("%d candiate peers available\n", num_candidates);
+	if(verbose) printf("%d candidate peers available\n", num_candidates);
 	if(verbose && syncsource_found) printf("synchronization source found\n");
 	if(! syncsource_found){
 		*status = STATE_UNKNOWN;
@@ -597,7 +597,7 @@ double jitter_request(const char *host, int *status){
 				/* By spec, putting the variable name "jitter"  in the request
 				 * should cause the server to provide _only_ the jitter value.
 				 * thus reducing net traffic, guaranteeing us only a single
-				 * datagram in reply, and making intepretation much simpler
+				 * datagram in reply, and making interpretation much simpler
 				 */
 				/* Older servers doesn't know what jitter is, so if we get an
 				 * error on the first pass we redo it with "dispersion" */
@@ -608,7 +608,7 @@ double jitter_request(const char *host, int *status){
 				DBG(print_ntp_control_message(&req));
 
 				req.count = htons(MAX_CM_SIZE);
-				DBG(printf("recieving READVAR response...\n"));
+				DBG(printf("receiving READVAR response...\n"));
 				read(conn, &req, SIZEOF_NTPCM(req));
 				DBG(print_ntp_control_message(&req));
 

+ 4 - 4
plugins/check_ntp_peer.c

@@ -86,7 +86,7 @@ typedef struct {
 	                        /* NB: not necessarily NULL terminated! */
 } ntp_control_message;
 
-/* this is an association/status-word pair found in control packet reponses */
+/* this is an association/status-word pair found in control packet responses */
 typedef struct {
 	uint16_t assoc;
 	uint16_t status;
@@ -245,7 +245,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
 		do {
 			/* Attempt to read the largest size packet possible */
 			req.count=htons(MAX_CM_SIZE);
-			DBG(printf("recieving READSTAT response"))
+			DBG(printf("receiving READSTAT response"))
 			if(read(conn, &req, SIZEOF_NTPCM(req)) == -1)
 				die(STATE_CRITICAL, "NTP CRITICAL: No response from NTP server\n");
 			DBG(print_ntp_control_message(&req));
@@ -306,7 +306,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
 				/* Putting the wanted variable names in the request
 				 * cause the server to provide _only_ the requested values.
 				 * thus reducing net traffic, guaranteeing us only a single
-				 * datagram in reply, and making intepretation much simpler
+				 * datagram in reply, and making interpretation much simpler
 				 */
 				/* Older servers doesn't know what jitter is, so if we get an
 				 * error on the first pass we redo it with "dispersion" */
@@ -585,7 +585,7 @@ int main(int argc, char *argv[]){
 	/* set socket timeout */
 	alarm (timeout_interval);
 
-	/* This returns either OK or WARNING (See comment preceeding ntp_request) */
+	/* This returns either OK or WARNING (See comment preceding ntp_request) */
 	result = ntp_request(server_address, &offset, &offset_result, &jitter, &stratum, &num_truechimers);
 
 	if(offset_result == STATE_UNKNOWN) {

+ 2 - 2
plugins/check_ntp_time.c

@@ -81,7 +81,7 @@ typedef struct {
 typedef struct {
 	time_t waiting;         /* ts set when we started waiting for a response */
 	int connected;          /* don't try to "write()" if "connect()" fails */
-	int num_responses;      /* number of successfully recieved responses */
+	int num_responses;      /* number of successfully received responses */
 	uint8_t stratum;        /* copied verbatim from the ntp_message */
 	double rtdelay;         /* converted from the ntp_message */
 	double rtdisp;          /* converted from the ntp_message */
@@ -639,7 +639,7 @@ void print_help(void){
 	printf("%s\n", _("Notes:"));
 	printf(" %s\n", _("If you'd rather want to monitor an NTP server, please use"));
 	printf(" %s\n", _("check_ntp_peer."));
-	printf(" %s\n", _("--time-offset is usefull for compensating for servers with known"));
+	printf(" %s\n", _("--time-offset is useful for compensating for servers with known"));
 	printf(" %s\n", _("and expected clock skew."));
 	printf("\n");
 	printf(UT_THRESHOLDS_NOTES);

+ 2 - 2
plugins/check_pgsql.c

@@ -91,7 +91,7 @@ int verbose = 0;
 
 /******************************************************************************
 
-The (psuedo?)literate programming XML is contained within \@\@\- <XML> \-\@\@
+The (pseudo?)literate programming XML is contained within \@\@\- <XML> \-\@\@
 tags in the comments. With in the tags, the XML is assembled sequentially.
 You can define entities in tags. You also have all the #defines available as
 entities.
@@ -562,7 +562,7 @@ print_help (void)
 
 	printf (" %s\n", _("Typically, the nagios user (unless the --logname option is used) should be"));
 	printf (" %s\n", _("able to connect to the database without a password. The plugin can also send"));
-	printf (" %s\n", _("a password, but no effort is made to obsure or encrypt the password."));
+	printf (" %s\n", _("a password, but no effort is made to obscure or encrypt the password."));
 
 	printf (UT_SUPPORT);
 }

+ 1 - 1
plugins/check_procs.c

@@ -837,7 +837,7 @@ print_help (void)
   printf (" %s\n", "-C, --command=COMMAND");
   printf ("   %s\n", _("Only scan for exact matches of COMMAND (without path)."));
   printf (" %s\n", "-C, --exclude-process");
-  printf ("   %s\n", _("Exclude processes which match this comma seperated list"));
+  printf ("   %s\n", _("Exclude processes which match this comma separated list"));
   printf (" %s\n", "-k, --no-kthreads");
   printf ("   %s\n", _("Only scan for non kernel threads (works on Linux only)."));
   printf (" %s\n", "-g, --cgroup-hierarchy");

+ 2 - 2
plugins/check_radius.c

@@ -107,7 +107,7 @@ ENV *env = NULL;
 
 /******************************************************************************
 
-The (psuedo?)literate programming XML is contained within \@\@\- <XML> \-\@\@
+The (pseudo?)literate programming XML is contained within \@\@\- <XML> \-\@\@
 tags in the comments. With in the tags, the XML is assembled sequentially.
 You can define entities in tags. You also have all the #defines available as
 entities.
@@ -379,7 +379,7 @@ print_help (void)
 	printf (" %s\n", "-u, --username=STRING");
   printf ("    %s\n", _("The user to authenticate"));
   printf (" %s\n", "-p, --password=STRING");
-  printf ("    %s\n", _("Password for autentication (SECURITY RISK)"));
+  printf ("    %s\n", _("Password for authentication (SECURITY RISK)"));
   printf (" %s\n", "-n, --nas-id=STRING");
   printf ("    %s\n", _("NAS identifier"));
   printf (" %s\n", "-N, --nas-ip-address=STRING");

+ 2 - 2
plugins/check_real.c

@@ -181,7 +181,7 @@ main (int argc, char **argv)
 
 		/* watch for the REAL connection string */
 		result = recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0);
-		buffer[result] = '\0'; /* null terminate recieved buffer */
+		buffer[result] = '\0'; /* null terminate received buffer */
 
 		/* return a CRITICAL status if we couldn't read any data */
 		if (result == -1) {
@@ -434,7 +434,7 @@ print_help (void)
 	printf ("%s\n", _("This plugin will attempt to open an RTSP connection with the host."));
   printf ("%s\n", _("Successul connects return STATE_OK, refusals and timeouts return"));
   printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN.  Successful connects,"));
-  printf ("%s\n", _("but incorrect reponse messages from the host result in STATE_WARNING return"));
+  printf ("%s\n", _("but incorrect response messages from the host result in STATE_WARNING return"));
   printf ("%s\n", _("values."));
 
 	printf (UT_SUPPORT);

+ 1 - 1
plugins/check_smtp.c

@@ -847,7 +847,7 @@ print_help (void)
 	printf("\n");
 	printf ("%s\n", _("Successul connects return STATE_OK, refusals and timeouts return"));
   printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN.  Successful"));
-  printf ("%s\n", _("connects, but incorrect reponse messages from the host result in"));
+  printf ("%s\n", _("connects, but incorrect response messages from the host result in"));
   printf ("%s\n", _("STATE_WARNING return values."));
 
 	printf (UT_SUPPORT);

+ 1 - 1
plugins/check_snmp.c

@@ -1255,7 +1255,7 @@ print_help (void)
 	printf (" %s\n", "--rate-multiplier");
 	printf ("    %s\n", _("Converts rate per second. For example, set to 60 to convert to per minute"));
 	printf (" %s\n", "--offset=OFFSET");
-	printf ("    %s\n", _("Add/substract the specified OFFSET to numeric sensor data"));
+	printf ("    %s\n", _("Add/subtract the specified OFFSET to numeric sensor data"));
 
 	/* Tests Against Strings */
 	printf (" %s\n", "-s, --string=STRING");

+ 24 - 14
plugins/check_swap.c

@@ -65,6 +65,7 @@ double warn_size_bytes = 0;
 double crit_size_bytes= 0;
 int verbose;
 int allswaps;
+int no_swap_state = STATE_CRITICAL;
 
 int
 main (int argc, char **argv)
@@ -378,6 +379,8 @@ main (int argc, char **argv)
 int
 check_swap (int usp, double free_swap_mb)
 {
+	if (!free_swap_mb) return no_swap_state;
+
 	int result = STATE_UNKNOWN;
 	double free_swap = free_swap_mb * (1024 * 1024);		/* Convert back to bytes as warn and crit specified in bytes */
 	if (usp >= 0 && crit_percent != 0 && usp >= (100.0 - crit_percent))
@@ -406,6 +409,7 @@ process_arguments (int argc, char **argv)
 		{"warning", required_argument, 0, 'w'},
 		{"critical", required_argument, 0, 'c'},
 		{"allswaps", no_argument, 0, 'a'},
+		{"no-swap", required_argument, 0, 'n'},
 		{"verbose", no_argument, 0, 'v'},
 		{"version", no_argument, 0, 'V'},
 		{"help", no_argument, 0, 'h'},
@@ -416,7 +420,7 @@ process_arguments (int argc, char **argv)
 		return ERROR;
 
 	while (1) {
-		c = getopt_long (argc, argv, "+?Vvhac:w:", longopts, &option);
+		c = getopt_long (argc, argv, "+?Vvhac:w:n:", longopts, &option);
 
 		if (c == -1 || c == EOF)
 			break;
@@ -467,6 +471,10 @@ process_arguments (int argc, char **argv)
 		case 'a':									/* all swap */
 			allswaps = TRUE;
 			break;
+		case 'n':									/* no-swap */
+			if ((no_swap_state = translate_state(optarg)) == ERROR) {
+				usage4 (_("no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
+			}
 		case 'v':									/* verbose */
 			verbose++;
 			break;
@@ -532,20 +540,20 @@ validate_arguments (void)
 void
 print_help (void)
 {
-	print_revision (progname, NP_VERSION);
+  print_revision (progname, NP_VERSION);
 
-	printf (_(COPYRIGHT), copyright, email);
+  printf (_(COPYRIGHT), copyright, email);
 
-	printf ("%s\n", _("Check swap space on local machine."));
+  printf ("%s\n", _("Check swap space on local machine."));
 
   printf ("\n\n");
 
-	print_usage ();
+  print_usage ();
 
-	printf (UT_HELP_VRSN);
-	printf (UT_EXTRA_OPTS);
+  printf (UT_HELP_VRSN);
+  printf (UT_EXTRA_OPTS);
 
-	printf (" %s\n", "-w, --warning=INTEGER");
+  printf (" %s\n", "-w, --warning=INTEGER");
   printf ("    %s\n", _("Exit with WARNING status if less than INTEGER bytes of swap space are free"));
   printf (" %s\n", "-w, --warning=PERCENT%%");
   printf ("    %s\n", _("Exit with WARNING status if less than PERCENT of swap space is free"));
@@ -555,22 +563,24 @@ print_help (void)
   printf ("    %s\n", _("Exit with CRITICAL status if less than PERCENT of swap space is free"));
   printf (" %s\n", "-a, --allswaps");
   printf ("    %s\n", _("Conduct comparisons for all swap partitions, one by one"));
-	printf (UT_VERBOSE);
+  printf (" %s\n", "-n, --no-swap=<ok|warning|critical|unknown>");
+  printf ("    %s %s\n", _("Resulting state when there is no swap regardless of thresholds. Default:"), state_text(no_swap_state));
 
-	printf ("\n");
+  printf (UT_VERBOSE);
+
+  printf ("\n");
   printf ("%s\n", _("Notes:"));
   printf (" %s\n", _("Both INTEGER and PERCENT thresholds can be specified, they are all checked."));
   printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."));
 
-	printf (UT_SUPPORT);
+  printf (UT_SUPPORT);
 }
 
 
-
 void
 print_usage (void)
 {
-	printf ("%s\n", _("Usage:"));
+  printf ("%s\n", _("Usage:"));
   printf (" %s [-av] -w <percent_free>%% -c <percent_free>%%\n",progname);
-  printf ("  -w <bytes_free> -c <bytes_free>\n");
+  printf ("  -w <bytes_free> -c <bytes_free> [-n <state>]\n");
 }

+ 1 - 1
plugins/check_tcp.c

@@ -124,7 +124,7 @@ main (int argc, char **argv)
 			SERVICE[i] = toupper(SERVICE[i]);
 	}
 
-	/* set up a resonable buffer at first (will be realloc()'ed if
+	/* set up a reasonable buffer at first (will be realloc()'ed if
 	 * user specifies other options) */
 	server_expect = calloc(sizeof(char *), 2);
 

+ 30 - 0
plugins/netutils.c

@@ -392,3 +392,33 @@ resolve_host_or_addr (const char *address, int family)
 		return TRUE;
 	}
 }
+
+/* Turn a network address into a string */
+void
+parse_address_string(int address_family, struct sockaddr_storage *addr, char *address, int size)
+{
+	switch (address_family) {
+		case AF_INET:
+			inet_ntop(address_family, &((struct sockaddr_in *)addr)->sin_addr, address, size);
+		break;
+
+		case AF_INET6:
+			inet_ntop(address_family, &((struct sockaddr_in6 *)addr)->sin6_addr, address, size);
+		break;
+	}
+}
+
+/* Define the address length */
+char
+address_length(int address_family)
+{
+	switch (address_family) {
+		case AF_INET:
+			return INET_ADDRSTRLEN;
+		break;
+
+		case AF_INET6:
+			return INET6_ADDRSTRLEN;
+		break;
+	}
+}

+ 2 - 2
plugins/remove_perfdata.c

@@ -116,7 +116,7 @@ main(int argc, char **argv)
                     }
                 }
 
-                /* when we reach an unqouted |, stop printing */
+                /* when we reach an unquoted |, stop printing */
                 if (!in_quotes && c == '|')
                     break;
 
@@ -134,7 +134,7 @@ main(int argc, char **argv)
             break;
         }
 
-        /* for everything else, theres mastercard - or printing the full line to the screen */
+        /* for everything else, there's mastercard - or printing the full line to the screen */
         else {
             printf("%s\n", chld_out.line[i]);
         }

+ 5 - 5
plugins/t/check_by_ssh.t

@@ -27,7 +27,7 @@ plan skip_all => "SSH_HOST and SSH_IDENTITY must be defined" unless ($ssh_servic
 plan tests => 42;
 
 # Some random check strings/response
-my @responce = ('OK: Everything is fine',
+my @response = ('OK: Everything is fine',
                 'WARNING: Hey, pick me, pick me',
                 'CRITICAL: Shit happens',
                 'UNKNOWN: What can I do for ya',
@@ -35,7 +35,7 @@ my @responce = ('OK: Everything is fine',
 );
 my @responce_re;
 my @check;
-for (@responce) {
+for (@response) {
 	push(@check, "echo $_");
 	my $re_str = $_;
 	$re_str =~ s{(.)} { "\Q$1" }ge;
@@ -55,7 +55,7 @@ for (my $i=0; $i<4; $i++) {
 		"./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[$i]; exit $i'"
 		);
 	cmp_ok($result->return_code, '==', $i, "Exit with return code $i");
-	is($result->output, $responce[$i], "Status text is correct for check $i");
+	is($result->output, $response[$i], "Status text is correct for check $i");
 }
 
 $result = NPTest->testCmd(
@@ -92,7 +92,7 @@ $result = NPTest->testCmd(
 	"./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[4]; exit 8'"
 	);
 cmp_ok($result->return_code, '==', 8, "Exit with return code 8 (out of bounds)");
-is($result->output, $responce[4], "Return proper status text even with unknown status codes");
+is($result->output, $response[4], "Return proper status text even with unknown status codes");
 
 $result = NPTest->testCmd(
 	"./check_by_ssh -i $ssh_key -H $ssh_service -F $ssh_conf -C 'exit 0'"
@@ -116,7 +116,7 @@ my %linemap = (
 foreach my $line (0, 2, 4, 6) {
 	my $code = $linemap{$line};
 	my $statline = $line+1;
-	is($lines[$line], "$responce[$code]", "multiple checks status text is correct for line $line");
+	is($lines[$line], "$response[$code]", "multiple checks status text is correct for line $line");
 	is($lines[$statline], "STATUS CODE: $code", "multiple check status code is correct for line $line");
 }
 

+ 4 - 4
plugins/t/check_disk.t

@@ -329,15 +329,15 @@ cmp_ok( $result->return_code, '==', 3, "Invalid options: -p must come after grou
 $result = NPTest->testCmd( "./check_disk -w 1 -c 1 -r '('" );
 cmp_ok( $result->return_code, '==', 3, "Exit UNKNOWN if regex is not compileable");
 
-# ignore: exit unknown, if all pathes are deselected using -i
+# ignore: exit unknown, if all paths are deselected using -i
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '$mountpoint_valid' -i '$mountpoint2_valid'" );
 cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case sensitive)");
 
-# ignore: exit unknown, if all pathes are deselected using -I
+# ignore: exit unknown, if all paths are deselected using -I
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -I '".uc($mountpoint_valid)."' -I '".uc($mountpoint2_valid)."'" );
 cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case insensitive)");
 
-# ignore: exit unknown, if all pathes are deselected using -i
+# ignore: exit unknown, if all paths are deselected using -i
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '.*'" );
 cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored using -i '.*'");
 
@@ -346,7 +346,7 @@ $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mo
 like( $result->output, qr/$mountpoint_valid/, "output data does have $mountpoint_valid in it");
 unlike( $result->output, qr/$mountpoint2_valid/, "output data does not have $mountpoint2_valid in it");
 
-# ignore: test if all pathes are listed when ignore regex doesn't match
+# ignore: test if all paths are listed when ignore regex doesn't match
 $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '^barbazJodsf\$'");
 like( $result->output, qr/$mountpoint_valid/, "ignore: output data does have $mountpoint_valid when regex doesn't match");
 like( $result->output, qr/$mountpoint2_valid/,"ignore: output data does have $mountpoint2_valid when regex doesn't match");

+ 1 - 1
plugins/t/check_mysql.t

@@ -5,7 +5,7 @@
 #
 #
 # These are the database permissions required for this test:
-#  GRANT SELECT ON $db.* TO $user@$host INDENTIFIED BY '$password';
+#  GRANT SELECT ON $db.* TO $user@$host IDENTIFIED BY '$password';
 #  GRANT SUPER, REPLICATION CLIENT ON *.* TO $user@$host;
 # Check with:
 #  mysql -u$user -p$password -h$host $db

+ 1 - 1
plugins/t/check_nagios.t

@@ -36,7 +36,7 @@ cmp_ok( $result->return_code, '==', 1, "Log over 5 minutes old" );
 like  ( $result->output, $warningOutput, "Output for warning correct" );
 
 my $now = time;
-# This substitution is dependant on the testcase
+# This substitution is dependent on the testcase
 system( "perl -pe 's/1133537544/$now/' $nagios1 > $nagios1.tmp" ) == 0 or die "Problem with munging $nagios1";
 
 $result = NPTest->testCmd(

+ 2 - 2
plugins/tests/check_snmp.t

@@ -51,7 +51,7 @@ if ($pid) {
 	#print "child\n";
 
 	print "Please contact SNMP at: $port_snmp\n";
-	close(STDERR); # Coment out to debug snmpd problems (most errors sent there are OK)
+	close(STDERR); # Comment out to debug snmpd problems (most errors sent there are OK)
 	exec("snmpd -c tests/conf/snmpd.conf -C -f -r udp:$port_snmp");
 }
 
@@ -221,7 +221,7 @@ is($res->output, 'SNMP OK - "555\"I said\"" | ', "Check string with a double quo
 
 $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.15 -r 'CUSTOM CHECK OK'" );
 is($res->return_code, 0, "String check should check whole string, not a parsed number" );
-is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check witn numbers returns whole string");
+is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check with numbers returns whole string");
 
 $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.16 -w -2: -c -3:" );
 is($res->return_code, 0, "Negative integer check OK" );

+ 1 - 1
plugins/utils.h

@@ -7,7 +7,7 @@
 /* The purpose of this package is to provide safer alternatives to C
 functions that might otherwise be vulnerable to hacking. This
 currently includes a standard suite of validation routines to be sure
-that an string argument acually converts to its intended type and a
+that an string argument actually converts to its intended type and a
 suite of string handling routine that do their own memory management
 in order to resist overflow attacks. In addition, a few functions are
 provided to standardize version and error reporting across the entire

+ 6 - 6
po/nagios-plugins.pot

@@ -803,7 +803,7 @@ msgstr ""
 
 #: plugins/check_fping.c:154
 #, c-format
-msgid "FPING UNKNOW - %s not found\n"
+msgid "FPING UNKNOWN - %s not found\n"
 msgstr ""
 
 #: plugins/check_fping.c:158
@@ -1412,7 +1412,7 @@ msgstr ""
 #: plugins/check_http.c:1392
 msgid ""
 "other errors return STATE_UNKNOWN.  Successful connects, but incorrect "
-"reponse"
+"response"
 msgstr ""
 
 #: plugins/check_http.c:1393
@@ -3287,7 +3287,7 @@ msgid ""
 msgstr ""
 
 #: plugins/check_pgsql.c:467
-msgid "a password, but no effort is made to obsure or encrypt the password."
+msgid "a password, but no effort is made to obscure or encrypt the password."
 msgstr ""
 
 #: plugins/check_ping.c:141
@@ -3786,7 +3786,7 @@ msgid "The user to authenticate"
 msgstr ""
 
 #: plugins/check_radius.c:352
-msgid "Password for autentication (SECURITY RISK)"
+msgid "Password for authentication (SECURITY RISK)"
 msgstr ""
 
 #: plugins/check_radius.c:354
@@ -3919,7 +3919,7 @@ msgstr ""
 
 #: plugins/check_real.c:440
 msgid ""
-"but incorrect reponse messages from the host result in STATE_WARNING return"
+"but incorrect response messages from the host result in STATE_WARNING return"
 msgstr ""
 
 #: plugins/check_real.c:441
@@ -4134,7 +4134,7 @@ msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN.  Successful"
 msgstr ""
 
 #: plugins/check_smtp.c:829
-msgid "connects, but incorrect reponse messages from the host result in"
+msgid "connects, but incorrect response messages from the host result in"
 msgstr ""
 
 #: plugins/check_smtp.c:830

+ 2 - 2
tap/tap.3

@@ -291,7 +291,7 @@ always returns 0.
 .Xc
 .El
 .Pp
-For maximum compatability your test program should return a particular
+For maximum compatibility your test program should return a particular
 exit code.  This is calculated by
 .Fn exit_status
 so it is sufficient to always return from
@@ -309,7 +309,7 @@ directory in the source distribution contains numerous tests of
 functionality, written using
 .Nm .
 Examine them for examples of how to construct test suites.
-.Sh COMPATABILITY
+.Sh COMPATIBILITY
 .Nm
 strives to be compatible with the Perl Test::More and Test::Harness 
 modules.  The test suite verifies that

+ 1 - 1
tap/tap.h

@@ -25,7 +25,7 @@
  */
 
 /* '## __VA_ARGS__' is a gcc'ism. C99 doesn't allow the token pasting
-   and requires the caller to add the final comma if they've ommitted
+   and requires the caller to add the final comma if they've omitted
    the optional arguments */
 #ifdef __GNUC__
 # define ok(e, test, ...) ((e) ?					\

+ 3 - 3
tools/build_perl_modules.in

@@ -140,7 +140,7 @@ my $libs = "$destdir/$prefix/lib:$destdir/$prefix/lib/$Config{archname}";
 
 my $topdir = cwd();
 
-# set an initial value if there isnt one already
+# set an initial value if there isn't one already
 # Need to use PERL5LIB to ensure we get pre-installed mods from earlier
 # tags in the install_order file
 $ENV{PERL5LIB} ||= q{};
@@ -149,8 +149,8 @@ $ENV{PERL5LIB} ||= q{};
 $ENV{PERL_AUTOINSTALL} = "--skipdeps";
 
 # keep a record of how many times a module build is done.  This is so they may
-# be built a second time to include optional prereq's that couldnt
-# previously be built due to circular dependancies
+# be built a second time to include optional prereq's that couldn't
+# previously be built due to circular dependencies
 my %built_modules;
 foreach my $tarball (@tarballs) {
     ( my $dir = $tarball ) =~ s/\.(?:tgz|tar.gz)$//;

+ 1 - 1
tools/p1.pl

@@ -2,7 +2,7 @@
 #
 # Hacked version of the sample code from the perlembedded doco.
 #
-# Only major changes are to separate the compiling and cacheing from 
+# Only major changes are to separate the compiling and caching from
 # the execution so that the cache can be kept in "non-volatile" parent
 # process while the execution is done from "volatile" child processes
 # and that STDOUT is redirected to a file by means of a tied filehandle

+ 2 - 2
tools/tinderbox_build

@@ -133,12 +133,12 @@ sub BuildIt {
 # this fun line added on 2/5/98. do not remove. Translated to english,
 # that's "take any line longer than 1000 characters, and split it into less
 # than 1000 char lines.  If any of the resulting lines is
-# a dot on a line by itself, replace that with a blank line."  
+# a dot on a line by itself, replace that with a blank line."
 # This is to prevent cases where a <cr>.<cr> occurs in the log file.  Sendmail
 # interprets that as the end of the mail, and truncates the log before
 # it gets to Tinderbox.  (terry weismann, chris yeh)
 #
-# This was replaced by a perl 'port' of the above, writen by 
+# This was replaced by a perl 'port' of the above, written by
 # preed@netscape.com; good things: no need for system() call, and now it's
 # all in perl, so we don't have to do OS checking like before.
 

Неке датотеке нису приказане због велике количине промена