summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 48ecd29)
raw | patch | inline | side by side (parent: 48ecd29)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 11 Nov 2003 10:19:29 +0000 (10:19 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 11 Nov 2003 10:19:29 +0000 (10:19 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@760 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_swap.c | patch | blob | history |
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 367c720d2d2a8313d7c51b07920e0c2174ab79f7..b8f82db1e7156a09ba2db62f0227133cec73802c 100644 (file)
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
void print_usage (void);
void print_help (void);
-int warn_percent = 200;
-int crit_percent = 200;
+int warn_percent = 0;
+int crit_percent = 0;
long unsigned int warn_size = 0;
long unsigned int crit_size = 0;
int verbose;
check_swap (int usp, long unsigned int free_swap)
{
int result = STATE_UNKNOWN;
- if (usp >= 0 && usp >= (100.0 - crit_percent))
+ free_swap = free_swap * 1024; /* Convert back to bytes as warn and crit specified in bytes */
+ if (usp >= 0 && crit_percent != 0 && usp >= (100.0 - crit_percent))
result = STATE_CRITICAL;
else if (crit_size > 0 && free_swap <= crit_size)
result = STATE_CRITICAL;
- else if (usp >= 0 && usp >= (100.0 - warn_percent))
+ else if (usp >= 0 && warn_percent != 0 && usp >= (100.0 - warn_percent))
result = STATE_WARNING;
else if (warn_size > 0 && free_swap <= warn_size)
result = STATE_WARNING;