summaryrefslogtreecommitdiffstats
path: root/plugins/check_swap.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2023-09-20 08:16:11 +0200
committerGitHub <noreply@github.com>2023-09-20 08:16:11 +0200
commita5ba424f85153b1ddaaf5e5269c82f0f049828d0 (patch)
treeb9c158930159f2ab1ea2eb45e9e19ccdd0fbb76b /plugins/check_swap.c
parenta99db0243baa5d208c5d500a9bde86b4619cec92 (diff)
parent220455a11e8f1dd3a86ac4725cf0c799c8e3b21b (diff)
downloadmonitoring-plugins-a5ba424f85153b1ddaaf5e5269c82f0f049828d0.tar.gz
Merge branch 'master' into master
Diffstat (limited to 'plugins/check_swap.c')
-rw-r--r--plugins/check_swap.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index a607da1e..cd965e31 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -34,9 +34,6 @@ const char *email = "devel@monitoring-plugins.org";
34#include "common.h" 34#include "common.h"
35#include "popen.h" 35#include "popen.h"
36#include "utils.h" 36#include "utils.h"
37#include <string.h>
38#include <math.h>
39#include <libintl.h>
40 37
41#ifdef HAVE_DECL_SWAPCTL 38#ifdef HAVE_DECL_SWAPCTL
42# ifdef HAVE_SYS_PARAM_H 39# ifdef HAVE_SYS_PARAM_H
@@ -181,7 +178,7 @@ main (int argc, char **argv)
181# ifdef _AIX 178# ifdef _AIX
182 if (!allswaps) { 179 if (!allswaps) {
183 xasprintf(&swap_command, "%s", "/usr/sbin/lsps -s"); 180 xasprintf(&swap_command, "%s", "/usr/sbin/lsps -s");
184 xasprintf(&swap_format, "%s", "%f%*s %f"); 181 xasprintf(&swap_format, "%s", "%lu%*s %lu");
185 conv_factor = 1; 182 conv_factor = 1;
186 } 183 }
187# endif 184# endif
@@ -208,9 +205,9 @@ main (int argc, char **argv)
208 temp_buffer = strtok (input_buffer, " \n"); 205 temp_buffer = strtok (input_buffer, " \n");
209 while (temp_buffer) { 206 while (temp_buffer) {
210 if (strstr (temp_buffer, "blocks")) 207 if (strstr (temp_buffer, "blocks"))
211 sprintf (str, "%s %s", str, "%f"); 208 sprintf (str, "%s %s", str, "%lu");
212 else if (strstr (temp_buffer, "dskfree")) 209 else if (strstr (temp_buffer, "dskfree"))
213 sprintf (str, "%s %s", str, "%f"); 210 sprintf (str, "%s %s", str, "%lu");
214 else 211 else
215 sprintf (str, "%s %s", str, "%*s"); 212 sprintf (str, "%s %s", str, "%*s");
216 temp_buffer = strtok (NULL, " \n"); 213 temp_buffer = strtok (NULL, " \n");
@@ -555,7 +552,7 @@ validate_arguments (void)
555 } 552 }
556 else if ((warn.is_percentage == crit.is_percentage) && (warn.value < crit.value)) { 553 else if ((warn.is_percentage == crit.is_percentage) && (warn.value < crit.value)) {
557 /* This is NOT triggered if warn and crit are different units, e.g warn is percentage 554 /* This is NOT triggered if warn and crit are different units, e.g warn is percentage
558 * and crit is absolut. We cannot determine the condition at this point since we 555 * and crit is absolute. We cannot determine the condition at this point since we
559 * dont know the value of total swap yet 556 * dont know the value of total swap yet
560 */ 557 */
561 usage4(_("Warning should be more than critical")); 558 usage4(_("Warning should be more than critical"));