summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenz Kästle <lorenz.kaestle@netways.de>2023-04-26 15:52:22 (GMT)
committerLorenz Kästle <lorenz.kaestle@netways.de>2023-04-26 16:19:23 (GMT)
commita359667f2b65c06aa60915f03bf89708132b1f8b (patch)
tree7dc9bf0f847779602f5ba931a26be9b0f78d144b
parent41fb615f3de34c3b3a344e74fd9cc24936cd58a6 (diff)
downloadmonitoring-plugins-a359667f2b65c06aa60915f03bf89708132b1f8b.tar.gz
Changing remaining sscanf format specifier to unsigned long
-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 bad5c53..069cc62 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 05f19ad..cd965e3 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");