mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-20 00:10:09 -05:00
Merge pull request #1876 from RincewindsHat/check_swap_scanf_expressions
Changing remaining sscanf format specifier to unsigned long
This commit is contained in:
commit
43131b73d6
2 changed files with 8 additions and 8 deletions
10
configure.ac
10
configure.ac
|
|
@ -1592,13 +1592,13 @@ then
|
|||
grep -E -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
|
||||
>/dev/null]
|
||||
then
|
||||
ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
|
||||
ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %lu %lu"]
|
||||
ac_cv_swap_conv=2048
|
||||
AC_MSG_RESULT([using IRIX format swap])
|
||||
|
||||
elif [$PATH_TO_SWAP -l 2>/dev/null | grep -E -i "^path +dev +swaplo +blocks +free" >/dev/null]
|
||||
then
|
||||
ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
|
||||
ac_cv_swap_format=["%*s %*[0-9,-] %*d %lu %lu"]
|
||||
ac_cv_swap_conv=2048
|
||||
AC_MSG_RESULT([using Unixware format swap])
|
||||
else
|
||||
|
|
@ -1622,7 +1622,7 @@ then
|
|||
|
||||
if [$PATH_TO_SWAPINFO -k 2>/dev/null | grep -E -i "^Device +1K-blocks +Used +Avail" >/dev/null]
|
||||
then
|
||||
ac_cv_swap_format=["%*s %f %*d %f"]
|
||||
ac_cv_swap_format=["%*s %lu %*d %lu"]
|
||||
ac_cv_swap_conv=1024
|
||||
AC_MSG_RESULT([using FreeBSD format swapinfo])
|
||||
fi
|
||||
|
|
@ -1631,7 +1631,7 @@ elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | grep -E -i "^TYPE +AVAIL +USED +FREE"
|
|||
then
|
||||
ac_cv_have_swap=yes
|
||||
ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
|
||||
ac_cv_swap_format=["%*s %f %*d %f"]
|
||||
ac_cv_swap_format=["%*s %lu %*d %lu"]
|
||||
ac_cv_swap_conv=1024
|
||||
AC_MSG_RESULT([using HP-UX format swapinfo])
|
||||
fi
|
||||
|
|
@ -1646,7 +1646,7 @@ if [$PATH_TO_LSPS -a 2>/dev/null | grep -E -i "^Page Space" > /dev/null]
|
|||
then
|
||||
ac_cv_have_swap=yes
|
||||
ac_cv_swap_command="$PATH_TO_LSPS -a"
|
||||
ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
|
||||
ac_cv_swap_format=["%*s %*s %*s %lu%*s %lu %*s"]
|
||||
ac_cv_swap_conv=1
|
||||
AC_MSG_RESULT([using AIX lsps])
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ main (int argc, char **argv)
|
|||
# ifdef _AIX
|
||||
if (!allswaps) {
|
||||
xasprintf(&swap_command, "%s", "/usr/sbin/lsps -s");
|
||||
xasprintf(&swap_format, "%s", "%f%*s %f");
|
||||
xasprintf(&swap_format, "%s", "%lu%*s %lu");
|
||||
conv_factor = 1;
|
||||
}
|
||||
# endif
|
||||
|
|
@ -205,9 +205,9 @@ main (int argc, char **argv)
|
|||
temp_buffer = strtok (input_buffer, " \n");
|
||||
while (temp_buffer) {
|
||||
if (strstr (temp_buffer, "blocks"))
|
||||
sprintf (str, "%s %s", str, "%f");
|
||||
sprintf (str, "%s %s", str, "%lu");
|
||||
else if (strstr (temp_buffer, "dskfree"))
|
||||
sprintf (str, "%s %s", str, "%f");
|
||||
sprintf (str, "%s %s", str, "%lu");
|
||||
else
|
||||
sprintf (str, "%s %s", str, "%*s");
|
||||
temp_buffer = strtok (NULL, " \n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue