[Nagiosplug-checkins] CVS: nagiosplug/plugins check_users.c,1.4,1.5 check_dig.c,1.11,1.12 check_tcp.c,1.20,1.21

Karl DeBisschop kdebisschop at users.sourceforge.net
Wed Apr 16 22:56:06 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv4160

Modified Files:
	check_users.c check_dig.c check_tcp.c 
Log Message:
code cleanup to clear strict compiler warnings

Index: check_users.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_users.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** check_users.c	11 Mar 2003 22:22:12 -0000	1.4
--- check_users.c	17 Apr 2003 05:55:25 -0000	1.5
***************
*** 1,47 ****
! /******************************************************************************
!  *
!  * CHECK_USERS.C
!  *
!  * Program: Current users plugin for Nagios
!  * License: GPL
!  * Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)
!  *
!  * Last Modified: $Date$
!  * Modifications: 
!  *
!  * 1999-11-17 Karl DeBisschop
!  *  - check stderr and status from spoen/spclose
!  *  - reformat commenst to fit 80-cahr screen
!  *  - set default result to STATE_UNKNOWN
!  *  - initialize users at -1, eliminate 'found' variable
!  *
!  * Command line: CHECK_USERS <wusers> <cusers>
!  *
!  * Description:
!  *
!  * This plugin will use the /usr/bin/who command to check the number
!  * of users currently logged into the system.  If number of logged in
!  * user exceeds the number specified by the <cusers> option, a
!  * STATE_CRITICAL is return.  It it exceeds <wusers>, a STATE_WARNING
!  * is returned.  Errors reading the output from the who command result
!  * in a STATE_UNKNOWN error.
!  *
!  * License Information:
!  *
!  * This program is free software; you can redistribute it and/or modify
!  * it under the terms of the GNU General Public License as published by
!  * the Free Software Foundation; either version 2 of the License, or
!  * (at your option) any later version.
!  *
!  * This program is distributed in the hope that it will be useful,
!  * but WITHOUT ANY WARRANTY; without even the implied warranty of
!  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!  * GNU General Public License for more details.
!  *
!  * You should have received a copy of the GNU General Public License
!  * along with this program; if not, write to the Free Software
!  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!  *
!  *****************************************************************************/
  
  #include "common.h"
--- 1,19 ----
! /*****************************************************************************
! *
! * This program is free software; you can redistribute it and/or modify
! * it under the terms of the GNU General Public License as published by
! * the Free Software Foundation; either version 2 of the License, or
! * (at your option) any later version.
! *
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! * GNU General Public License for more details.
! *
! * You should have received a copy of the GNU General Public License
! * along with this program; if not, write to the Free Software
! * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
! *
! *****************************************************************************/
  
  #include "common.h"
***************
*** 50,57 ****
  
  const char *progname = "check_users";
! #define REVISION "$Revision$"
! #define COPYRIGHT "1999-2002"
! #define AUTHOR "Ethan Galstad"
! #define EMAIL "nagios at nagios.org"
  
  #define possibly_set(a,b) ((a) == 0 ? (b) : 0)
--- 22,47 ----
  
  const char *progname = "check_users";
! const char *revision = "$Revision$";
! const char *copyright = "2002-2003";
! const char *authors = "Nagios Plugin Development Team";
! const char *email = "nagiosplug-devel at lists.sourceforge.net";
! 
! const char *summary = "\
! This plugin checks the number of users currently logged in on the local\n\
! system and generates an error if the number exceeds the thresholds specified.\n";
! 
! const char *option_summary = "-w <users> -c <users>";
! 
! const char *options = "\
!  -w, --warning=INTEGER\n\
!     Set WARNING status if more than INTEGER users are logged in\n\
!  -c, --critical=INTEGER\n\
!     Set CRITICAL status if more than INTEGER users are logged in\n";
! 
! const char *standard_options = "\
!  -h, --help\n\
!     Print detailed help screen\n\
!  -V, --version\n\
!     Print version information\n\n";
  
  #define possibly_set(a,b) ((a) == 0 ? (b) : 0)
***************
*** 164,168 ****
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'c':									/* critical */
--- 154,158 ----
  			exit (STATE_OK);
  		case 'V':									/* version */
! 			print_revision (progname, revision);
  			exit (STATE_OK);
  		case 'c':									/* critical */
***************
*** 194,198 ****
  	return OK;
  }
! 
  
  
--- 184,188 ----
  	return OK;
  }
! 
  
  
***************
*** 200,206 ****
  
  void
! print_usage (void)
  {
! 	printf ("Usage: %s -w <users> -c <users>\n", progname);
  }
  
--- 190,203 ----
  
  void
