summaryrefslogtreecommitdiffstats
path: root/plugins/check_mrtgtraf.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-09 06:01:03 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-09 06:01:03 (GMT)
commita228492c4bea15a3e6e7bdbfd6631611c97fe92c (patch)
tree0d21d5c54a2ab5ec3f4171fab668d390ea09bbaa /plugins/check_mrtgtraf.c
parent024751bac56791b7ae5347404274046e8ba58ccb (diff)
downloadmonitoring-plugins-a228492c4bea15a3e6e7bdbfd6631611c97fe92c.tar.gz
more pedantic compiler warns
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@672 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_mrtgtraf.c')
-rw-r--r--plugins/check_mrtgtraf.c119
1 files changed, 67 insertions, 52 deletions
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index ce9ab19..be2f562 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -24,60 +24,10 @@ const char *revision = "$Revision$";
24const char *copyright = "1999-2003"; 24const char *copyright = "1999-2003";
25const char *email = "nagiosplug-devel@lists.sourceforge.net"; 25const char *email = "nagiosplug-devel@lists.sourceforge.net";
26 26
27void
28print_usage (void)
29{
30 printf (_("\
31Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair> -c <critical_pair>\n\
32 [-e expire_minutes] [-t timeout] [-v]\n"), progname);
33 printf (_(UT_HLP_VRS), progname, progname);
34}
35
36void
37print_help (void)
38{
39 print_revision (progname, revision);
40
41 printf (_(COPYRIGHT), copyright, email);
42
43 print_usage ();
44
45 printf (_(UT_HELP_VRSN));
46
47 printf (_("\
48 -F, --filename=STRING\n\
49 File to read log from\n\
50 -e, --expires=INTEGER\n\
51 Minutes after which log expires\n\
52 -a, --aggregation=(AVG|MAX)\n\
53 Test average or maximum\n\
54 -w, --warning\n\
55 Warning threshold pair \"<incoming>,<outgoing>\"\n\
56 -c, --critical\n\
57 Critical threshold pair \"<incoming>,<outgoing>\"\n"));
58
59 printf (_("\n\
60This plugin will check the incoming/outgoing transfer rates of a router,\n\
61switch, etc recorded in an MRTG log. If the newest log entry is older\n\
62than <expire_minutes>, a WARNING status is returned. If either the\n\
63incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in\n\
64Bytes/sec), a CRITICAL status results. If either of the rates exceed\n\
65the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
66
67 printf (_("Notes:\n\
68- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from\n\
69 http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html\n\
70- While MRTG can monitor things other than traffic rates, this\n\
71 plugin probably won't work with much else without modification.\n\
72- The calculated i/o rates are a little off from what MRTG actually\n\
73 reports. I'm not sure why this is right now, but will look into it\n\
74 for future enhancements of this plugin.\n"));
75
76 printf (_(UT_SUPPORT));
77}
78
79int process_arguments (int, char **); 27int process_arguments (int, char **);
80int validate_arguments (void); 28int validate_arguments (void);
29void print_help(void);
30void print_usage(void);
81 31
82char *log_file = NULL; 32char *log_file = NULL;
83int expire_minutes = -1; 33int expire_minutes = -1;
@@ -87,6 +37,10 @@ unsigned long incoming_critical_threshold = 0L;
87unsigned long outgoing_warning_threshold = 0L; 37unsigned long outgoing_warning_threshold = 0L;
88unsigned long outgoing_critical_threshold = 0L; 38unsigned long outgoing_critical_threshold = 0L;
89 39
40
41
42
43
90int 44int
91main (int argc, char **argv) 45main (int argc, char **argv)
92{ 46{
@@ -357,3 +311,64 @@ validate_arguments (void)
357{ 311{
358 return OK; 312 return OK;
359} 313}
314
315
316
317
318
319
320void
321print_help (void)
322{
323 print_revision (progname, revision);
324
325 printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
326 printf (_(COPYRIGHT), copyright, email);
327
328 print_usage ();
329
330 printf (_(UT_HELP_VRSN));
331
332 printf (_("\
333 -F, --filename=STRING\n\
334 File to read log from\n\
335 -e, --expires=INTEGER\n\
336 Minutes after which log expires\n\
337 -a, --aggregation=(AVG|MAX)\n\
338 Test average or maximum\n\
339 -w, --warning\n\
340 Warning threshold pair \"<incoming>,<outgoing>\"\n\
341 -c, --critical\n\
342 Critical threshold pair \"<incoming>,<outgoing>\"\n"));
343
344 printf (_("\n\
345This plugin will check the incoming/outgoing transfer rates of a router,\n\
346switch, etc recorded in an MRTG log. If the newest log entry is older\n\
347than <expire_minutes>, a WARNING status is returned. If either the\n\
348incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in\n\
349Bytes/sec), a CRITICAL status results. If either of the rates exceed\n\
350the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
351
352 printf (_("Notes:\n\
353- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from\n\
354 http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html\n\
355- While MRTG can monitor things other than traffic rates, this\n\
356 plugin probably won't work with much else without modification.\n\
357- The calculated i/o rates are a little off from what MRTG actually\n\
358 reports. I'm not sure why this is right now, but will look into it\n\
359 for future enhancements of this plugin.\n"));
360
361 printf (_(UT_SUPPORT));
362}
363
364
365
366
367void
368print_usage (void)
369{
370 printf (_("\
371Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair> -c <critical_pair>\n\
372 [-e expire_minutes] [-t timeout] [-v]\n"), progname);
373 printf (_(UT_HLP_VRS), progname, progname);
374}