summaryrefslogtreecommitdiffstats
path: root/plugins/check_mrtgtraf.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_mrtgtraf.c')
-rw-r--r--plugins/check_mrtgtraf.c107
1 files changed, 62 insertions, 45 deletions
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index 877072c..adaf9e2 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -1,18 +1,35 @@
1/****************************************************************************** 1/******************************************************************************
2 2*
3 This program is free software; you can redistribute it and/or modify 3* Nagios check_mrtgtraf 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) 1999-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_mtrgtraf 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* This plugin will check the incoming/outgoing transfer rates of a router
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 15* switch, etc recorded in an MRTG log.
16*
17*
18* License Information:
19*
20* This program is free software; you can redistribute it and/or modify
21* it under the terms of the GNU General Public License as published by
22* the Free Software Foundation; either version 2 of the License, or
23* (at your option) any later version.
24*
25* This program is distributed in the hope that it will be useful,
26* but WITHOUT ANY WARRANTY; without even the implied warranty of
27* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28* GNU General Public License for more details.
29*
30* You should have received a copy of the GNU General Public License
31* along with this program; if not, write to the Free Software
32* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 33
17 $Id$ 34 $Id$
18 35
@@ -23,7 +40,7 @@
23 40
24const char *progname = "check_mrtgtraf"; 41const char *progname = "check_mrtgtraf";
25const char *revision = "$Revision$"; 42const char *revision = "$Revision$";
26const char *copyright = "1999-2004"; 43const char *copyright = "1999-2006";
27const char *email = "nagiosplug-devel@lists.sourceforge.net"; 44const char *email = "nagiosplug-devel@lists.sourceforge.net";
28 45
29int process_arguments (int, char **); 46int process_arguments (int, char **);
@@ -317,38 +334,38 @@ print_help (void)
317 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"); 334 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
318 printf (COPYRIGHT, copyright, email); 335 printf (COPYRIGHT, copyright, email);
319 336
320 printf (_("\n\ 337 printf ("%s\n", _("This plugin will check the incoming/outgoing transfer rates of a router,"));
321This plugin will check the incoming/outgoing transfer rates of a router,\n\ 338 printf ("%s\n", _("switch, etc recorded in an MRTG log. If the newest log entry is older"));
322switch, etc recorded in an MRTG log. If the newest log entry is older\n\ 339 printf ("%s\n", _("than <expire_minutes>, a WARNING status is returned. If either the"));
323than <expire_minutes>, a WARNING status is returned. If either the\n\ 340 printf ("%s\n", _("incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"));
324incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in\n\ 341 printf ("%s\n", _("Bytes/sec), a CRITICAL status results. If either of the rates exceed"));
325Bytes/sec), a CRITICAL status results. If either of the rates exceed\n\ 342 printf ("%s\n", _("the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."));
326the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n")); 343
344 printf ("\n\n");
327 345
328 print_usage (); 346 print_usage ();
329 347
330 printf (_(UT_HELP_VRSN)); 348 printf (_(UT_HELP_VRSN));
331 349
332 printf (_("\ 350 printf (" %s\n", "-F, --filename=STRING");
333 -F, --filename=STRING\n\ 351 printf (" %s\n", _("File to read log from"));
334 File to read log from\n\ 352 printf (" %s\n", "-e, --expires=INTEGER");
335 -e, --expires=INTEGER\n\ 353 printf (" %s\n", _("Minutes after which log expires"));
336 Minutes after which log expires\n\ 354 printf (" %s\n", "-a, --aggregation=(AVG|MAX)");
337 -a, --aggregation=(AVG|MAX)\n\ 355 printf (" %s\n", _("Test average or maximum"));
338 Test average or maximum\n\ 356 printf (" %s\n", "-w, --warning");
339 -w, --warning\n\ 357 printf (" %s\n", _("Warning threshold pair <incoming>,<outgoing>"));
340 Warning threshold pair \"<incoming>,<outgoing>\"\n\ 358 printf (" %s\n", "-c, --critical");
341 -c, --critical\n\ 359 printf (" %s\n", _("Critical threshold pair <incoming>,<outgoing>"));
342 Critical threshold pair \"<incoming>,<outgoing>\"\n")); 360
343 361 printf ("%s\n", _("Notes:"));
344 printf (_("Notes:\n\ 362 printf (" %s\n", _("- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"));
345- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from\n\ 363 printf (" %s\n", _(" http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"));
346 http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html\n\ 364 printf (" %s\n", _("- While MRTG can monitor things other than traffic rates, this"));
347- While MRTG can monitor things other than traffic rates, this\n\ 365 printf (" %s\n", _(" plugin probably won't work with much else without modification."));
348 plugin probably won't work with much else without modification.\n\ 366 printf (" %s\n", _("- The calculated i/o rates are a little off from what MRTG actually"));
349- The calculated i/o rates are a little off from what MRTG actually\n\ 367 printf (" %s\n", _(" reports. I'm not sure why this is right now, but will look into it"));
350 reports. I'm not sure why this is right now, but will look into it\n\ 368 printf (" %s\n", _(" for future enhancements of this plugin."));
351 for future enhancements of this plugin.\n"));
352 369
353 printf (_(UT_SUPPORT)); 370 printf (_(UT_SUPPORT));
354} 371}
@@ -358,7 +375,7 @@ the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
358void 375void
359print_usage (void) 376print_usage (void)
360{ 377{
361 printf ("\ 378 printf (_("Usage"));
362Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair>\n\ 379 printf (" %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair>",progname);
363 -c <critical_pair> [-e expire_minutes] [-t timeout] [-v]\n", progname); 380 printf ("-c <critical_pair> [-e expire_minutes] [-t timeout] [-v]\n");
364} 381}