summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwaja <waja@users.noreply.github.com>2023-07-24 17:35:04 +0200
committerGitHub <noreply@github.com>2023-07-24 17:35:04 +0200
commitf39211c26408af582121f519d89c8abf70e6d437 (patch)
tree8e3b4a532717659649954b879fb685fce353e863
parentaf06d34071608641295eecd46edb0c4dbde13872 (diff)
parent43131b73d69e77a3faee69814dac1bbc88162887 (diff)
downloadmonitoring-plugins-f39211c.tar.gz
Merge pull request #107 from monitoring-plugins/master
[pull] master from monitoring-plugins:master
-rw-r--r--configure.ac10
-rw-r--r--plugins/check_swap.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index bad5c53c..069cc625 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1592,13 +1592,13 @@ then
1592 grep -E -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \ 1592 grep -E -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
1593 >/dev/null] 1593 >/dev/null]
1594 then 1594 then
1595 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"] 1595 ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %lu %lu"]
1596 ac_cv_swap_conv=2048 1596 ac_cv_swap_conv=2048
1597 AC_MSG_RESULT([using IRIX format swap]) 1597 AC_MSG_RESULT([using IRIX format swap])
1598 1598
1599 elif [$PATH_TO_SWAP -l 2>/dev/null | grep -E -i "^path +dev +swaplo +blocks +free" >/dev/null] 1599 elif [$PATH_TO_SWAP -l 2>/dev/null | grep -E -i "^path +dev +swaplo +blocks +free" >/dev/null]
1600 then 1600 then
1601 ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"] 1601 ac_cv_swap_format=["%*s %*[0-9,-] %*d %lu %lu"]
1602 ac_cv_swap_conv=2048 1602 ac_cv_swap_conv=2048
1603 AC_MSG_RESULT([using Unixware format swap]) 1603 AC_MSG_RESULT([using Unixware format swap])
1604 else 1604 else
@@ -1622,7 +1622,7 @@ then
1622 1622
1623 if [$PATH_TO_SWAPINFO -k 2>/dev/null | grep -E -i "^Device +1K-blocks +Used +Avail" >/dev/null] 1623 if [$PATH_TO_SWAPINFO -k 2>/dev/null | grep -E -i "^Device +1K-blocks +Used +Avail" >/dev/null]
1624 then 1624 then
1625 ac_cv_swap_format=["%*s %f %*d %f"] 1625 ac_cv_swap_format=["%*s %lu %*d %lu"]
1626 ac_cv_swap_conv=1024 1626 ac_cv_swap_conv=1024
1627 AC_MSG_RESULT([using FreeBSD format swapinfo]) 1627 AC_MSG_RESULT([using FreeBSD format swapinfo])
1628 fi 1628 fi
@@ -1631,7 +1631,7 @@ elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | grep -E -i "^TYPE +AVAIL +USED +FREE"
1631then 1631then
1632 ac_cv_have_swap=yes 1632 ac_cv_have_swap=yes
1633 ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM" 1633 ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
1634 ac_cv_swap_format=["%*s %f %*d %f"] 1634 ac_cv_swap_format=["%*s %lu %*d %lu"]
1635 ac_cv_swap_conv=1024 1635 ac_cv_swap_conv=1024
1636 AC_MSG_RESULT([using HP-UX format swapinfo]) 1636 AC_MSG_RESULT([using HP-UX format swapinfo])
1637fi 1637fi
@@ -1646,7 +1646,7 @@ if [$PATH_TO_LSPS -a 2>/dev/null | grep -E -i "^Page Space" > /dev/null]
1646then 1646then
1647 ac_cv_have_swap=yes 1647 ac_cv_have_swap=yes
1648 ac_cv_swap_command="$PATH_TO_LSPS -a" 1648 ac_cv_swap_command="$PATH_TO_LSPS -a"
1649 ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"] 1649 ac_cv_swap_format=["%*s %*s %*s %lu%*s %lu %*s"]
1650 ac_cv_swap_conv=1 1650 ac_cv_swap_conv=1
1651 AC_MSG_RESULT([using AIX lsps]) 1651 AC_MSG_RESULT([using AIX lsps])
1652fi 1652fi
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 05f19ad4..cd965e31 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -178,7 +178,7 @@ main (int argc, char **argv)
178# ifdef _AIX 178# ifdef _AIX
179 if (!allswaps) { 179 if (!allswaps) {
180 xasprintf(&swap_command, "%s", "/usr/sbin/lsps -s"); 180 xasprintf(&swap_command, "%s", "/usr/sbin/lsps -s");
181 xasprintf(&swap_format, "%s", "%f%*s %f"); 181 xasprintf(&swap_format, "%s", "%lu%*s %lu");
182 conv_factor = 1; 182 conv_factor = 1;
183 } 183 }
184# endif 184# endif
@@ -205,9 +205,9 @@ main (int argc, char **argv)
205 temp_buffer = strtok (input_buffer, " \n"); 205 temp_buffer = strtok (input_buffer, " \n");
206 while (temp_buffer) { 206 while (temp_buffer) {
207 if (strstr (temp_buffer, "blocks")) 207 if (strstr (temp_buffer, "blocks"))
208 sprintf (str, "%s %s", str, "%f"); 208 sprintf (str, "%s %s", str, "%lu");
209 else if (strstr (temp_buffer, "dskfree")) 209 else if (strstr (temp_buffer, "dskfree"))
210 sprintf (str, "%s %s", str, "%f"); 210 sprintf (str, "%s %s", str, "%lu");
211 else 211 else
212 sprintf (str, "%s %s", str, "%*s"); 212 sprintf (str, "%s %s", str, "%*s");
213 temp_buffer = strtok (NULL, " \n"); 213 temp_buffer = strtok (NULL, " \n");