summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c81964)
raw | patch | inline | side by side (parent: 3c81964)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Tue, 2 Mar 2004 05:01:19 +0000 (05:01 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Tue, 2 Mar 2004 05:01:19 +0000 (05:01 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@834 f882894a-f735-0410-b71e-b25c423dba1c
AUTHORS | patch | blob | history | |
plugins/check_swap.c | patch | blob | history |
index 5c8844f4a9a02845b0da987e28aa23df01f5416e..65f96474929c8a3556d7a5884f9014c219282fed 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
Shawn Wills
Ralph Rye
Jason Martin
-Jon Hallett
\ No newline at end of file
+Jon Hallett
+Flo Gleixner
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index fe792e87b3ece6947841d308896415ea0a9facbb..1155ed0ea44e9e76a61e9e3e64cdccea3daf2da2 100644 (file)
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- status = strdup("");
- perf = strdup("");
+ status = strdup ("");
+ perf = strdup ("");
if (process_arguments (argc, argv) != OK)
usage (_("Invalid command arguments supplied\n"));
used_swap += dskused;
free_swap += dskfree;
if (allswaps) {
- percent = 100 * (((double) dskused) / ((double) dsktotal));
+ if (dsktotal == 0)
+ percent=100.0;
+ else
+ percent = 100 * (((double) dskused) / ((double) dsktotal));
result = max_state (result, check_swap (percent, dskfree));
if (verbose)
asprintf (&status, "%s [%llu (%d%%)]", status, dskfree, 100 - percent);