From: Subhendu Ghosh Date: Tue, 18 Feb 2003 03:17:37 +0000 (+0000) Subject: regex fix to catch *BSD swapinfo and not HP-UX error and memory/file swap in addition... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2d3e6c49ad8de1a9fb466b59c1b5b69405c39aa8;p=nagiosplug.git regex fix to catch *BSD swapinfo and not HP-UX error and memory/file swap in addition to device for HP-UX git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@333 f882894a-f735-0410-b71e-b25c423dba1c --- diff --git a/configure.in b/configure.in index c9a9615..dc5f281 100644 --- a/configure.in +++ b/configure.in @@ -871,6 +871,10 @@ else echo "** Could not find mailq or eqivalent" fi +dnl SWAP info required is amount allocated/available and amount free +dnl The plugin works through all the swap devices and adds up the total swap +dnl available. + dnl dunno why this does not work below - use hack (kbd) dnl fine on linux, broken on solaris dnl if /bin/test -e "/proc/meminfo" @@ -901,7 +905,7 @@ then echo " using Solaris format" fi EXTRAS="$EXTRAS check_swap" -elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null] +elif [swapinfo -k 2>&1 | egrep -i "^Device" >/dev/null] then echo "found swapinfo command" AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found]) @@ -913,11 +917,11 @@ then echo " using FreeBSD format" fi EXTRAS="$EXTRAS check_swap" -elif [swapinfo -d 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null] +elif [swapinfo -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null] then AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found]) AC_PATH_PROG(PATH_TO_SWAP,swapinfo) - AC_DEFINE_UNQUOTED(SWAP_COMMAND,"/bin/sh '$PATH_TO_SWAP -d | /bin/tail -l +2'",[Path to swap/swapinfo binary, with any args]) + AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -dfM",[Path to swap/swapinfo binary, with any args]) AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"],[Format string for parsing swap output ]) echo " using HP-UX format HP-UX" fi