summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2004-08-23 21:18:12 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2004-08-23 21:18:12 (GMT)
commit33cffe8f87e58de3e38e9146584fb05371eb7de3 (patch)
tree8eb398d18ee7738fb226e305ff476d9aa2dacd55 /configure.in
parentd5ae799b8792708cad68d57c966b562dc442dccd (diff)
downloadmonitoring-plugins-33cffe8f87e58de3e38e9146584fb05371eb7de3.tar.gz
Using swapctl for Solaris, Tru64 and *BSD (Sean Finney)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@891 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in115
1 files changed, 75 insertions, 40 deletions
diff --git a/configure.in b/configure.in
index 3154af0..8e971dd 100644
--- a/configure.in
+++ b/configure.in
@@ -1303,18 +1303,16 @@ then
1303 ac_cv_swap_conv=2048 1303 ac_cv_swap_conv=2048
1304 AC_MSG_RESULT([using IRIX format swap]) 1304 AC_MSG_RESULT([using IRIX format swap])
1305 1305
1306 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
1307 then
1308 ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
1309 ac_cv_swap_conv=2048
1310 AC_MSG_RESULT([using Solaris format swap])
1311
1312 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null] 1306 elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
1313 then 1307 then
1314 ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"] 1308 ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
1315 ac_cv_swap_conv=2048 1309 ac_cv_swap_conv=2048
1316 AC_MSG_RESULT([using Unixware format swap]) 1310 AC_MSG_RESULT([using Unixware format swap])
1317 1311 else
1312 dnl if we don't know what format swap's output is
1313 dnl we might as well pretend we didn't see it
1314 ac_cv_have_swap=""
1315 ac_cv_swap_command=""
1318 fi 1316 fi
1319fi 1317fi
1320dnl end if for PATH_TO_SWAP 1318dnl end if for PATH_TO_SWAP
@@ -1362,46 +1360,83 @@ fi
1362dnl end if for PATH_TO_SWAPINFO 1360dnl end if for PATH_TO_SWAPINFO
1363fi 1361fi
1364 1362
1365AC_PATH_PROG(PATH_TO_SWAPCTL,swapctl,,[$PATH:/sbin]) 1363dnl
1366if (test -n "$PATH_TO_SWAPCTL") 1364dnl test for swapctl system call, both the 2-arg and 3-arg variants
1367then 1365dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
1368AC_MSG_CHECKING([for $PATH_TO_SWAPCTL format]) 1366dnl in the various BSD's
1369if [$PATH_TO_SWAPCTL -l 2>&1 >/dev/null] 1367dnl
1368
1369AC_CHECK_HEADERS([sys/swap.h sys/stat.h sys/param.h])
1370AC_CHECK_DECLS([swapctl],,,[
1371 #include <unistd.h>
1372 #include <sys/types.h>
1373 #include <sys/stat.h>
1374 #include <sys/swap.h>
1375 ])
1376AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
1377 #include <sys/types.h>
1378 #include <sys/stat.h>
1379 #include <sys/swap.h>
1380 ])
1381AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
1382 #include <unistd.h>
1383 #include <sys/types.h>
1384 #include <sys/stat.h>
1385 #include <sys/swap.h>
1386 ])
1387
1388if test "$ac_cv_have_decl_swapctl" = "yes";
1370then 1389then
1371 ac_cv_have_swap=yes 1390 EXTRAS="$EXTRAS check_swap"
1372 ac_cv_swap_command="$PATH_TO_SWAPCTL -l" 1391 AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
1373 if [$PATH_TO_SWAPCTL -l 2>/dev/null | \ 1392 if test "$ac_cv_type_swaptbl_t" = "yes" -a \
1374 egrep -i "^Device +1K-blocks +Used +Avail +Capacity +Priority" >/dev/null ] 1393 "$ac_cv_type_swapent_t" = "yes";
1375 then 1394 then
1376 ac_cv_swap_format=["%*s %llu %*d %llu %*d"] 1395 AC_MSG_RESULT([yes])
1377 ac_cv_swap_conv=1024 1396 ac_cv_check_swap_swapctl_svr4="1";
1378 AC_MSG_RESULT([using 1K BSD format swapctl]) 1397 AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
1379 1398 [Define if 2-argument SVR4 swapctl exists])
1380 elif [$PATH_TO_SWAPCTL -l 2>/dev/null | \ 1399 else
1381 egrep -i "^Device +512-blocks +Used +Avail +Capacity +Priority" >/dev/null ] 1400 AC_MSG_RESULT([no])
1401 AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
1402 if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
1403 then
1404 AC_MSG_RESULT([yes])
1405 AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
1406 [Define if 3-argument BSD swapctl exists])
1407 else
1408 AC_MSG_RESULT([no])
1409 fi
1410 fi
1411 AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
1412 if test "$ac_cv_check_swap_swapctl_svr4" = "1";
1382 then 1413 then
1383 ac_cv_swap_format=["%*s %llu %*d %llu %*d"] 1414 dnl
1415 dnl the SVR4 spec returns values in pages
1416 dnl
1417 AC_MSG_RESULT([page])
1418 AC_CHECK_DECLS([sysconf])
1419 AC_MSG_CHECKING([for system page size])
1420 if test "$ac_cv_have_decl_sysconf" = "yes";
1421 then
1422 AC_MSG_RESULT([determined by sysconf(3)])
1423 ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
1424 else
1425 AC_MSG_WARN([don't know. guessing 4096k])
1426 ac_cv_swap_conv=256
1427 fi
1428 else
1429 dnl
1430 dnl the BSD spec returns values in blocks
1431 dnl
1432 AC_MSG_RESULT([blocks (assuming 512b)])
1384 ac_cv_swap_conv=2048 1433 ac_cv_swap_conv=2048
1385 AC_MSG_RESULT([using 512 byte BSD format swapctl])
1386 fi 1434 fi
1435 AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
1436 [Conversion factor to MB])
1387fi 1437fi
1388dnl end if for PATH_TO_SWAPCTL
1389fi
1390
1391dnl
1392dnl test for swapctl system call, as found in tru64 and solaris
1393dnl note: the way the ifdef logic in check_swap is right now,
1394dnl this will only affect systems that don't pass one of the
1395dnl earlier tests.
1396dnl
1397AC_CHECK_HEADERS([sys/swap.h sys/stat.h sys/param.h])
1398AC_CHECK_DECLS([swapctl],,,[
1399 #include <sys/types.h>
1400 #include <sys/stat.h>
1401 #include <sys/swap.h>
1402 ])
1403dnl 1438dnl
1404dnl end test for swapctl system call 1439dnl end tests for the swapctl system calls
1405dnl 1440dnl
1406 1441
1407 1442