! print_help (void)
  {
! 	print_revision (progname, revision);
! 	printf ("Copyright (c) %s %s\n\t<%s>\n\n", copyright, authors, email);
! 	printf (summary);
! 	print_usage ();
! 	printf ("\nOptions:\n");
! 	printf (options);
! 	printf (standard_options);
! 	support ();
  }
  
***************
*** 210,229 ****
  
  void
! print_help (void)
  {
! 	print_revision (progname, REVISION);
! 	printf
! 		("Copyright (c) " COPYRIGHT " " AUTHOR "(" EMAIL ")\n\n"
! 		 "This plugin checks the number of users currently logged in on the local\n"
! 		 "system and generates an error if the number exceeds the thresholds specified.\n");
! 	print_usage ();
! 	printf
! 		("Options:\n"
! 		 " -w, --warning=INTEGER\n"
! 		 "    Set WARNING status if more than INTEGER users are logged in\n"
! 		 " -c, --critical=INTEGER\n"
! 		 "    Set CRITICAL status if more than INTEGER users are logged in\n"
! 		 " -h, --help\n"
! 		 "    Print detailed help screen\n"
! 		 " -V, --version\n" "    Print version information\n");
  }
--- 207,214 ----
  
  void
! print_usage (void)
  {
! 	printf ("Usage: %s %s\n", progname, option_summary);
! 	printf ("       %s (-h|--help)\n", progname);
! 	printf ("       %s (-V|--version)\n", progname);
  }

Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** check_dig.c	17 Apr 2003 05:36:20 -0000	1.11
--- check_dig.c	17 Apr 2003 05:55:25 -0000	1.12
***************
*** 22,25 ****
--- 22,26 ----
  const char *authors = "Nagios Plugin Development Team";
  const char *email = "nagiosplug-devel at lists.sourceforge.net";
+ 
  const char *summary = "Test the DNS service on the specified host using dig\n";
  
***************
*** 34,42 ****
     Seconds before connection attempt times out (default: %d)\n\
   -v, --verbose\n\
!    Print extra information (command-line use only)\n\
   -h, --help\n\
!    Print detailed help screen\n\
   -V, --version\n\
!    Print version information\n\n";
  
  #include "config.h"
--- 35,45 ----
     Seconds before connection attempt times out (default: %d)\n\
   -v, --verbose\n\
!    Print extra information (command-line use only)\n";
! 
! const char *standard_options = "\
   -h, --help\n\
!     Print detailed help screen\n\
   -V, --version\n\
!     Print version information\n\n";
  
  #include "config.h"
***************
*** 239,243 ****
  	return OK;
  }
! 
  
  
--- 242,246 ----
  	return OK;
  }
! 
  
  
***************
*** 248,257 ****
  {
  	print_revision (progname, revision);
! 	printf
! 		("Copyright (c) %s %s <%s>\n\n%s\n",
! 		 copyright, authors, email, summary);
  	print_usage ();
  	printf ("\nOptions:\n");
  	printf (options, DEFAULT_SOCKET_TIMEOUT);
  	support ();
  }
--- 251,260 ----
  {
  	print_revision (progname, revision);
! 	printf ("Copyright (c) %s %s\n\t<%s>\n\n", copyright, authors, email);
! 	printf (summary);
  	print_usage ();
  	printf ("\nOptions:\n");
  	printf (options, DEFAULT_SOCKET_TIMEOUT);
+ 	printf (standard_options);
  	support ();
  }

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** check_tcp.c	17 Apr 2003 05:36:20 -0000	1.20
--- check_tcp.c	17 Apr 2003 05:55:25 -0000	1.21
***************
*** 58,62 ****
      Print detailed help screen\n\
   -V, --version\n\
!     Print version information";
  
  #include "config.h"
--- 58,62 ----
      Print detailed help screen\n\
   -V, --version\n\
!     Print version information\n\n";
  
  #include "config.h"
***************
*** 359,366 ****
  	return result;
  }
! 
! 
! 
! 
  
  
--- 359,363 ----
  	return result;
  }
! 
  
  
***************
*** 514,517 ****
--- 511,517 ----
  	return OK;
  }
+ 
+ 
+ 
  
  void
***************
*** 519,524 ****
  {
  	print_revision (progname, revision);
! 	printf ("Copyright (c) %s %s\n\t<%s>\n\n",
! 	        copyright, authors, email);
  	printf (summary, SERVICE);
  	print_usage ();
--- 519,523 ----
  {
  	print_revision (progname, revision);
! 	printf ("Copyright (c) %s %s\n\t<%s>\n\n", copyright, authors, email);
  	printf (summary, SERVICE);
  	print_usage ();
***************
*** 536,539 ****
--- 535,541 ----
  	printf ("       %s (-V|--version)\n", progname);
  }
+ 
+ 
+ 
  
  #ifdef HAVE_SSL





More information about the Commits mailing list