4
0

configure.in 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_REVISION ($Revision$)
  3. AC_PREREQ(2.50)
  4. AC_INIT(nagios-plugins,1.3.99)
  5. AC_CONFIG_SRCDIR(Helper.pm)
  6. AM_INIT_AUTOMAKE
  7. AM_CONFIG_HEADER(plugins/config.h)
  8. AC_CANONICAL_HOST
  9. RELEASE=1
  10. AC_SUBST(RELEASE)
  11. AC_PREFIX_DEFAULT(/usr/local/nagios)
  12. dnl Figure out how to invoke "install" and what install options to use.
  13. AC_PROG_INSTALL
  14. AC_SUBST(INSTALL)
  15. AC_GNU_SOURCE
  16. AC_PROG_CC
  17. AC_PROG_CPP
  18. AC_PROG_GCC_TRADITIONAL
  19. AC_PROG_RANLIB
  20. AC_AIX
  21. AC_MINIX
  22. AC_PROG_MAKE_SET
  23. AC_PROG_AWK
  24. AC_FUNC_GETLOADAVG($topdir/lib)
  25. ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
  26. dnl AM_WITH_REGEX
  27. PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
  28. AC_SUBST(PLUGIN_TEST)dnl
  29. SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
  30. AC_SUBST(SCRIPT_TEST)dnl
  31. WARRANTY="The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n"
  32. AC_SUBST(WARRANTY)
  33. SUPPORT="Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n"
  34. AC_SUBST(SUPPORT)
  35. dnl CGIURL has changed for Nagios with 1.0 beta
  36. AC_ARG_WITH(cgiurl,
  37. ACX_HELP_STRING([--with-cgiurl=DIR],
  38. [sets URL for cgi programs]),
  39. with_cgiurl=$withval,
  40. with_cgiurl=/nagios/cgi-bin)
  41. CGIURL="$with_cgiurl"
  42. AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
  43. AC_ARG_WITH(nagios_user,
  44. ACX_HELP_STRING([--with-nagios-user=USER],
  45. [set user name to run nagios]),
  46. with_nagios_user=$withval,
  47. with_nagios_user=nagios)
  48. AC_ARG_WITH(nagios_group,
  49. ACX_HELP_STRING([--with-nagios-group=GROUP],
  50. [set group name to run nagios]),
  51. with_nagios_group=$withval,
  52. with_nagios_group=nagios)
  53. AC_SUBST(with_nagios_user)
  54. AC_SUBST(with_nagios_group)
  55. INSTALL_OPTS="-o $with_nagios_user -g $with_nagios_group"
  56. AC_SUBST(INSTALL_OPTS)
  57. AC_ARG_WITH(trusted_path,
  58. ACX_HELP_STRING([--with-trusted-path=PATH],
  59. [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]),
  60. with_trusted_path=$withval,
  61. with_trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
  62. AC_SUBST(with_trusted_path)
  63. EXTRAS=
  64. dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
  65. LDFLAGS="$LDFLAGS -L."
  66. ac_cv_uname_m=`uname -m`
  67. ac_cv_uname_s=`uname -s`
  68. ac_cv_uname_r=`uname -r`
  69. ac_cv_uname_v=`uname -v`
  70. PKG_ARCH=`uname -p`
  71. REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
  72. REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
  73. AC_SUBST(PKG_ARCH)
  74. AC_SUBST(REV_DATESTAMP)
  75. AC_SUBST(REV_TIMESTAMP)
  76. dnl Checks for programs.
  77. AC_PATH_PROG(PYTHON,python)
  78. AC_PATH_PROG(PERL,perl)
  79. AC_PATH_PROG(SH,sh)
  80. AC_PATH_PROG(HOSTNAME,hostname)
  81. AC_PATH_PROG(BASENAME,basename)
  82. dnl
  83. dnl Check for miscellaneous stuff
  84. dnl
  85. case $host_vender-$host_os in
  86. sun*)
  87. AC_DEFINE(__EXTENSIONS__,1,[Sun's netdb.h needs this for getaddrinfo])
  88. ;;
  89. osf*)
  90. AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
  91. ;;
  92. esac
  93. dnl
  94. dnl Checks for libraries.
  95. dnl
  96. AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
  97. AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
  98. AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
  99. AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
  100. AC_SUBST(SOCKETLIBS)
  101. dnl Check for PostgreSQL libraries
  102. _SAVEDLIBS="$LIBS"
  103. _SAVEDCPPFLAGS="$CPPFLAGS"
  104. AC_ARG_WITH(pgsql,
  105. ACX_HELP_STRING([--with-pgsql=DIR],
  106. [sets path to pgsql installation]),
  107. PGSQL=$withval,)
  108. AC_CHECK_LIB(crypt,main)
  109. if test "$ac_cv_lib_crypt_main" = "yes"; then
  110. if test -n "$PGSQL"; then
  111. LDFLAGS="$LDFLAGS -L$PGSQL/lib"
  112. CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
  113. fi
  114. AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
  115. if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
  116. AC_CHECK_HEADERS(pgsql/libpq-fe.h)
  117. AC_CHECK_HEADERS(postgresql/libpq-fe.h)
  118. AC_CHECK_HEADERS(libpq-fe.h)
  119. if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
  120. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  121. PGINCLUDE="-I$PGSQL/include"
  122. elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
  123. PGLIBS="-lpq -lcrypt"
  124. PGINCLUDE="-I/usr/include/pgsql"
  125. elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
  126. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  127. PGINCLUDE="-I/usr/include/postgresql"
  128. elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
  129. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  130. PGINCLUDE="-I$PGSQL/include"
  131. fi
  132. if test -z "$PGINCLUDE"; then
  133. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  134. AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
  135. else
  136. AC_SUBST(PGLIBS)
  137. AC_SUBST(PGINCLUDE)
  138. EXTRAS="$EXTRAS check_pgsql"
  139. fi
  140. else
  141. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  142. AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
  143. AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
  144. fi
  145. else
  146. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  147. AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
  148. fi
  149. LIBS="$_SAVEDLIBS"
  150. CPPFLAGS="$_SAVEDCPPFLAGS"
  151. dnl Check for radius libraries
  152. _SAVEDLIBS="$LIBS"
  153. AC_CHECK_LIB(radiusclient,rc_read_config)
  154. if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
  155. EXTRAS="$EXTRAS check_radius"
  156. RADIUSLIBS="-lradiusclient"
  157. AC_SUBST(RADIUSLIBS)
  158. else
  159. AC_MSG_WARN([Skipping radius plugin])
  160. AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
  161. fi
  162. LIBS="$_SAVEDLIBS"
  163. dnl Check for LDAP libraries
  164. _SAVEDLIBS="$LIBS"
  165. AC_CHECK_LIB(ldap,main,,,-llber)
  166. if test "$ac_cv_lib_ldap_main" = "yes"; then
  167. LDAPLIBS="-lldap -llber"\
  168. LDAPINCLUDE="-I/usr/include/ldap"
  169. AC_SUBST(LDAPLIBS)
  170. AC_SUBST(LDAPINCLUDE)
  171. AC_CHECK_FUNCS(ldap_set_option)
  172. EXTRAS="$EXTRAS check_ldap"
  173. else
  174. AC_MSG_WARN([Skipping LDAP plugin])
  175. AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
  176. fi
  177. LIBS="$_SAVEDLIBS"
  178. dnl Check for mysql libraries
  179. _SAVEDLIBS="$LIBS"
  180. _SAVEDCPPFLAGS="$CPPFLAGS"
  181. AC_ARG_WITH(mysql,
  182. ACX_HELP_STRING([--with-mysql=DIR],
  183. [sets path to mysql installation (assumes lib/mysql and include subdirs]),
  184. MYSQL=$withval,)
  185. if test -n "$MYSQL"; then
  186. MYSQLLIBDIR=$MYSQL/lib/mysql
  187. CPPFLAGS="-I$MYSQL/include"
  188. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz)
  189. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  190. elif test -f /usr/lib/libmysqlclient.so; then
  191. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
  192. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  193. elif test -f /usr/lib/libmysqlclient.a; then
  194. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
  195. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  196. elif test -f /usr/lib/mysql/libmysqlclient.so; then
  197. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
  198. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
  199. elif test -f /usr/lib/mysql/libmysqlclient.a; then
  200. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
  201. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
  202. fi
  203. if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
  204. AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" )
  205. if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
  206. EXTRAS="$EXTRAS check_mysql"
  207. AC_SUBST(MYSQLINCLUDE)
  208. AC_SUBST(MYSQLLIBS)
  209. AC_SUBST(check_mysql_LDFLAGS)
  210. else
  211. AC_MSG_WARN([Skipping mysql plugin])
  212. AC_MSG_WARN([install mysql client headers to compile this plugin (see REQUIREMENTS).])
  213. fi
  214. else
  215. AC_MSG_WARN([Skipping mysql plugin])
  216. AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
  217. fi
  218. CPPFLAGS="$_SAVEDCPPFLAGS"
  219. LIBS="$_SAVEDLIBS"
  220. dnl Check for OpenSSL location
  221. AC_PATH_PROG(OPENSSL,openssl)
  222. if test "$OPENSSL" = "/usr/bin/openssl"; then
  223. OPENSSL=/usr
  224. elif test "$OPENSSL" = "/usr/sbin/openssl"; then
  225. OPENSSL=/usr
  226. elif test "$OPENSSL" = "/opt/bin/openssl"; then
  227. OPENSSL=/opt
  228. elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
  229. OPENSSL=/opt/openssl
  230. elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
  231. OPENSSL=/usr/slocal
  232. elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
  233. OPENSSL=/usr/local
  234. elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
  235. OPENSSL=/usr/local/ssl
  236. fi
  237. AC_ARG_WITH(openssl,
  238. ACX_HELP_STRING([--with-openssl=DIR],
  239. [sets path to openssl installation]),
  240. OPENSSL=$withval,)
  241. AC_CHECK_HEADERS(unistd.h)
  242. dnl Check for AF_INET6 support - unistd.h required for Darwin
  243. AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
  244. AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
  245. #include <unistd.h>
  246. #endif
  247. #include <netinet/in.h>
  248. #include <sys/socket.h>],
  249. [struct sockaddr_in6 sin6;
  250. void *p;
  251. sin6.sin6_family = AF_INET6;
  252. sin6.sin6_port = 587;
  253. p = &sin6.sin6_addr;],
  254. [with_ipv6=yes],
  255. [with_ipv6=no])
  256. ])
  257. if test x"$with_ipv6" != xno ; then
  258. AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
  259. fi
  260. dnl #########################################################################
  261. dnl Check if Posix getaddrinfo() is available. It is also possible to use
  262. dnl the version from the lwres library distributed with BIND.
  263. dnl #########################################################################
  264. AC_ARG_ENABLE([emulate-getaddrinfo],
  265. ACX_HELP_STRING([--enable-emulate-getaddrinfo],
  266. [enable getaddrinfo emulation (default=no)]),
  267. ,
  268. enable_emulate_getaddrinfo=no)
  269. AC_ARG_WITH(lwres,
  270. ACX_HELP_STRING([--with-lwres=DIR],
  271. [use lwres library for getaddrinfo (default=no)]),
  272. ,
  273. with_lwres=no)
  274. dnl ## enable force to test getaddrinfo.c
  275. if test x$enable_emulate_getaddrinfo = xforce ; then
  276. enable_emulate_getaddrinfo=yes
  277. have_getaddrinfo=no
  278. else
  279. have_getaddrinfo=no
  280. if test x$with_lwres != xno ; then
  281. if test "$with_lwres" != yes ; then
  282. CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
  283. LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
  284. fi
  285. AC_CHECK_HEADERS(lwres/netdb.h, ,
  286. [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
  287. AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
  288. [AC_MSG_ERROR([cannot find the lwres library])],
  289. -lnsl -lpthread)
  290. have_getaddrinfo=yes
  291. fi
  292. if test x$have_getaddrinfo != xyes ; then
  293. AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
  294. fi
  295. dnl # Special nonsense for systems that actually have getaddrinfo but
  296. dnl # redefine the name to something else, e.g. OSF
  297. if test x$have_getaddrinfo != xyes ; then
  298. AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
  299. AC_TRY_LINK([
  300. # include <netdb.h>
  301. ], [
  302. struct addrinfo hints, *res;
  303. int err;
  304. err = getaddrinfo ("host", "service", &hints, &res);
  305. ], [
  306. have_getaddrinfo=yes
  307. AC_MSG_RESULT(yes)
  308. ], [AC_MSG_RESULT(no)])
  309. fi
  310. fi
  311. if test x$have_getaddrinfo != xno ; then
  312. if test x$enable_emulate_getaddrinfo != xno ; then
  313. AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
  314. fi
  315. AC_DEFINE(HAVE_GETADDRINFO, 1,
  316. [Does system provide RFC 2553/Posix getaddrinfo?])
  317. else
  318. if test x$enable_emulate_getaddrinfo != xyes ; then
  319. dnl AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
  320. enable_emulate_getaddrinfo=yes
  321. AC_MSG_WARN([enabling getaddrinfo emulation])
  322. fi
  323. EXTRA_NETOBJS="$EXTRA_NETOBJS getaddrinfo.o"
  324. fi
  325. if test x"$enable_emulate_getaddrinfo" != xno ; then
  326. have_resolver=no
  327. dnl Try for getipnodebyname
  328. AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
  329. if test x"$have_resolver" != xno ; then
  330. AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
  331. [Set when getipnodebyname is available])
  332. fi
  333. dnl Try for gethostbyname_r
  334. if test x"$have_resolver" = xno ; then
  335. AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
  336. [have_resolver=yes
  337. ACX_WHICH_GETHOSTBYNAME_R])
  338. fi
  339. dnl Try for gethostbyname
  340. if test x"$have_resolver" = xno ; then
  341. if test x"$enable_pthreads" != xno ; then
  342. AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
  343. fi
  344. AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
  345. [AC_MSG_ERROR([cannot find gethostbyname])])
  346. fi
  347. EXTRA_NETOBJS="$EXTRA_NETOBJS gethostbyname.o"
  348. fi
  349. AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
  350. if test "$FOUNDINCLUDE" = "no"; then
  351. _SAVEDCPPFLAGS="$CPPFLAGS"
  352. CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
  353. unset ac_cv_header_krb5_h
  354. AC_CHECK_HEADERS(krb5.h,
  355. KRB5INCLUDE="-I/usr/kerberos/include"
  356. FOUNDINCLUDE=yes,
  357. FOUNDINCLUDE=no)
  358. fi
  359. AC_SUBST(KRBINCLUDE)
  360. if test "$FOUNDINCLUDE" = "no"; then
  361. CPPFLAGS="$_SAVEDCPPFLAGS"
  362. fi
  363. dnl Check for OpenSSL header files
  364. unset FOUNDINCLUDE
  365. _SAVEDCPPFLAGS="$CPPFLAGS"
  366. CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
  367. AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
  368. SSLINCLUDE="-I$OPENSSL/include"
  369. FOUNDINCLUDE=yes,
  370. FOUNDINCLUDE=no)
  371. if test "$FOUNDINCLUDE" = "no"; then
  372. AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
  373. SSLINCLUDE="-I$OPENSSL/include"
  374. FOUNDINCLUDE=yes,
  375. FOUNDINCLUDE=no)
  376. fi
  377. AC_SUBST(SSLINCLUDE)
  378. if test "$FOUNDINCLUDE" = "no"; then
  379. CPPFLAGS="$_SAVEDCPPFLAGS"
  380. fi
  381. dnl Check for crypto lib
  382. _SAVEDLIBS="$LIBS"
  383. AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
  384. if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
  385. dnl Check for SSL lib
  386. AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto",AC_CHECK_LIB(ssl,main,LDFLAGS="$LDFLAGS -L$OPENSSL/lib" SSLLIBS="-lssl -lcrypto"),-L$OPENSSL/lib -lcrypto)
  387. fi
  388. LIBS="$_SAVEDLIBS"
  389. dnl test headers and libs to decide whether check_http should use SSL
  390. if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
  391. if test "$ac_cv_lib_ssl_main" = "yes"; then
  392. if test "$FOUNDINCLUDE" = "yes"; then
  393. check_tcp_ssl="check_simap check_spop"
  394. AC_SUBST(check_tcp_ssl)
  395. AC_SUBST(SSLLIBS)
  396. AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
  397. fi
  398. fi
  399. fi
  400. CPPFLAGS="$_SAVEDCPPFLAGS"
  401. dnl
  402. dnl Checks for header files.
  403. dnl
  404. AC_HEADER_STDC
  405. AC_HEADER_TIME
  406. AC_HEADER_SYS_WAIT
  407. AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h)
  408. AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h)
  409. AC_CHECK_HEADERS(limits.h sys/param.h sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h fcntl.h sys/statfs.h sys/dustat.h sys/statvfs.h)
  410. # glibc 2.3.2 stdlib.h does not define HUGE_VAL (see man strtod)
  411. AC_MSG_CHECKING([for HUGE_VAL in <stdlib.h>])
  412. AC_TRY_COMPILE([#include <stdlib.h>],
  413. [double x = HUGE_VAL;],
  414. [AC_MSG_RESULT(yes)],
  415. [AC_MSG_RESULT(no)
  416. AC_MSG_CHECKING([for HUGE_VAL in <math.h>])
  417. AC_TRY_COMPILE([#include <math.h>],
  418. [double x = HUGE_VAL;],
  419. [AC_MSG_RESULT(yes)
  420. AC_DEFINE_UNQUOTED(HUGE_VAL_NEEDS_MATH_H, 1,
  421. [Define if <math.h> is required for HUGE_VAL])],
  422. [AC_MSG_RESULT(no)])])
  423. # Define HAVE_INTTYPES_H if <inttypes.h> exists,
  424. # doesn't clash with <sys/types.h>, and declares uintmax_t.
  425. AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
  426. [AC_TRY_COMPILE(
  427. [#include <sys/types.h>
  428. #include <inttypes.h>],
  429. [uintmax_t i = (uintmax_t) -1;],
  430. jm_ac_cv_header_inttypes_h=yes,
  431. jm_ac_cv_header_inttypes_h=no)])
  432. if test $jm_ac_cv_header_inttypes_h = yes; then
  433. AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
  434. [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
  435. and declares uintmax_t. ])
  436. fi
  437. # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
  438. # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
  439. # enable the work-around code in fsusage.c.
  440. AC_MSG_CHECKING([for statfs that truncates block counts])
  441. AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
  442. [AC_TRY_COMPILE([
  443. #if !defined(sun) && !defined(__sun)
  444. choke -- this is a workaround for a Sun-specific problem
  445. #endif
  446. #include <sys/types.h>
  447. #include <sys/vfs.h>],
  448. [struct statfs t; long c = *(t.f_spare);],
  449. fu_cv_sys_truncating_statfs=yes
  450. AC_MSG_RESULT(yes),
  451. fu_cv_sys_truncating_statfs=no
  452. AC_MSG_RESULT(no),
  453. )])
  454. if test $fu_cv_sys_truncating_statfs = yes; then
  455. AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
  456. [ Define if the block counts reported by statfs may be truncated to 2GB
  457. and the correct values may be stored in the f_spare array.
  458. (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
  459. SunOS 4.1.1 seems not to be affected.)])
  460. fi
  461. dnl Checks for typedefs, structures, and compiler characteristics.
  462. AC_C_CONST
  463. AC_STRUCT_TM
  464. AC_TYPE_PID_T
  465. AC_TYPE_SIZE_T
  466. AC_TYPE_SIGNAL
  467. AC_CHECK_SIZEOF(int,cross)
  468. AC_CHECK_SIZEOF(long,cross)
  469. AC_CHECK_SIZEOF(short,cross)
  470. AC_CACHE_CHECK([for long long],ac_cv_have_longlong,[
  471. AC_TRY_RUN([#include <stdio.h>
  472. main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
  473. ac_cv_have_longlong=yes,ac_cv_have_longlong=no,ac_cv_have_longlong=cross)])
  474. if test x"$ac_cv_have_longlong" = x"yes"; then
  475. AC_DEFINE(HAVE_LONGLONG,1,[Define if system has long long type])
  476. fi
  477. #
  478. # Check if the compiler supports the LL prefix on long long integers.
  479. # AIX needs this.
  480. AC_CACHE_CHECK([for LL suffix on long long integers],ac_cv_compiler_supports_ll, [
  481. AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
  482. ac_cv_compiler_supports_ll=yes,ac_cv_compiler_supports_ll=no)])
  483. if test x"$ac_cv_compiler_supports_ll" = x"yes"; then
  484. AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Define if compiler support long long])
  485. fi
  486. AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE_VA_COPY,[
  487. AC_TRY_LINK([#include <stdarg.h>
  488. va_list ap1,ap2;], [__va_copy(ap1,ap2);],
  489. ac_cv_HAVE_VA_COPY=yes,ac_cv_HAVE_VA_COPY=no)])
  490. if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
  491. AC_DEFINE(HAVE_VA_COPY,1,[Define if system has va_copy])
  492. fi
  493. AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf)
  494. AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
  495. AC_TRY_RUN([
  496. #include <sys/types.h>
  497. #include <stdarg.h>
  498. void foo(const char *format, ...) {
  499. va_list ap;
  500. int len;
  501. char buf[5];
  502. va_start(ap, format);
  503. len = vsnprintf(buf, 0, format, ap);
  504. va_end(ap);
  505. if (len != 5) exit(1);
  506. va_start(ap, format);
  507. len = vsnprintf(0, 0, format, ap);
  508. va_end(ap);
  509. if (len != 5) exit(1);
  510. if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
  511. exit(0);
  512. }
  513. main() { foo("hello"); }
  514. ],
  515. ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)])
  516. if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
  517. AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
  518. fi
  519. AC_TRY_COMPILE([#include <sys/time.h>],
  520. [struct timeval *tv;
  521. struct timezone *tz;],
  522. AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
  523. AC_TRY_COMPILE([#include <sys/time.h>],
  524. [struct timeval *tv;
  525. struct timezone *tz;
  526. gettimeofday(tv, tz);],
  527. AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
  528. AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
  529. dnl Checks for library functions.
  530. AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul)
  531. AC_MSG_CHECKING(return type of socket size)
  532. AC_TRY_COMPILE([#include <stdlib.h>
  533. #include <sys/types.h>
  534. #include <sys/socket.h>],
  535. [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
  536. ac_cv_socket_size_type=["size_t"]
  537. AC_MSG_RESULT(size_t),
  538. ac_cv_socket_size_type=["int"]
  539. AC_MSG_RESULT(int))
  540. AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
  541. [Define type of socket size])
  542. if test -f "/proc/loadavg"
  543. then
  544. AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
  545. AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg",[Location of /proc/loadavg])
  546. fi
  547. dnl #### Process table test
  548. AC_PATH_PROG(PATH_TO_PS,ps)
  549. AC_MSG_CHECKING(for ps syntax)
  550. dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
  551. dnl STAT UCOMM VSZ RSS USER PPID COMMAND
  552. if ps -axwo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
  553. egrep -i ["^ *STAT +UCOMM +VSZ +RSS +USER +UID +PPID +COMMAND"] > /dev/null
  554. then
  555. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  556. ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid ppid vsz rss pcpu comm args'"
  557. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  558. EXTRAS="$EXTRAS check_nagios"
  559. AC_MSG_RESULT([$ac_cv_ps_command])
  560. dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
  561. elif ps -weo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
  562. egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  563. then
  564. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  565. ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid ppid vsz rss pcpu comm args'"
  566. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  567. EXTRAS="$EXTRAS check_nagios"
  568. AC_MSG_RESULT([$ac_cv_ps_command])
  569. dnl FreeBSD
  570. elif ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | \
  571. egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PPID"] >/dev/null
  572. then
  573. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  574. ac_cv_ps_command="$PATH_TO_PS waxco 'state uid ppid vsz rss pcpu command command'"
  575. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  576. EXTRAS="$EXTRAS check_nagios"
  577. AC_MSG_RESULT([$ac_cv_ps_command])
  578. dnl BSD-like mode in RH 6.1
  579. elif ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | \
  580. egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
  581. then
  582. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  583. ac_cv_ps_command="$PATH_TO_PS waxno 'state uid ppid vsz rss pcpu comm args'"
  584. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  585. EXTRAS="$EXTRAS check_nagios"
  586. AC_MSG_RESULT([$ac_cv_ps_command])
  587. dnl SunOS 4.1.3:
  588. dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
  589. elif ps -laxnwww 2>/dev/null | \
  590. egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
  591. then
  592. ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
  593. ac_cv_ps_command="$PATH_TO_PS -laxnwww"
  594. ac_cv_ps_format="%*s %d %*s %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
  595. EXTRAS="$EXTRAS check_nagios"
  596. AC_MSG_RESULT([$ac_cv_ps_command])
  597. dnl Debian Linux / procps v1.2.9:
  598. dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
  599. dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
  600. dnl
  601. elif ps laxnwww 2>/dev/null | \
  602. egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
  603. then
  604. ac_cv_ps_varlist="[&procuid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
  605. ac_cv_ps_command="$PATH_TO_PS laxnwww"
  606. ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
  607. EXTRAS="$EXTRAS check_nagios"
  608. AC_MSG_RESULT([$ac_cv_ps_command])
  609. dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
  610. elif ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
  611. egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  612. then
  613. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  614. ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid ppid vsz rss pcpu comm args'"
  615. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  616. EXTRAS="$EXTRAS check_nagios"
  617. AC_MSG_RESULT([$ac_cv_ps_command])
  618. dnl AIX 4.3.3 - needs verification. This works for Tru64 - needs %*[ +] in PS_FORMAT
  619. elif ps -ao 'stat comm vsz rss user uid ppid args' 2>/dev/null | \
  620. egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  621. then
  622. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  623. ac_cv_ps_command="$PATH_TO_PS -ao 'stat uid ppid vsz rss pcpu comm args'"
  624. ac_cv_ps_format=["%s%*[ +] %d %d %d %d %f %s %n"]
  625. EXTRAS="$EXTRAS check_nagios"
  626. AC_MSG_RESULT([$ac_cv_ps_command])
  627. elif ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | \
  628. egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  629. then
  630. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  631. ac_cv_ps_command="$PATH_TO_PS -eo 's uid ppid vsz rss pcpu comm args'"
  632. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  633. EXTRAS="$EXTRAS check_nagios"
  634. AC_MSG_RESULT([$ac_cv_ps_command])
  635. elif ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | \
  636. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
  637. then
  638. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  639. ac_cv_ps_command="$PATH_TO_PS -Ao 's uid ppid vsz rss pcpu comm args'"
  640. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  641. EXTRAS="$EXTRAS check_nagios"
  642. AC_MSG_RESULT([$ac_cv_ps_command])
  643. elif ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | \
  644. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
  645. then
  646. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  647. ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid ppid vsz rss pcpu comm args'"
  648. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  649. EXTRAS="$EXTRAS check_nagios"
  650. AC_MSG_RESULT([$ac_cv_ps_command])
  651. elif ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | \
  652. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
  653. then
  654. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  655. ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid ppid vsz rss pcpu comm args'"
  656. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  657. EXTRAS="$EXTRAS check_nagios"
  658. AC_MSG_RESULT([$ac_cv_ps_command])
  659. dnl wonder who takes state instead of stat
  660. elif ps -ao 'state command vsz rss user ppid args' 2>/dev/null | \
  661. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+"] >/dev/null
  662. then
  663. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  664. ac_cv_ps_command="$PATH_TO_PS -ao 'state uid ppid vsz rss pcpu command args'"
  665. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  666. EXTRAS="$EXTRAS check_nagios"
  667. AC_MSG_RESULT([$ac_cv_ps_command])
  668. dnl IRIX 53
  669. elif ps -el 2>/dev/null | \
  670. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  671. then
  672. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&pos,procprog]"
  673. ac_cv_ps_command="$PATH_TO_PS -el"
  674. ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
  675. AC_MSG_RESULT([$ac_cv_ps_command])
  676. dnl IRIX 63
  677. elif ps -el 2>/dev/null | \
  678. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  679. then
  680. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
  681. ac_cv_ps_command="$PATH_TO_PS -el"
  682. ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  683. AC_MSG_RESULT([$ac_cv_ps_command])
  684. dnl AIX 4.1:
  685. dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
  686. dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
  687. elif ps -el 2>/dev/null | \
  688. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  689. then
  690. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
  691. ac_cv_ps_command="$PATH_TO_PS -el"
  692. ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  693. AC_MSG_RESULT([$ac_cv_ps_command])
  694. dnl AIX?
  695. elif ps glaxen 2>/dev/null | \
  696. egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
  697. then
  698. ac_cv_ps_varlist="[&procuid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
  699. ac_cv_ps_command="$PATH_TO_PS glaxen"
  700. ac_cv_ps_format="%*s %d %*s %d %*s %*s %d %d %*s %s %*s %*s %n%s"
  701. AC_MSG_RESULT([$ac_cv_ps_command])
  702. dnl MacOSX / Darwin
  703. dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
  704. dnl Some truncation will happen in UCOMM column
  705. dnl STAT VSZ RSS UID PPID %CPU UCOMM COMMAND
  706. dnl Ss 52756 22496 501 1 6.9 Window Manager /System/Library/CoreServices/WindowServer -daemon
  707. elif ps wwaxo 'state vsz rss uid ppid pcpu ucomm command' 2>/dev/null | \
  708. egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
  709. then
  710. ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid ppid pcpu ucomm command'"
  711. ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procppid,&procpcpu,procprog,&pos]"
  712. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  713. EXTRAS="$EXTRAS check_nagios"
  714. AC_MSG_RESULT([$ac_cv_ps_command])
  715. dnl UnixWare
  716. elif ps -Al 2>/dev/null | \
  717. egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
  718. then
  719. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&pos,procprog]"
  720. ac_cv_ps_command="$PATH_TO_PS -Al"
  721. ac_cv_ps_format="%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  722. #if ps -Ao 'vsz comm' 2>/dev/null | \
  723. # egrep -i ["^ *VSZ +COMMAND"] >/dev/null
  724. #then
  725. # ac_cv_vsz_command="$PATH_TO_PS -Ao 'vsz comm'"
  726. # ac_cv_vsz_format="%*s %d"
  727. #fi
  728. AC_MSG_RESULT([$ac_cv_ps_command])
  729. else
  730. AC_MSG_WARN([unable to find usable ps syntax])
  731. fi
  732. AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
  733. [Variable list for sscanf of 'ps' output])
  734. AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
  735. [Verbatim command to execute for ps in check_procs])
  736. AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
  737. [Format string for scanning ps output in check_procs])
  738. dnl jm_AFS
  739. jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
  740. jm_FSTYPENAME
  741. jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
  742. AC_PATH_PROG(PATH_TO_PING,ping)
  743. AC_PATH_PROG(PATH_TO_PING6,ping6)
  744. AC_ARG_WITH(ping_command,
  745. ACX_HELP_STRING([--with-ping-command=SYNTAX],
  746. [sets syntax for ICMP ping]),
  747. with_ping_command=$withval,)
  748. AC_MSG_CHECKING(for ICMP ping syntax)
  749. ac_cv_ping_packets_first=no
  750. if test -n "$with_ping_command"
  751. then
  752. AC_MSG_RESULT([(command-line) $with_ping_command])
  753. if test -n "$ac_cv_ping_packets_first"
  754. then
  755. ac_cv_ping_packets_first=yes
  756. fi
  757. elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  758. $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
  759. egrep -i "^round-trip|^rtt" >/dev/null
  760. then
  761. with_ping_command="$PATH_TO_PING -n -U -c %d %s"
  762. ac_cv_ping_packets_first=yes
  763. AC_MSG_RESULT([$with_ping_command])
  764. elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
  765. egrep -i "^round-trip|^rtt" >/dev/null
  766. then
  767. with_ping_command="$PATH_TO_PING -n -U -c %d %s"
  768. ac_cv_ping_packets_first=yes
  769. AC_MSG_RESULT([$with_ping_command])
  770. elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
  771. egrep -i "^round-trip|^rtt" >/dev/null
  772. then
  773. with_ping_command="$PATH_TO_PING -n -c %d %s"
  774. ac_cv_ping_packets_first=yes
  775. AC_MSG_RESULT([$with_ping_command])
  776. elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
  777. egrep -i "^round-trip|^rtt" >/dev/null
  778. then
  779. with_ping_command="$PATH_TO_PING -n %s -c %d"
  780. AC_MSG_RESULT([$with_ping_command])
  781. elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
  782. egrep -i "^round-trip|^rtt" >/dev/null
  783. then
  784. with_ping_command="$PATH_TO_PING %s -n %d"
  785. AC_MSG_RESULT([$with_ping_command])
  786. elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
  787. egrep -i "^round-trip|^rtt" >/dev/null
  788. then
  789. with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
  790. AC_MSG_RESULT([$with_ping_command])
  791. elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
  792. egrep -i "^round-trip|^rtt" >/dev/null
  793. then
  794. with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
  795. AC_MSG_RESULT([$with_ping_command])
  796. elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
  797. egrep -i "^round-trip|^rtt" >/dev/null
  798. then
  799. with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
  800. ac_cv_ping_packets_first=yes
  801. AC_MSG_RESULT([$with_ping_command])
  802. elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
  803. egrep -i "^round-trip|^rtt" >/dev/null
  804. then
  805. with_ping_command="$PATH_TO_PING -n -c %d %s"
  806. ac_cv_ping_packets_first=yes
  807. AC_MSG_RESULT([$with_ping_command])
  808. else
  809. AC_MSG_WARN([unable to find usable ping syntax])
  810. fi
  811. AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
  812. [path and args for ICMP ping command])
  813. if test "x$ac_cv_ping_packets_first" != "xno"
  814. then
  815. AC_DEFINE(PING_PACKETS_FIRST,1,
  816. [Define if packet count must precede host])
  817. fi
  818. AC_ARG_WITH(ping6_command,
  819. ACX_HELP_STRING([--with-ping6-command=SYNTAX],
  820. [sets syntax for ICMPv6 ping]),
  821. with_ping6_command=$withval,)
  822. if test x"$with_ipv6" != xno ; then
  823. AC_MSG_CHECKING(for ICMPv6 ping syntax)
  824. ac_cv_ping6_packets_first=no
  825. if test -n "$with_ping6_command"
  826. then
  827. AC_MSG_RESULT([(command-line) $with_ping6_command])
  828. if test -n "$ac_cv_ping6_packets_first"
  829. then
  830. ac_cv_ping6_packets_first=yes
  831. fi
  832. elif test "x$PATH_TO_PING6" != "x"; then
  833. if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  834. $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
  835. egrep -i "^round-trip|^rtt" >/dev/null
  836. then
  837. with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
  838. ac_cv_ping6_packets_first=yes
  839. AC_MSG_RESULT([$with_ping6_command])
  840. elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
  841. egrep -i "^round-trip|^rtt" >/dev/null
  842. then
  843. with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
  844. ac_cv_ping6_packets_first=yes
  845. AC_MSG_RESULT([$with_ping6_command])
  846. elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
  847. egrep -i "^round-trip|^rtt" >/dev/null
  848. then
  849. with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
  850. ac_cv_ping6_packets_first=yes
  851. AC_MSG_RESULT([$with_ping6_command])
  852. elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
  853. egrep -i "^round-trip|^rtt" >/dev/null
  854. then
  855. with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
  856. AC_MSG_RESULT([$with_ping6_command])
  857. elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
  858. egrep -i "^round-trip|^rtt" >/dev/null
  859. then
  860. with_ping6_command="$PATH_TO_PING6 %s -n %d"
  861. AC_MSG_RESULT([$with_ping6_command])
  862. elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
  863. egrep -i "^round-trip|^rtt" >/dev/null
  864. then
  865. with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
  866. AC_MSG_RESULT([$with_ping6_command])
  867. elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
  868. egrep -i "^round-trip|^rtt" >/dev/null
  869. then
  870. with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
  871. AC_MSG_RESULT([$with_ping6_command])
  872. elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
  873. egrep -i "^round-trip|^rtt" >/dev/null
  874. then
  875. with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
  876. ac_cv_ping6_packets_first=yes
  877. AC_MSG_RESULT([$with_ping_command])
  878. elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
  879. egrep -i "^round-trip|^rtt" >/dev/null
  880. then
  881. with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
  882. ac_cv_ping6_packets_first=yes
  883. AC_MSG_RESULT([$with_ping6_command])
  884. fi
  885. elif test "x$PATH_TO_PING" != "x"; then
  886. if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  887. $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
  888. egrep -i "^round-trip|^rtt" >/dev/null
  889. then
  890. with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
  891. ac_cv_ping6_packets_first=yes
  892. AC_MSG_RESULT([$with_ping6_command])
  893. elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
  894. egrep -i "^round-trip|^rtt" >/dev/null
  895. then
  896. with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
  897. ac_cv_ping6_packets_first=yes
  898. AC_MSG_RESULT([$with_ping6_command])
  899. elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
  900. egrep -i "^round-trip|^rtt" >/dev/null
  901. then
  902. with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
  903. ac_cv_ping6_packets_first=yes
  904. AC_MSG_RESULT([$with_ping6_command])
  905. elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
  906. egrep -i "^round-trip|^rtt" >/dev/null
  907. then
  908. with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
  909. AC_MSG_RESULT([$with_ping6_command])
  910. elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
  911. egrep -i "^round-trip|^rtt" >/dev/null
  912. then
  913. with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
  914. AC_MSG_RESULT([$with_ping6_command])
  915. elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
  916. egrep -i "^round-trip|^rtt" >/dev/null
  917. then
  918. with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
  919. AC_MSG_RESULT([$with_ping6_command])
  920. elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
  921. egrep -i "^round-trip|^rtt" >/dev/null
  922. then
  923. with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
  924. AC_MSG_RESULT([$with_ping6_command])
  925. elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
  926. egrep -i "^round-trip|^rtt" >/dev/null
  927. then
  928. with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
  929. ac_cv_ping6_packets_first=yes
  930. AC_MSG_RESULT([$with_ping_command])
  931. elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
  932. egrep -i "^round-trip|^rtt" >/dev/null
  933. then
  934. with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
  935. ac_cv_ping6_packets_first=yes
  936. AC_MSG_RESULT([$with_ping6_command])
  937. fi
  938. fi
  939. if test "x$with_ping6_command" != "x"; then
  940. AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
  941. [path and args for ICMPv6 ping command])
  942. else
  943. AC_MSG_RESULT([none])
  944. fi
  945. if test "x$ac_cv_ping6_packets_first" != "xno"; then
  946. AC_DEFINE(PING6_PACKETS_FIRST,1,
  947. [Define if packet count must precede host])
  948. fi
  949. fi
  950. AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
  951. AC_MSG_CHECKING(for nslookup syntax)
  952. if test -n "$PATH_TO_NSLOOKUP"
  953. then
  954. if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
  955. then
  956. ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
  957. AC_MSG_RESULT([$ac_cv_nslookup_command])
  958. else
  959. ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
  960. AC_MSG_RESULT([$ac_cv_nslookup_command])
  961. fi
  962. EXTRAS="$EXTRAS check_dns"
  963. else
  964. AC_MSG_WARN([nslookup command not found])
  965. fi
  966. AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command",
  967. [path and args for nslookup])
  968. AC_PATH_PROG(PATH_TO_HOST,host)
  969. if test -n "$ac_cv_path_PATH_TO_HOST"
  970. then
  971. EXTRAS="$EXTRAS check_dns"
  972. fi
  973. AC_PATH_PROG(PATH_TO_UPTIME,uptime)
  974. AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
  975. AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
  976. AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
  977. AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
  978. AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
  979. AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
  980. if (test -x "$PATH_TO_NTPDATE" || test -x "$PATH_TO_NTPQ")
  981. then
  982. AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
  983. AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
  984. else
  985. AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
  986. fi
  987. AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
  988. if test -x "$PATH_TO_LMSTAT"
  989. then
  990. AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
  991. else
  992. AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
  993. fi
  994. AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
  995. if test -x "$PATH_TO_SMBCLIENT"
  996. then
  997. AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
  998. else
  999. AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
  1000. fi
  1001. AC_PATH_PROG(PATH_TO_WHO,who)
  1002. if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
  1003. then
  1004. ac_cv_path_to_who="$PATH_TO_WHO -q"
  1005. else
  1006. ac_cv_path_to_who="$PATH_TO_WHO"
  1007. fi
  1008. AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
  1009. [path and arguments for invoking 'who'])
  1010. AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
  1011. if test -x "$PATH_TO_SNMPGET"
  1012. then
  1013. AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
  1014. EXTRAS="$EXTRAS check_hpjd check_snmp"
  1015. else
  1016. AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
  1017. fi
  1018. AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
  1019. if test -x "$PATH_TO_SNMPGETNEXT"
  1020. then
  1021. AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
  1022. fi
  1023. if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
  1024. then
  1025. AC_MSG_CHECKING(for Net::SNMP perl module)
  1026. AC_MSG_RESULT([found])
  1027. else
  1028. AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
  1029. fi
  1030. AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
  1031. AC_PATH_PROG(PATH_TO_QSTAT,qstat)
  1032. if test -x "$PATH_TO_QUAKESTAT"
  1033. then
  1034. ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
  1035. EXTRAS="$EXTRAS check_game"
  1036. elif test -x "$PATH_TO_QSTAT"
  1037. then
  1038. ac_cv_path_to_qstat="$PATH_TO_QSTAT"
  1039. EXTRAS="$EXTRAS check_game"
  1040. else
  1041. AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
  1042. fi
  1043. if test $ac_cv_path_to_qstat
  1044. then
  1045. AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
  1046. [path to qstat/quakestat])
  1047. fi
  1048. AC_PATH_PROG(PATH_TO_FPING,fping)
  1049. if test -x "$PATH_TO_FPING"
  1050. then
  1051. AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
  1052. EXTRAS="$EXTRAS check_fping"
  1053. else
  1054. AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
  1055. fi
  1056. AC_PATH_PROG(PATH_TO_SSH,ssh)
  1057. if test -x "$PATH_TO_SSH"
  1058. then
  1059. AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
  1060. EXTRAS="$EXTRAS check_by_ssh"
  1061. else
  1062. AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
  1063. fi
  1064. AC_PATH_PROG(PATH_TO_MAILQ,mailq)
  1065. if test -x "$PATH_TO_MAILQ"
  1066. then
  1067. AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
  1068. else
  1069. AC_MSG_WARN([Could not find mailq or eqivalent])
  1070. fi
  1071. AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
  1072. if test -x "$PATH_TO_QMAIL_QSTAT"
  1073. then
  1074. AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
  1075. else
  1076. AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
  1077. fi
  1078. dnl SWAP info required is amount allocated/available and amount free
  1079. dnl The plugin works through all the swap devices and adds up the total swap
  1080. dnl available.
  1081. AC_PATH_PROG(PATH_TO_SWAP,swap)
  1082. AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
  1083. dnl dunno why this does not work below - use hack (kbd)
  1084. dnl fine on linux, broken on solaris
  1085. dnl if /bin/test -e "/proc/meminfo"
  1086. AC_MSG_CHECKING(for how to check memory)
  1087. if [cat /proc/meminfo > /dev/null 2>&1]
  1088. then
  1089. AC_MSG_RESULT([found /proc/meminfo])
  1090. AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
  1091. AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo",[path to /proc/meminfo if name changes])
  1092. EXTRAS="$EXTRAS check_swap"
  1093. fi
  1094. if ( test -n "$PATH_TO_SWAP" || test -n "$PATH_TO_SWAPINFO" )
  1095. then
  1096. if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
  1097. then
  1098. ac_cv_have_swap=yes
  1099. ac_cv_swap_command="$PATH_TO_SWAP -l"
  1100. if [$PATH_TO_SWAP -l 2>/dev/null | \
  1101. egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
  1102. >/dev/null]
  1103. then
  1104. ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %d %d"]
  1105. ac_cv_swap_conv=2048
  1106. AC_MSG_RESULT([using IRIX format swap])
  1107. elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
  1108. then
  1109. ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
  1110. ac_cv_swap_conv=2048
  1111. AC_MSG_RESULT([using Solaris format swap])
  1112. elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
  1113. then
  1114. ac_cv_swap_format=["%*s %*[0-9,-] %*d %d %d"]
  1115. ac_cv_swap_conv=2048
  1116. AC_MSG_RESULT([using Unixware format swap])
  1117. fi
  1118. EXTRAS="$EXTRAS check_swap"
  1119. elif [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
  1120. then
  1121. ac_cv_have_swap=yes
  1122. ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
  1123. if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
  1124. then
  1125. ac_cv_swap_format=["%*s %d %*d %d"]
  1126. ac_cv_swap_conv=1024
  1127. AC_MSG_RESULT([using FreeBSD format swapinfo])
  1128. fi
  1129. EXTRAS="$EXTRAS check_swap"
  1130. elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
  1131. then
  1132. ac_cv_have_swap=yes
  1133. ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM",
  1134. ac_cv_swap_format=["%*s %d %*d %d"]
  1135. ac_cv_swap_conv=1024
  1136. AC_MSG_RESULT([using HP-UX format swapinfo])
  1137. fi
  1138. if test "x$ac_cv_have_swap" != "x"
  1139. then
  1140. AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
  1141. fi
  1142. if test "x$ac_cv_swap_command" != "x"
  1143. then
  1144. AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
  1145. [Path to swap/swapinfo binary, with any args])
  1146. AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
  1147. [Format string for parsing swap output])
  1148. AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
  1149. [Conversion factor to MB])
  1150. fi
  1151. dnl End of if SWAP
  1152. fi
  1153. AC_PATH_PROG(PATH_TO_DIG,dig)
  1154. AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
  1155. if test -n "$PATH_TO_DIG"; then
  1156. EXTRAS="$EXTRAS check_dig"
  1157. fi
  1158. if test -f plugins/check_nt.c ; then
  1159. EXTRAS="$EXTRAS check_nt"
  1160. elif test -f ../plugins/check_nt.c ; then
  1161. EXTRAS="$EXTRAS check_nt"
  1162. fi
  1163. AC_MSG_CHECKING(for va_list)
  1164. AC_TRY_COMPILE([#ifdef __STDC__
  1165. #include <stdio.h>
  1166. #include <stdlib.h>
  1167. #include <stdarg.h>
  1168. #else
  1169. #include <sys/types.h>
  1170. #include <stdio.h>
  1171. #include <varargs.h>
  1172. #endif],
  1173. [va_list args;],
  1174. [AC_MSG_RESULT(yes)],
  1175. [NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
  1176. AC_SUBST(EXTRAS)
  1177. AC_SUBST(EXTRA_NETOBJS)
  1178. AC_SUBST(DEPLIBS)
  1179. AM_GNU_GETTEXT_VERSION(0.11.5)
  1180. AM_GNU_GETTEXT
  1181. AC_OUTPUT(Makefile lib/Makefile plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl pkg/solaris/pkginfo intl/Makefile po/Makefile.in )
  1182. ACX_FEATURE([with],[cgiurl])
  1183. ACX_FEATURE([with],[nagios-user])
  1184. ACX_FEATURE([with],[nagios-group])
  1185. ACX_FEATURE([with],[trusted-path])
  1186. ACX_FEATURE([with],[df-command])
  1187. ACX_FEATURE([with],[ping-command])
  1188. ACX_FEATURE([with],[ping6-command])
  1189. ACX_FEATURE([with],[lwres])
  1190. ACX_FEATURE([with],[ipv6])
  1191. ACX_FEATURE([enable],[emulate-getaddrinfo])