summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 35df6c6)
raw | patch | inline | side by side (parent: 35df6c6)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 21 Oct 2002 03:55:37 +0000 (03:55 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 21 Oct 2002 03:55:37 +0000 (03:55 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@147 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_load.c | patch | blob | history |
diff --git a/plugins/check_load.c b/plugins/check_load.c
index bedbf16e7082e4beac06434a4af6248e9601130b..3c0ecad80b51506b1fa1acf0438dce68d4a28bd0 100644 (file)
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
if (c == argc)
return validate_arguments ();
if (wload1 < 0 && is_nonnegative (argv[c]))
- wload1 = atof (argv[c]);
+ wload1 = atof (argv[c++]);
if (c == argc)
return validate_arguments ();
if (cload1 < 0 && is_nonnegative (argv[c]))
- cload1 = atof (argv[c]);
+ cload1 = atof (argv[c++]);
if (c == argc)
return validate_arguments ();
if (wload5 < 0 && is_nonnegative (argv[c]))
- wload5 = atof (argv[c]);
+ wload5 = atof (argv[c++]);
if (c == argc)
return validate_arguments ();
if (cload5 < 0 && is_nonnegative (argv[c]))
- cload5 = atof (argv[c]);
+ cload5 = atof (argv[c++]);
if (c == argc)
return validate_arguments ();
if (wload15 < 0 && is_nonnegative (argv[c]))
- wload15 = atof (argv[c]);
+ wload15 = atof (argv[c++]);
if (c == argc)
return validate_arguments ();
if (cload15 < 0 && is_nonnegative (argv[c]))
- cload15 = atof (argv[c]);
+ cload15 = atof (argv[c++]);
return validate_arguments ();
}
int
validate_arguments (void)
{
- if ((wload1 > cload1) || (wload5 > cload5) || (wload15 > cload15)) {
- printf
- ("Inconsistence in parameters: \"warning load\" greater than \"critical load\".\n");
- return STATE_UNKNOWN;
- }
-
+ if (wload1 < 0)
+ usage ("Warning threshold for 1-minute load average is not specified\n");
+ if (wload5 < 0)
+ usage ("Warning threshold for 5-minute load average is not specified\n");
+ if (wload15 < 0)
+ usage ("Warning threshold for 15-minute load average is not specified\n");
+ if (cload1 < 0)
+ usage ("Critical threshold for 1-minute load average is not specified\n");
+ if (cload5 < 0)
+ usage ("Critical threshold for 5-minute load average is not specified\n");
+ if (cload15 < 0)
+ usage ("Critical threshold for 15-minute load average is not specified\n");
+ if (wload1 > cload1)
+ usage ("Parameter inconsistency: 1-minute \"warning load\" greater than \"critical load\".\n");
+ if (wload5 > cload5)
+ usage ("Parameter inconsistency: 5-minute \"warning load\" greater than \"critical load\".\n");
+ if (wload15 > cload15)
+ usage ("Parameter inconsistency: 15-minute \"warning load\" greater than \"critical load\".\n");
return OK;
}