summaryrefslogtreecommitdiffstats
path: root/plugins/check_users.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_users.c')
-rw-r--r--plugins/check_users.c72
1 files changed, 43 insertions, 29 deletions
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 25d04ed..34d4775 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -1,26 +1,39 @@
1/***************************************************************************** 1/******************************************************************************
2 2*
3 This program is free software; you can redistribute it and/or modify 3* Nagios check_users plugin
4 it under the terms of the GNU General Public License as published by 4*
5 the Free Software Foundation; either version 2 of the License, or 5* License: GPL
6 (at your option) any later version. 6* Copyright (c) 2002-2006 nagios-plugins team
7 7*
8 This program is distributed in the hope that it will be useful, 8* Last Modified: $Date$
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9*
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* Description:
11 GNU General Public License for more details. 11*
12 12* This file contains the check_users plugin
13 You should have received a copy of the GNU General Public License 13*
14 along with this program; if not, write to the Free Software 14* License Information:
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 15*
16 16* This program is free software; you can redistribute it and/or modify
17 $Id$ 17* it under the terms of the GNU General Public License as published by
18 18* the Free Software Foundation; either version 2 of the License, or
19* (at your option) any later version.
20*
21* This program is distributed in the hope that it will be useful,
22* but WITHOUT ANY WARRANTY; without even the implied warranty of
23* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24* GNU General Public License for more details.
25*
26* You should have received a copy of the GNU General Public License
27* along with this program; if not, write to the Free Software
28* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29*
30* $Id$
31*
19*****************************************************************************/ 32*****************************************************************************/
20 33
21const char *progname = "check_users"; 34const char *progname = "check_users";
22const char *revision = "$Revision$"; 35const char *revision = "$Revision$";
23const char *copyright = "2000-2004"; 36const char *copyright = "2000-2006";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 37const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 38
26#include "common.h" 39#include "common.h"
@@ -98,7 +111,7 @@ main (int argc, char **argv)
98 result = STATE_OK; 111 result = STATE_OK;
99 112
100 if (result == STATE_UNKNOWN) 113 if (result == STATE_UNKNOWN)
101 printf (_("Unable to read output\n")); 114 printf ("%s\n", _("Unable to read output"));
102 else { 115 else {
103 asprintf(&perf, "%s", perfdata ("users", users, "", 116 asprintf(&perf, "%s", perfdata ("users", users, "",
104 TRUE, wusers, 117 TRUE, wusers,
@@ -190,19 +203,19 @@ print_help (void)
190 printf ("Copyright (c) 1999 Ethan Galstad\n"); 203 printf ("Copyright (c) 1999 Ethan Galstad\n");
191 printf (COPYRIGHT, copyright, email); 204 printf (COPYRIGHT, copyright, email);
192 205
193 printf (_("\ 206 printf ("%s\n", _("This plugin checks the number of users currently logged in on the local"));
194This plugin checks the number of users currently logged in on the local\n\ 207 printf ("%s\n", _("system and generates an error if the number exceeds the thresholds specified."));
195system and generates an error if the number exceeds the thresholds specified.\n")); 208
209 printf ("\n\n");
196 210
197 print_usage (); 211 print_usage ();
198 212
199 printf (_(UT_HELP_VRSN)); 213 printf (_(UT_HELP_VRSN));
200 214
201 printf (_("\ 215 printf (" %s\n", "-w, --warning=INTEGER");
202 -w, --warning=INTEGER\n\ 216 printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
203 Set WARNING status if more than INTEGER users are logged in\n\ 217 printf (" %s\n", "-c, --critical=INTEGER");
204 -c, --critical=INTEGER\n\ 218 printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
205 Set CRITICAL status if more than INTEGER users are logged in\n"));
206 219
207 printf (_(UT_SUPPORT)); 220 printf (_(UT_SUPPORT));
208} 221}
@@ -211,5 +224,6 @@ system and generates an error if the number exceeds the thresholds specified.\n"
211void 224void
212print_usage (void) 225print_usage (void)
213{ 226{
214 printf ("Usage: %s -w <users> -c <users>\n", progname); 227 printf (_("Usage:"));
228 printf ("%s -w <users> -c <users>\n", progname);
215} 229}