configure.in 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_REVISION ($Revision$)
  3. AC_PREREQ(2.58)
  4. AC_INIT(nagios-plugins,1.4.2)
  5. AC_CONFIG_SRCDIR(NPTest.pm)
  6. AM_INIT_AUTOMAKE
  7. AM_CONFIG_HEADER(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. dnl Must come very early on due to coreutils requirement
  16. dnl Takes care of AC_GNU_SOURCE, AC_AIX and AC_MINIX
  17. gl_USE_SYSTEM_EXTENSIONS
  18. AC_PROG_CC
  19. AC_PROG_CPP
  20. AC_PROG_GCC_TRADITIONAL
  21. AC_PROG_RANLIB
  22. AC_PROG_MAKE_SET
  23. AC_PROG_AWK
  24. AC_FUNC_MALLOC
  25. AC_FUNC_REALLOC
  26. AC_FUNC_ERROR_AT_LINE
  27. AC_CONFIG_LIBOBJ_DIR(lib)
  28. AC_FUNC_GETLOADAVG([lib])
  29. ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
  30. dnl AM_WITH_REGEX
  31. PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
  32. AC_SUBST(PLUGIN_TEST)dnl
  33. SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
  34. AC_SUBST(SCRIPT_TEST)dnl
  35. 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"
  36. AC_SUBST(WARRANTY)
  37. 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"
  38. AC_SUBST(SUPPORT)
  39. dnl CGIURL has changed for Nagios with 1.0 beta
  40. AC_ARG_WITH(cgiurl,
  41. ACX_HELP_STRING([--with-cgiurl=DIR],
  42. [sets URL for cgi programs]),
  43. with_cgiurl=$withval,
  44. with_cgiurl=/nagios/cgi-bin)
  45. CGIURL="$with_cgiurl"
  46. AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
  47. AC_ARG_WITH(nagios_user,
  48. ACX_HELP_STRING([--with-nagios-user=USER],
  49. [set user name to run nagios]),
  50. with_nagios_user=$withval,
  51. with_nagios_user=nagios)
  52. AC_ARG_WITH(nagios_group,
  53. ACX_HELP_STRING([--with-nagios-group=GROUP],
  54. [set group name to run nagios]),
  55. with_nagios_group=$withval,
  56. with_nagios_group=nagios)
  57. AC_SUBST(with_nagios_user)
  58. AC_SUBST(with_nagios_group)
  59. INSTALL_OPTS="-o $with_nagios_user -g $with_nagios_group"
  60. AC_SUBST(INSTALL_OPTS)
  61. AC_ARG_WITH(libtap-object,
  62. ACX_HELP_STRING([--with-libtap-object=path],
  63. [full path to tap.o]),
  64. EXTRA_TEST=test_utils
  65. EXTRA_TAPOBJ=$withval
  66. AC_SUBST(EXTRA_TEST)
  67. AC_SUBST(EXTRA_TAPOBJ)
  68. )
  69. AC_ARG_WITH(trusted_path,
  70. ACX_HELP_STRING([--with-trusted-path=PATH],
  71. [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]),
  72. with_trusted_path=$withval,
  73. with_trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
  74. AC_SUBST(with_trusted_path)
  75. EXTRAS=
  76. dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
  77. LDFLAGS="$LDFLAGS -L."
  78. ac_cv_uname_m=`uname -m`
  79. ac_cv_uname_s=`uname -s`
  80. ac_cv_uname_r=`uname -r`
  81. ac_cv_uname_v=`uname -v`
  82. PKG_ARCH=`uname -p`
  83. REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
  84. REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
  85. AC_SUBST(PKG_ARCH)
  86. AC_SUBST(REV_DATESTAMP)
  87. AC_SUBST(REV_TIMESTAMP)
  88. dnl Checks for programs.
  89. AC_PATH_PROG(PYTHON,python)
  90. AC_PATH_PROG(SH,sh)
  91. AC_PATH_PROG(PERL,perl)
  92. AC_PATH_PROG(LIBGNUTLS_CONFIG,libgnutls-config)
  93. AC_PATH_PROG(HOSTNAME,hostname)
  94. AC_PATH_PROG(BASENAME,basename)
  95. dnl allow them to override the path of perl
  96. AC_ARG_WITH(perl,
  97. ACX_HELP_STRING([--with-perl=PATH],
  98. [sets path to perl executable]),
  99. with_perl=$withval,with_perl=$PERL)
  100. AC_SUBST(PERL, $with_perl)
  101. dnl openssl/gnutls
  102. AC_ARG_WITH(openssl,
  103. AC_HELP_STRING([--with-openssl=DIR],
  104. [path to openssl installation]),)
  105. AC_ARG_WITH(gnutls,
  106. ACX_HELP_STRING([--with-gnutls=PATH],
  107. [path to gnutls installation root]),)
  108. dnl you can only have one or the other
  109. if test ! "$with_openssl" = "" && test ! "$with_openssl" = "no"; then
  110. with_gnutls="no"
  111. fi
  112. if test ! "$with_gnutls" = "" && test ! "$with_gnutls" = "no"; then
  113. with_openssl="no"
  114. fi
  115. dnl list of possible dirs to try to autodetect openssl
  116. dnl if $dir/include exists, we consider it found
  117. dnl the order should allow locally installed versions to override distros' ones
  118. OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
  119. /opt /opt/openssl"
  120. dnl
  121. dnl Check for miscellaneous stuff
  122. dnl
  123. case $host_vender-$host_os in
  124. sun*)
  125. AC_DEFINE(__EXTENSIONS__,1,[Sun's netdb.h needs this for getaddrinfo])
  126. ;;
  127. osf*)
  128. AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
  129. ;;
  130. esac
  131. dnl
  132. dnl Checks for libraries.
  133. dnl
  134. AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
  135. AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
  136. AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
  137. AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
  138. AC_SUBST(SOCKETLIBS)
  139. dnl
  140. dnl check for math-related functions needing -lm
  141. AC_CHECK_HEADERS(math.h)
  142. AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
  143. AC_SUBST(MATHLIBS)
  144. dnl Check for PostgreSQL libraries
  145. _SAVEDLIBS="$LIBS"
  146. _SAVEDCPPFLAGS="$CPPFLAGS"
  147. AC_ARG_WITH(pgsql,
  148. ACX_HELP_STRING([--with-pgsql=DIR],
  149. [sets path to pgsql installation]),
  150. PGSQL=$withval,)
  151. AC_CHECK_LIB(crypt,main)
  152. if test "$ac_cv_lib_crypt_main" = "yes"; then
  153. if test -n "$PGSQL"; then
  154. LDFLAGS="$LDFLAGS -L$PGSQL/lib"
  155. CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
  156. fi
  157. AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
  158. if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
  159. AC_CHECK_HEADERS(pgsql/libpq-fe.h)
  160. AC_CHECK_HEADERS(postgresql/libpq-fe.h)
  161. AC_CHECK_HEADERS(libpq-fe.h)
  162. if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
  163. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  164. PGINCLUDE="-I$PGSQL/include"
  165. elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
  166. PGLIBS="-lpq -lcrypt"
  167. PGINCLUDE="-I/usr/include/pgsql"
  168. elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
  169. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  170. PGINCLUDE="-I/usr/include/postgresql"
  171. elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
  172. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  173. PGINCLUDE="-I$PGSQL/include"
  174. fi
  175. if test -z "$PGINCLUDE"; then
  176. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  177. AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
  178. else
  179. AC_SUBST(PGLIBS)
  180. AC_SUBST(PGINCLUDE)
  181. EXTRAS="$EXTRAS check_pgsql"
  182. fi
  183. else
  184. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  185. AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
  186. AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
  187. fi
  188. else
  189. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  190. AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
  191. fi
  192. LIBS="$_SAVEDLIBS"
  193. CPPFLAGS="$_SAVEDCPPFLAGS"
  194. dnl Check for radius libraries
  195. _SAVEDLIBS="$LIBS"
  196. AC_CHECK_LIB(radiusclient,rc_read_config)
  197. if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
  198. EXTRAS="$EXTRAS check_radius"
  199. RADIUSLIBS="-lradiusclient"
  200. AC_SUBST(RADIUSLIBS)
  201. else
  202. AC_MSG_WARN([Skipping radius plugin])
  203. AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
  204. fi
  205. LIBS="$_SAVEDLIBS"
  206. dnl Check for LDAP libraries
  207. _SAVEDLIBS="$LIBS"
  208. AC_CHECK_LIB(ldap,main,,,-llber)
  209. if test "$ac_cv_lib_ldap_main" = "yes"; then
  210. LDAPLIBS="-lldap -llber"\
  211. LDAPINCLUDE="-I/usr/include/ldap"
  212. AC_SUBST(LDAPLIBS)
  213. AC_SUBST(LDAPINCLUDE)
  214. AC_CHECK_FUNCS(ldap_set_option)
  215. EXTRAS="$EXTRAS check_ldap"
  216. AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
  217. else
  218. AC_MSG_WARN([Skipping LDAP plugin])
  219. AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
  220. fi
  221. LIBS="$_SAVEDLIBS"
  222. dnl Check for mysql libraries
  223. _SAVEDLIBS="$LIBS"
  224. _SAVEDCPPFLAGS="$CPPFLAGS"
  225. AC_ARG_WITH(mysql,
  226. ACX_HELP_STRING([--with-mysql=DIR],
  227. [sets path to mysql installation (assumes lib/mysql and include subdirs]),
  228. MYSQL=$withval,)
  229. if test -n "$MYSQL"; then
  230. MYSQLLIBDIR=$MYSQL/lib/mysql
  231. CPPFLAGS="-I$MYSQL/include"
  232. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz)
  233. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  234. elif test -f /usr/lib/libmysqlclient.so; then
  235. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
  236. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  237. elif test -f /usr/lib/libmysqlclient.a; then
  238. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
  239. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  240. elif test -f /usr/lib/mysql/libmysqlclient.so; then
  241. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
  242. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
  243. elif test -f /usr/lib/mysql/libmysqlclient.a; then
  244. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
  245. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
  246. fi
  247. if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
  248. AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" )
  249. if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
  250. EXTRAS="$EXTRAS check_mysql"
  251. AC_SUBST(MYSQLINCLUDE)
  252. AC_SUBST(MYSQLLIBS)
  253. AC_SUBST(check_mysql_LDFLAGS)
  254. else
  255. AC_MSG_WARN([Skipping mysql plugin])
  256. AC_MSG_WARN([install mysql client headers to compile this plugin (see REQUIREMENTS).])
  257. fi
  258. else
  259. AC_MSG_WARN([Skipping mysql plugin])
  260. AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
  261. fi
  262. CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE"
  263. LIBS="$_SAVEDLIBS"
  264. AC_CHECK_HEADERS(unistd.h)
  265. dnl Check for AF_INET6 support - unistd.h required for Darwin
  266. AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
  267. AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
  268. #include <unistd.h>
  269. #endif
  270. #include <netinet/in.h>
  271. #include <sys/socket.h>],
  272. [struct sockaddr_in6 sin6;
  273. void *p;
  274. sin6.sin6_family = AF_INET6;
  275. sin6.sin6_port = 587;
  276. p = &sin6.sin6_addr;],
  277. [with_ipv6=yes],
  278. [with_ipv6=no])
  279. ])
  280. if test x"$with_ipv6" != xno ; then
  281. AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
  282. fi
  283. dnl #########################################################################
  284. dnl Check if Posix getaddrinfo() is available. It is also possible to use
  285. dnl the version from the lwres library distributed with BIND.
  286. dnl #########################################################################
  287. AC_ARG_ENABLE([emulate-getaddrinfo],
  288. ACX_HELP_STRING([--enable-emulate-getaddrinfo],
  289. [enable getaddrinfo emulation (default=no)]),
  290. ,
  291. enable_emulate_getaddrinfo=no)
  292. AC_ARG_WITH(lwres,
  293. ACX_HELP_STRING([--with-lwres=DIR],
  294. [use lwres library for getaddrinfo (default=no)]),
  295. ,
  296. with_lwres=no)
  297. dnl ## enable force to test getaddrinfo.c
  298. if test x$enable_emulate_getaddrinfo = xforce ; then
  299. enable_emulate_getaddrinfo=yes
  300. have_getaddrinfo=no
  301. else
  302. have_getaddrinfo=no
  303. if test x$with_lwres != xno ; then
  304. if test "$with_lwres" != yes ; then
  305. CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
  306. LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
  307. fi
  308. AC_CHECK_HEADERS(lwres/netdb.h, ,
  309. [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
  310. AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
  311. [AC_MSG_ERROR([cannot find the lwres library])],
  312. -lnsl -lpthread)
  313. have_getaddrinfo=yes
  314. fi
  315. if test x$have_getaddrinfo != xyes ; then
  316. AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
  317. fi
  318. dnl # Special nonsense for systems that actually have getaddrinfo but
  319. dnl # redefine the name to something else, e.g. OSF
  320. if test x$have_getaddrinfo != xyes ; then
  321. AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
  322. AC_TRY_LINK([
  323. # include <netdb.h>
  324. ], [
  325. struct addrinfo hints, *res;
  326. int err;
  327. err = getaddrinfo ("host", "service", &hints, &res);
  328. ], [
  329. have_getaddrinfo=yes
  330. AC_MSG_RESULT(yes)
  331. ], [AC_MSG_RESULT(no)])
  332. fi
  333. fi
  334. if test x$have_getaddrinfo != xno ; then
  335. if test x$enable_emulate_getaddrinfo != xno ; then
  336. AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
  337. fi
  338. AC_DEFINE(HAVE_GETADDRINFO, 1,
  339. [Does system provide RFC 2553/Posix getaddrinfo?])
  340. else
  341. if test x$enable_emulate_getaddrinfo != xyes ; then
  342. dnl AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
  343. enable_emulate_getaddrinfo=yes
  344. AC_MSG_WARN([enabling getaddrinfo emulation])
  345. fi
  346. EXTRA_NETOBJS="$EXTRA_NETOBJS getaddrinfo.o"
  347. fi
  348. if test x"$enable_emulate_getaddrinfo" != xno ; then
  349. have_resolver=no
  350. dnl Try for getipnodebyname
  351. AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
  352. if test x"$have_resolver" != xno ; then
  353. AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
  354. [Set when getipnodebyname is available])
  355. fi
  356. dnl Try for gethostbyname_r
  357. if test x"$have_resolver" = xno ; then
  358. AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
  359. [have_resolver=yes
  360. ACX_WHICH_GETHOSTBYNAME_R])
  361. fi
  362. dnl Try for gethostbyname
  363. if test x"$have_resolver" = xno ; then
  364. if test x"$enable_pthreads" != xno ; then
  365. AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
  366. fi
  367. AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
  368. [AC_MSG_ERROR([cannot find gethostbyname])])
  369. fi
  370. EXTRA_NETOBJS="$EXTRA_NETOBJS gethostbyname.o"
  371. fi
  372. dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
  373. AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
  374. if test "$FOUNDINCLUDE" = "no"; then
  375. _SAVEDCPPFLAGS="$CPPFLAGS"
  376. CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
  377. unset ac_cv_header_krb5_h
  378. AC_CHECK_HEADERS(krb5.h,
  379. KRB5INCLUDE="-I/usr/kerberos/include"
  380. FOUNDINCLUDE=yes,
  381. FOUNDINCLUDE=no)
  382. fi
  383. AC_SUBST(KRBINCLUDE)
  384. if test "$FOUNDINCLUDE" = "no"; then
  385. CPPFLAGS="$_SAVEDCPPFLAGS"
  386. fi
  387. dnl openssl detection/configuration
  388. if ! test "$with_openssl" = "no"; then
  389. dnl Check for OpenSSL location if it wasn't already specified
  390. if ! test -d "$with_openssl"; then
  391. for d in $OPENSSL_DIRS; do
  392. if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
  393. with_openssl=$d
  394. fi
  395. done
  396. fi
  397. _SAVEDCPPFLAGS="$CPPFLAGS"
  398. _SAVEDLDFLAGS="$LDFLAGS"
  399. dnl Check for OpenSSL header files
  400. unset FOUNDINCLUDE
  401. CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
  402. LDFLAGS="$LDFLAGS -R$OPENSSL/lib"
  403. dnl check for openssl in $dir/include/openssl
  404. AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
  405. SSLINCLUDE="-I$OPENSSL/include"
  406. FOUNDINCLUDE=yes,
  407. FOUNDINCLUDE=no)
  408. dnl else check to see if $dir/include has it
  409. if test "$FOUNDINCLUDE" = "no"; then
  410. AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
  411. SSLINCLUDE="-I$OPENSSL/include"
  412. FOUNDINCLUDE=yes,
  413. FOUNDINCLUDE=no)
  414. fi
  415. AC_SUBST(SSLINCLUDE)
  416. dnl if we didn't find it, reset CPPFLAGS
  417. if test "$FOUNDINCLUDE" = "no"; then
  418. CPPFLAGS="$_SAVEDCPPFLAGS"
  419. LDFLAGS="$_SAVEDLDFLAGS"
  420. fi
  421. dnl Check for crypto lib
  422. _SAVEDLIBS="$LIBS"
  423. LIBS="-L${with_openssl}/lib"
  424. AC_CHECK_LIB(crypto,CRYPTO_lock)
  425. if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
  426. dnl Check for SSL lib
  427. AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
  428. fi
  429. LIBS="$_SAVEDLIBS"
  430. dnl test headers and libs to decide whether check_http should use SSL
  431. if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
  432. if test "$ac_cv_lib_ssl_main" = "yes"; then
  433. if test "$FOUNDINCLUDE" = "yes"; then
  434. FOUNDOPENSSL="yes"
  435. fi
  436. fi
  437. fi
  438. fi
  439. dnl check for gnutls if openssl isn't found (or is disabled)
  440. if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
  441. if test ! "$with_gnutls" = ""; then
  442. CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
  443. elif test ! "$LIBGNUTLS_CONFIG" = ""; then
  444. CPPFLAGS="$CPPFLAGS -I`$LIBGNUTLS_CONFIG --prefix`"
  445. fi
  446. AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
  447. if test "$FOUNDGNUTLS" = "yes"; then
  448. AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
  449. fi
  450. fi
  451. dnl end check for gnutls
  452. if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
  453. check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
  454. AC_SUBST(check_tcp_ssl)
  455. AC_SUBST(SSLLIBS)
  456. AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
  457. if test "$FOUNDOPENSSL" = "yes"; then
  458. AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
  459. with_openssl="yes"
  460. with_gnutls="no"
  461. else
  462. AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
  463. with_gnutls="yes"
  464. with_openssl="no"
  465. fi
  466. else
  467. dnl else deliberately disabled or no ssl support available
  468. AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
  469. with_openssl="no"
  470. with_gnutls="no"
  471. fi
  472. dnl
  473. dnl Checks for header files.
  474. dnl
  475. AC_HEADER_STDC
  476. AC_HEADER_TIME
  477. AC_HEADER_SYS_WAIT
  478. 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 sys/un.h)
  479. AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h)
  480. dnl Checks for typedefs, structures, and compiler characteristics.
  481. AC_C_CONST
  482. AC_STRUCT_TM
  483. AC_TYPE_PID_T
  484. AC_TYPE_SIZE_T
  485. AC_TYPE_SIGNAL
  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,
  490. ac_cv_HAVE_VA_COPY=no)])
  491. if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
  492. AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
  493. else
  494. AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
  495. AC_TRY_LINK([#include <stdarg.h>
  496. va_list ap1,ap2;], [__va_copy(ap1,ap2);],
  497. ac_cv_HAVE___VA_COPY=yes,
  498. ac_cv_HAVE___VA_COPY=no)])
  499. if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
  500. AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
  501. fi
  502. fi
  503. AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf)
  504. AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
  505. AC_TRY_RUN([
  506. #include <sys/types.h>
  507. #include <stdarg.h>
  508. void foo(const char *format, ...) {
  509. va_list ap;
  510. int len;
  511. char buf[5];
  512. va_start(ap, format);
  513. len = vsnprintf(buf, 0, format, ap);
  514. va_end(ap);
  515. if (len != 5) exit(1);
  516. va_start(ap, format);
  517. len = vsnprintf(0, 0, format, ap);
  518. va_end(ap);
  519. if (len != 5) exit(1);
  520. if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
  521. exit(0);
  522. }
  523. main() { foo("hello"); }
  524. ],
  525. ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)])
  526. if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
  527. AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
  528. fi
  529. AC_TRY_COMPILE([#include <sys/time.h>],
  530. [struct timeval *tv;
  531. struct timezone *tz;],
  532. AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
  533. AC_TRY_COMPILE([#include <sys/time.h>],
  534. [struct timeval *tv;
  535. struct timezone *tz;
  536. gettimeofday(tv, tz);],
  537. AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
  538. AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
  539. dnl Checks for library functions.
  540. AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul floor)
  541. AC_MSG_CHECKING(return type of socket size)
  542. AC_TRY_COMPILE([#include <stdlib.h>
  543. #include <sys/types.h>
  544. #include <sys/socket.h>],
  545. [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
  546. ac_cv_socket_size_type=["size_t"]
  547. AC_MSG_RESULT(size_t),
  548. ac_cv_socket_size_type=["int"]
  549. AC_MSG_RESULT(int))
  550. AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
  551. [Define type of socket size])
  552. AC_ARG_WITH(proc-loadavg,
  553. ACX_HELP_STRING([--with-proc-loadavg=PATH],
  554. [path to /proc/loadavg or equivalent]),
  555. ac_cv_proc_loadavg=$withval)
  556. AC_MSG_CHECKING([for /proc/loadavg])
  557. if test -n "$ac_cv_proc_loadavg"; then
  558. AC_MSG_RESULT([(command line) $ac_cv_proc_loadavg])
  559. elif test -f "/proc/loadavg"; then
  560. AC_MSG_RESULT([found /proc/loadavg])
  561. ac_cv_proc_loadavg="/proc/loadavg"
  562. else
  563. AC_MSG_RESULT([no])
  564. fi
  565. if test -n "$ac_cv_proc_loadavg"; then
  566. AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
  567. AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg",[Location of /proc/loadavg])
  568. fi
  569. dnl #### Process table test
  570. AC_PATH_PROG(PATH_TO_PS,ps)
  571. AC_MSG_CHECKING(for ps syntax)
  572. AC_ARG_WITH(ps_command,
  573. ACX_HELP_STRING([--with-ps-command=PATH],
  574. [Verbatim command to execute for ps]),
  575. PS_COMMAND=$withval)
  576. AC_ARG_WITH(ps_format,
  577. ACX_HELP_STRING([--with-ps-format=FORMAT],
  578. [Format string for scanning ps output]),
  579. PS_FORMAT=$withval)
  580. AC_ARG_WITH(ps_cols,
  581. ACX_HELP_STRING([--with-ps-cols=NUM],
  582. [Number of columns in ps command]),
  583. PS_COLS=$withval)
  584. AC_ARG_WITH(ps_varlist,
  585. ACX_HELP_STRING([--with-ps-varlist=LIST],
  586. [Variable list for sscanf of 'ps' output]),
  587. PS_VARLIST=$withval)
  588. AM_CONDITIONAL(WANT_PST3, false)
  589. if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
  590. ac_cv_ps_command="$PS_COMMAND"
  591. ac_cv_ps_format="$PS_FORMAT"
  592. ac_cv_ps_varlist="$PS_VARLIST"
  593. ac_cv_ps_cols="$PS_COLS"
  594. AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
  595. dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
  596. elif test "$ac_cv_uname_s" = "SunOS"; then
  597. #
  598. # this is a very, very ugly hack, to hardcode the location for plugins
  599. #
  600. if test "$libexecdir" = '${exec_prefix}/libexec'; then
  601. if test "$exec_prefix" = "NONE"; then
  602. if test "$prefix" = "NONE"; then
  603. pst3="$ac_default_prefix/libexec/pst3"
  604. else
  605. pst3="$prefix/libexec/pst3"
  606. fi
  607. else
  608. pst3="$exec_prefix/libexec/pst3"
  609. fi
  610. else
  611. pst3="$libexecdir/pst3"
  612. fi
  613. ac_cv_ps_command="$pst3"
  614. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  615. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  616. ac_cv_ps_cols=8
  617. AC_MSG_RESULT([using nagios-plugins internal ps for solaris])
  618. AM_CONDITIONAL(WANT_PST3, true)
  619. dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
  620. dnl so test for this first...
  621. elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
  622. egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
  623. then
  624. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  625. ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
  626. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  627. ac_cv_ps_cols=9
  628. AC_MSG_RESULT([$ac_cv_ps_command])
  629. dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
  630. dnl Should also work for FreeBSD 5.2.1 and 5.3
  631. dnl STAT UCOMM VSZ RSS USER PPID COMMAND
  632. elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
  633. egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
  634. then
  635. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  636. ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
  637. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  638. ac_cv_ps_cols=9
  639. AC_MSG_RESULT([$ac_cv_ps_command])
  640. dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
  641. dnl Limitation: Only first 16 chars returned for ucomm field
  642. dnl Must come before ps -weo
  643. elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
  644. egrep -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
  645. then
  646. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  647. ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
  648. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  649. ac_cv_ps_cols=9
  650. AC_MSG_RESULT([$ac_cv_ps_command])
  651. dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
  652. elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
  653. egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
  654. then
  655. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
  656. ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
  657. ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
  658. ac_cv_ps_cols=10
  659. AC_MSG_RESULT([$ac_cv_ps_command])
  660. dnl FreeBSD
  661. elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
  662. egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
  663. then
  664. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  665. ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
  666. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  667. ac_cv_ps_cols=9
  668. AC_MSG_RESULT([$ac_cv_ps_command])
  669. dnl BSD-like mode in RH 6.1
  670. elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
  671. egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  672. then
  673. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  674. ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
  675. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  676. ac_cv_ps_cols=9
  677. AC_MSG_RESULT([$ac_cv_ps_command])
  678. dnl SunOS 4.1.3:
  679. dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
  680. dnl Need the head -1 otherwise test will work because arguments are found
  681. elif ps -laxnwww 2>/dev/null | head -1 | \
  682. egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
  683. then
  684. ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
  685. ac_cv_ps_command="$PATH_TO_PS -laxnwww"
  686. ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
  687. ac_cv_ps_cols=9
  688. AC_MSG_RESULT([$ac_cv_ps_command])
  689. dnl Debian Linux / procps v1.2.9:
  690. dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
  691. dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
  692. dnl
  693. elif ps laxnwww 2>/dev/null | \
  694. egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
  695. then
  696. ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
  697. ac_cv_ps_command="$PATH_TO_PS laxnwww"
  698. ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
  699. ac_cv_ps_cols=9
  700. AC_MSG_RESULT([$ac_cv_ps_command])
  701. dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
  702. elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
  703. egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  704. then
  705. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  706. ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
  707. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  708. ac_cv_ps_cols=9
  709. AC_MSG_RESULT([$ac_cv_ps_command])
  710. dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
  711. dnl Has /usr/bin/ps and /sbin/ps - force sbin version
  712. dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
  713. dnl of 1500). Will need big changes to check_procs to support
  714. elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
  715. egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
  716. then
  717. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
  718. ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
  719. ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
  720. ac_cv_ps_cols=8
  721. AC_MSG_RESULT([$ac_cv_ps_command])
  722. elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
  723. egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  724. then
  725. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  726. ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
  727. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  728. ac_cv_ps_cols=9
  729. AC_MSG_RESULT([$ac_cv_ps_command])
  730. dnl AIX 4.3.3 and 5.1 do not have an rss field
  731. elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
  732. egrep -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
  733. then
  734. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
  735. ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
  736. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  737. ac_cv_ps_cols=8
  738. AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
  739. dnl Solaris 2.6
  740. elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
  741. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  742. then
  743. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  744. ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
  745. # There must be no space between the %s and %n due to a wierd problem in sscanf where
  746. # it will return %n as longer than the line length
  747. ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
  748. ac_cv_ps_cols=9
  749. AC_MSG_RESULT([$ac_cv_ps_command])
  750. elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
  751. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  752. then
  753. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  754. ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
  755. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  756. ac_cv_ps_cols=9
  757. AC_MSG_RESULT([$ac_cv_ps_command])
  758. elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
  759. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  760. then
  761. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  762. ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
  763. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  764. ac_cv_ps_cols=9
  765. AC_MSG_RESULT([$ac_cv_ps_command])
  766. dnl wonder who takes state instead of stat
  767. elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
  768. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  769. then
  770. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  771. ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
  772. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  773. ac_cv_ps_cols=8
  774. AC_MSG_RESULT([$ac_cv_ps_command])
  775. dnl IRIX 53
  776. elif ps -el 2>/dev/null | \
  777. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  778. then
  779. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
  780. ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
  781. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
  782. ac_cv_ps_cols=8
  783. AC_MSG_RESULT([$ac_cv_ps_command])
  784. dnl IRIX 63
  785. elif ps -el 2>/dev/null | \
  786. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  787. then
  788. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
  789. ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
  790. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  791. ac_cv_ps_cols=6
  792. AC_MSG_RESULT([$ac_cv_ps_command])
  793. dnl AIX 4.1:
  794. dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
  795. dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
  796. elif ps -el 2>/dev/null | \
  797. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  798. then
  799. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
  800. ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
  801. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  802. ac_cv_ps_cols=6
  803. AC_MSG_RESULT([$ac_cv_ps_command])
  804. dnl AIX?
  805. elif ps glaxen 2>/dev/null | \
  806. egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
  807. then
  808. ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
  809. ac_cv_ps_command="$PATH_TO_PS glaxen"
  810. ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
  811. ac_cv_ps_cols=8
  812. AC_MSG_RESULT([$ac_cv_ps_command])
  813. dnl MacOSX / Darwin
  814. dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
  815. dnl Some truncation will happen in UCOMM column
  816. dnl STAT VSZ RSS UID PPID %CPU UCOMM COMMAND
  817. dnl Ss 52756 22496 501 1 6.9 Window Manager /System/Library/CoreServices/WindowServer -daemon
  818. elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
  819. egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
  820. then
  821. ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
  822. ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
  823. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  824. ac_cv_ps_cols=8
  825. AC_MSG_RESULT([$ac_cv_ps_command])
  826. dnl UnixWare
  827. elif ps -Al 2>/dev/null | \
  828. egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
  829. then
  830. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
  831. ac_cv_ps_command="$PATH_TO_PS -Al"
  832. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  833. ac_cv_ps_cols=8
  834. AC_MSG_RESULT([$ac_cv_ps_command])
  835. else
  836. AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
  837. fi
  838. if test -n "$ac_cv_ps_varlist" ; then
  839. AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
  840. [Variable list for sscanf of 'ps' output])
  841. AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
  842. [Verbatim command to execute for ps in check_procs])
  843. AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
  844. [Format string for scanning ps output in check_procs])
  845. AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
  846. [Number of columns in ps command])
  847. EXTRAS="$EXTRAS check_procs check_nagios"
  848. if echo "$ac_cv_ps_varlist" | grep -q "procetime"; then
  849. AC_DEFINE(PS_USES_PROCETIME,"yes",
  850. [Whether the ps utility uses the "procetime" field])
  851. fi
  852. fi
  853. AC_PATH_PROG(PATH_TO_PING,ping)
  854. AC_PATH_PROG(PATH_TO_PING6,ping6)
  855. AC_ARG_WITH(ping_command,
  856. ACX_HELP_STRING([--with-ping-command=SYNTAX],
  857. [sets syntax for ICMP ping]),
  858. with_ping_command=$withval,)
  859. AC_MSG_CHECKING(for ICMP ping syntax)
  860. ac_cv_ping_packets_first=no
  861. ac_cv_ping_has_timeout=no
  862. if test -n "$with_ping_command"
  863. then
  864. AC_MSG_RESULT([(command-line) $with_ping_command])
  865. if test -n "$ac_cv_ping_packets_first"
  866. then
  867. ac_cv_ping_packets_first=yes
  868. ac_cv_ping_has_timeout=yes
  869. fi
  870. elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  871. $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
  872. egrep -i "^round-trip|^rtt" >/dev/null
  873. then
  874. with_ping_command="$PATH_TO_PING -n -U -c %d %s"
  875. ac_cv_ping_packets_first=yes
  876. AC_MSG_RESULT([$with_ping_command])
  877. elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
  878. egrep -i "^round-trip|^rtt" >/dev/null
  879. then
  880. with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
  881. ac_cv_ping_packets_first=yes
  882. ac_cv_ping_has_timeout=yes
  883. AC_MSG_RESULT([$with_ping_command])
  884. elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
  885. egrep -i "^round-trip|^rtt" >/dev/null
  886. then
  887. with_ping_command="$PATH_TO_PING -n -U -c %d %s"
  888. ac_cv_ping_packets_first=yes
  889. AC_MSG_RESULT([$with_ping_command])
  890. elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
  891. egrep -i "^round-trip|^rtt" >/dev/null
  892. then
  893. with_ping_command="$PATH_TO_PING -n -c %d %s"
  894. ac_cv_ping_packets_first=yes
  895. AC_MSG_RESULT([$with_ping_command])
  896. elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
  897. egrep -i "^round-trip|^rtt" >/dev/null
  898. then
  899. with_ping_command="$PATH_TO_PING -n %s -c %d"
  900. AC_MSG_RESULT([$with_ping_command])
  901. elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
  902. egrep -i "^round-trip|^rtt" >/dev/null
  903. then
  904. with_ping_command="$PATH_TO_PING %s -n %d"
  905. AC_MSG_RESULT([$with_ping_command])
  906. elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
  907. egrep -i "^round-trip|^rtt" >/dev/null
  908. then
  909. with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
  910. AC_MSG_RESULT([$with_ping_command])
  911. elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
  912. egrep -i "^round-trip|^rtt" >/dev/null
  913. then
  914. with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
  915. AC_MSG_RESULT([$with_ping_command])
  916. elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
  917. egrep -i "^round-trip|^rtt" >/dev/null
  918. then
  919. with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
  920. ac_cv_ping_packets_first=yes
  921. AC_MSG_RESULT([$with_ping_command])
  922. elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
  923. egrep -i "^round-trip|^rtt" >/dev/null
  924. then
  925. with_ping_command="$PATH_TO_PING -n -c %d %s"
  926. ac_cv_ping_packets_first=yes
  927. AC_MSG_RESULT([$with_ping_command])
  928. else
  929. AC_MSG_WARN([unable to find usable ping syntax])
  930. fi
  931. AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
  932. [path and args for ICMP ping command])
  933. if test "x$ac_cv_ping_packets_first" != "xno"
  934. then
  935. AC_DEFINE(PING_PACKETS_FIRST,1,
  936. [Define if packet count must precede host])
  937. fi
  938. if test "x$ac_cv_ping_has_timeout" != "xno"
  939. then
  940. AC_DEFINE(PING_HAS_TIMEOUT,1,
  941. [Define if ping has its own timeout option that should be set])
  942. fi
  943. AC_ARG_WITH(ping6_command,
  944. ACX_HELP_STRING([--with-ping6-command=SYNTAX],
  945. [sets syntax for ICMPv6 ping]),
  946. with_ping6_command=$withval,)
  947. if test x"$with_ipv6" != xno ; then
  948. AC_MSG_CHECKING(for ICMPv6 ping syntax)
  949. ac_cv_ping6_packets_first=no
  950. if test -n "$with_ping6_command"
  951. then
  952. AC_MSG_RESULT([(command-line) $with_ping6_command])
  953. if test -n "$ac_cv_ping6_packets_first"
  954. then
  955. ac_cv_ping6_packets_first=yes
  956. fi
  957. elif test "x$PATH_TO_PING6" != "x"; then
  958. if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  959. $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
  960. egrep -i "^round-trip|^rtt" >/dev/null
  961. then
  962. with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
  963. ac_cv_ping6_packets_first=yes
  964. AC_MSG_RESULT([$with_ping6_command])
  965. elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
  966. egrep -i "^round-trip|^rtt" >/dev/null
  967. then
  968. with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
  969. ac_cv_ping6_packets_first=yes
  970. ac_cv_ping_has_timeout=yes
  971. AC_MSG_RESULT([$with_ping6_command])
  972. elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
  973. egrep -i "^round-trip|^rtt" >/dev/null
  974. then
  975. with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
  976. ac_cv_ping6_packets_first=yes
  977. AC_MSG_RESULT([$with_ping6_command])
  978. elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
  979. egrep -i "^round-trip|^rtt" >/dev/null
  980. then
  981. with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
  982. ac_cv_ping6_packets_first=yes
  983. AC_MSG_RESULT([$with_ping6_command])
  984. elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
  985. egrep -i "^round-trip|^rtt" >/dev/null
  986. then
  987. with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
  988. AC_MSG_RESULT([$with_ping6_command])
  989. elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
  990. egrep -i "^round-trip|^rtt" >/dev/null
  991. then
  992. with_ping6_command="$PATH_TO_PING6 %s -n %d"
  993. AC_MSG_RESULT([$with_ping6_command])
  994. elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
  995. egrep -i "^round-trip|^rtt" >/dev/null
  996. then
  997. with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
  998. AC_MSG_RESULT([$with_ping6_command])
  999. elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
  1000. egrep -i "^round-trip|^rtt" >/dev/null
  1001. then
  1002. with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
  1003. AC_MSG_RESULT([$with_ping6_command])
  1004. elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
  1005. egrep -i "^round-trip|^rtt" >/dev/null
  1006. then
  1007. with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
  1008. ac_cv_ping6_packets_first=yes
  1009. AC_MSG_RESULT([$with_ping_command])
  1010. elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
  1011. egrep -i "^round-trip|^rtt" >/dev/null
  1012. then
  1013. with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
  1014. ac_cv_ping6_packets_first=yes
  1015. AC_MSG_RESULT([$with_ping6_command])
  1016. fi
  1017. elif test "x$PATH_TO_PING" != "x"; then
  1018. if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  1019. $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
  1020. egrep -i "^round-trip|^rtt" >/dev/null
  1021. then
  1022. with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
  1023. ac_cv_ping6_packets_first=yes
  1024. AC_MSG_RESULT([$with_ping6_command])
  1025. elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
  1026. egrep -i "^round-trip|^rtt" >/dev/null
  1027. then
  1028. with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
  1029. ac_cv_ping6_packets_first=yes
  1030. AC_MSG_RESULT([$with_ping6_command])
  1031. elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
  1032. egrep -i "^round-trip|^rtt" >/dev/null
  1033. then
  1034. with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
  1035. ac_cv_ping6_packets_first=yes
  1036. AC_MSG_RESULT([$with_ping6_command])
  1037. elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
  1038. egrep -i "^round-trip|^rtt" >/dev/null
  1039. then
  1040. with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
  1041. AC_MSG_RESULT([$with_ping6_command])
  1042. elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
  1043. egrep -i "^round-trip|^rtt" >/dev/null
  1044. then
  1045. with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
  1046. AC_MSG_RESULT([$with_ping6_command])
  1047. elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
  1048. egrep -i "^round-trip|^rtt" >/dev/null
  1049. then
  1050. with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
  1051. AC_MSG_RESULT([$with_ping6_command])
  1052. elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
  1053. egrep -i "^round-trip|^rtt" >/dev/null
  1054. then
  1055. with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
  1056. AC_MSG_RESULT([$with_ping6_command])
  1057. elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
  1058. egrep -i "^round-trip|^rtt" >/dev/null
  1059. then
  1060. with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
  1061. ac_cv_ping6_packets_first=yes
  1062. AC_MSG_RESULT([$with_ping_command])
  1063. elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
  1064. egrep -i "^round-trip|^rtt" >/dev/null
  1065. then
  1066. with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
  1067. ac_cv_ping6_packets_first=yes
  1068. AC_MSG_RESULT([$with_ping6_command])
  1069. fi
  1070. fi
  1071. if test "x$with_ping6_command" != "x"; then
  1072. AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
  1073. [path and args for ICMPv6 ping command])
  1074. else
  1075. AC_MSG_RESULT([none])
  1076. fi
  1077. if test "x$ac_cv_ping6_packets_first" != "xno"; then
  1078. AC_DEFINE(PING6_PACKETS_FIRST,1,
  1079. [Define if packet count must precede host])
  1080. fi
  1081. fi
  1082. AC_MSG_CHECKING(for nslookup syntax)
  1083. AC_ARG_WITH(nslookup_command,
  1084. ACX_HELP_STRING([--with-nslookup-command=PATH],
  1085. [sets path to nslookup executable]),
  1086. ac_cv_nslookup_command=$withval)
  1087. if test -n "$ac_cv_nslookup_command"; then
  1088. AC_MSG_RESULT([(command line) $ac_cv_nslookup_command])
  1089. else
  1090. AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
  1091. if test -n "$PATH_TO_NSLOOKUP"
  1092. then
  1093. if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
  1094. then
  1095. ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
  1096. AC_MSG_RESULT([$ac_cv_nslookup_command])
  1097. else
  1098. ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
  1099. AC_MSG_RESULT([$ac_cv_nslookup_command])
  1100. fi
  1101. else
  1102. AC_MSG_WARN([nslookup command not found])
  1103. fi
  1104. fi
  1105. if test -n "$ac_cv_nslookup_command"; then
  1106. EXTRAS="$EXTRAS check_dns"
  1107. AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
  1108. fi
  1109. AC_PATH_PROG(PATH_TO_HOST,host)
  1110. if test -n "$ac_cv_path_PATH_TO_HOST"
  1111. then
  1112. EXTRAS="$EXTRAS check_dns"
  1113. fi
  1114. AC_PATH_PROG(PATH_TO_UPTIME,uptime)
  1115. AC_ARG_WITH(uptime_command,
  1116. ACX_HELP_STRING([--with-uptime-command=PATH],
  1117. [sets path to uptime]), PATH_TO_UPTIME=$withval)
  1118. AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
  1119. AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
  1120. AC_ARG_WITH(rpcinfo_command,
  1121. ACX_HELP_STRING([--with-rpcinfo-command=PATH],
  1122. [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
  1123. AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
  1124. AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
  1125. AC_ARG_WITH(ntpdate_command,
  1126. ACX_HELP_STRING([--with-ntpdate-command=PATH],
  1127. [sets path to ntpdate]), PATH_TO_NTPDATE=$withval)
  1128. AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
  1129. AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
  1130. if (test -n "$PATH_TO_NTPDATE" || test -n "$PATH_TO_NTPQ")
  1131. then
  1132. AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
  1133. AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
  1134. else
  1135. AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
  1136. fi
  1137. AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
  1138. if test -x "$PATH_TO_LMSTAT"
  1139. then
  1140. AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
  1141. else
  1142. AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
  1143. fi
  1144. AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
  1145. AC_ARG_WITH(smbclient_command,
  1146. ACX_HELP_STRING([--with-smbclient-command=PATH],
  1147. [sets path to smbclient]),
  1148. PATH_TO_SMBCLIENT=$withval)
  1149. if test -n "$PATH_TO_SMBCLIENT"
  1150. then
  1151. AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
  1152. else
  1153. AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
  1154. fi
  1155. AC_PATH_PROG(PATH_TO_WHO,who)
  1156. if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
  1157. then
  1158. ac_cv_path_to_who="$PATH_TO_WHO -q"
  1159. else
  1160. ac_cv_path_to_who="$PATH_TO_WHO"
  1161. fi
  1162. AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
  1163. [path and arguments for invoking 'who'])
  1164. AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
  1165. AC_ARG_WITH(snmpget_command,
  1166. ACX_HELP_STRING([--with-snmpget-command=PATH],
  1167. [Path to snmpget command]),
  1168. PATH_TO_SNMPGET=$withval)
  1169. if test -n "$PATH_TO_SNMPGET"
  1170. then
  1171. AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
  1172. EXTRAS="$EXTRAS check_hpjd check_snmp"
  1173. else
  1174. AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
  1175. fi
  1176. AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
  1177. AC_ARG_WITH(snmpgetnext_command,
  1178. ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
  1179. [Path to snmpgetnext command]),
  1180. PATH_TO_SNMPGETNEXT=$withval)
  1181. if test -n "$PATH_TO_SNMPGETNEXT"
  1182. then
  1183. AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
  1184. fi
  1185. if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
  1186. then
  1187. AC_MSG_CHECKING(for Net::SNMP perl module)
  1188. AC_MSG_RESULT([found])
  1189. else
  1190. AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
  1191. fi
  1192. AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
  1193. AC_PATH_PROG(PATH_TO_QSTAT,qstat)
  1194. AC_ARG_WITH(qstat_command,
  1195. ACX_HELP_STRING([--with-qstat-command=PATH],
  1196. [Path to qstat command]), PATH_TO_QSTAT=$withval)
  1197. if test -x "$PATH_TO_QUAKESTAT"
  1198. then
  1199. ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
  1200. EXTRAS="$EXTRAS check_game"
  1201. elif test -n "$PATH_TO_QSTAT"
  1202. then
  1203. ac_cv_path_to_qstat="$PATH_TO_QSTAT"
  1204. EXTRAS="$EXTRAS check_game"
  1205. else
  1206. AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
  1207. fi
  1208. if test $ac_cv_path_to_qstat
  1209. then
  1210. AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
  1211. [path to qstat/quakestat])
  1212. fi
  1213. AC_PATH_PROG(PATH_TO_FPING,fping)
  1214. AC_ARG_WITH(fping_command,
  1215. ACX_HELP_STRING([--with-fping-command=PATH],
  1216. [Path to fping command]), PATH_TO_FPING=$withval)
  1217. if test -n "$PATH_TO_FPING"
  1218. then
  1219. AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
  1220. EXTRAS="$EXTRAS check_fping"
  1221. else
  1222. AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
  1223. fi
  1224. AC_PATH_PROG(PATH_TO_SSH,ssh)
  1225. AC_ARG_WITH(ssh_command,
  1226. ACX_HELP_STRING([--with-ssh-command=PATH],
  1227. [sets path for ssh]), PATH_TO_SSH=$withval)
  1228. if test -n "$PATH_TO_SSH"
  1229. then
  1230. AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
  1231. EXTRAS="$EXTRAS check_by_ssh"
  1232. else
  1233. AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
  1234. fi
  1235. AC_PATH_PROG(PATH_TO_MAILQ,mailq)
  1236. AC_ARG_WITH(mailq_command,
  1237. ACX_HELP_STRING([--with-mailq-command=PATH],
  1238. [sets path to mailq]), PATH_TO_MAILQ=$withval)
  1239. if test -n "$PATH_TO_MAILQ"
  1240. then
  1241. AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
  1242. else
  1243. AC_MSG_WARN([Could not find mailq or eqivalent])
  1244. fi
  1245. AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
  1246. if test -x "$PATH_TO_QMAIL_QSTAT"
  1247. then
  1248. AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
  1249. else
  1250. AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
  1251. fi
  1252. dnl SWAP info required is amount allocated/available and amount free
  1253. dnl The plugin works through all the swap devices and adds up the total swap
  1254. dnl available.
  1255. AC_PATH_PROG(PATH_TO_SWAP,swap)
  1256. if (test -n "$PATH_TO_SWAP")
  1257. then
  1258. AC_MSG_CHECKING([for $PATH_TO_SWAP format])
  1259. if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
  1260. then
  1261. ac_cv_have_swap=yes
  1262. ac_cv_swap_command="$PATH_TO_SWAP -l"
  1263. if [$PATH_TO_SWAP -l 2>/dev/null | \
  1264. egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
  1265. >/dev/null]
  1266. then
  1267. ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
  1268. ac_cv_swap_conv=2048
  1269. AC_MSG_RESULT([using IRIX format swap])
  1270. elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
  1271. then
  1272. ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
  1273. ac_cv_swap_conv=2048
  1274. AC_MSG_RESULT([using Unixware format swap])
  1275. else
  1276. dnl if we don't know what format swap's output is
  1277. dnl we might as well pretend we didn't see it
  1278. ac_cv_have_swap=""
  1279. ac_cv_swap_command=""
  1280. fi
  1281. fi
  1282. dnl end if for PATH_TO_SWAP
  1283. fi
  1284. AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
  1285. if (test -n "$PATH_TO_SWAPINFO")
  1286. then
  1287. AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
  1288. if [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
  1289. then
  1290. ac_cv_have_swap=yes
  1291. ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
  1292. if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
  1293. then
  1294. ac_cv_swap_format=["%*s %f %*d %f"]
  1295. ac_cv_swap_conv=1024
  1296. AC_MSG_RESULT([using FreeBSD format swapinfo])
  1297. fi
  1298. elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
  1299. then
  1300. ac_cv_have_swap=yes
  1301. ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM",
  1302. ac_cv_swap_format=["%*s %f %*d %f"]
  1303. ac_cv_swap_conv=1024
  1304. AC_MSG_RESULT([using HP-UX format swapinfo])
  1305. fi
  1306. dnl end if for PATH_TO_SWAPINFO
  1307. fi
  1308. AC_PATH_PROG(PATH_TO_LSPS,lsps)
  1309. if (test -n "$PATH_TO_LSPS")
  1310. then
  1311. AC_MSG_CHECKING([for $PATH_TO_LSPS format])
  1312. if [$PATH_TO_LSPS -a 2>/dev/null | egrep -i "^Page Space" > /dev/null]
  1313. then
  1314. ac_cv_have_swap=yes
  1315. ac_cv_swap_command="$PATH_TO_LSPS -a"
  1316. ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
  1317. ac_cv_swap_conv=1
  1318. AC_MSG_RESULT([using AIX lsps])
  1319. fi
  1320. dnl end if for PATH_TO_SWAPINFO
  1321. fi
  1322. dnl
  1323. dnl test for swapctl system call, both the 2-arg and 3-arg variants
  1324. dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
  1325. dnl in the various BSD's
  1326. dnl
  1327. AC_CHECK_HEADERS([sys/stat.h sys/param.h])
  1328. AC_CHECK_HEADERS([sys/swap.h], [], [], [
  1329. #ifdef HAVE_SYS_PARAM_H
  1330. #include <sys/param.h>
  1331. #endif
  1332. ])
  1333. AC_CHECK_DECLS([swapctl],,,[
  1334. #include <unistd.h>
  1335. #include <sys/types.h>
  1336. #include <sys/param.h>
  1337. #include <sys/stat.h>
  1338. #include <sys/swap.h>
  1339. ])
  1340. AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
  1341. #include <sys/types.h>
  1342. #include <sys/param.h>
  1343. #include <sys/stat.h>
  1344. #include <sys/swap.h>
  1345. ])
  1346. AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
  1347. #include <unistd.h>
  1348. #include <sys/types.h>
  1349. #include <sys/param.h>
  1350. #include <sys/stat.h>
  1351. #include <sys/swap.h>
  1352. ])
  1353. if test "$ac_cv_have_decl_swapctl" = "yes";
  1354. then
  1355. EXTRAS="$EXTRAS check_swap"
  1356. AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
  1357. if test "$ac_cv_type_swaptbl_t" = "yes" -a \
  1358. "$ac_cv_type_swapent_t" = "yes";
  1359. then
  1360. AC_MSG_RESULT([yes])
  1361. ac_cv_check_swap_swapctl_svr4="1";
  1362. AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
  1363. [Define if 2-argument SVR4 swapctl exists])
  1364. else
  1365. AC_MSG_RESULT([no])
  1366. AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
  1367. if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
  1368. then
  1369. AC_MSG_RESULT([yes])
  1370. AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
  1371. [Define if 3-argument BSD swapctl exists])
  1372. else
  1373. AC_MSG_RESULT([no])
  1374. fi
  1375. fi
  1376. AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
  1377. if test "$ac_cv_check_swap_swapctl_svr4" = "1";
  1378. then
  1379. dnl
  1380. dnl the SVR4 spec returns values in pages
  1381. dnl
  1382. AC_MSG_RESULT([page])
  1383. AC_CHECK_DECLS([sysconf])
  1384. AC_MSG_CHECKING([for system page size])
  1385. if test "$ac_cv_have_decl_sysconf" = "yes";
  1386. then
  1387. AC_MSG_RESULT([determined by sysconf(3)])
  1388. ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
  1389. else
  1390. AC_MSG_WARN([don't know. guessing 4096k])
  1391. ac_cv_swap_conv=256
  1392. fi
  1393. else
  1394. dnl
  1395. dnl the BSD spec returns values in blocks
  1396. dnl
  1397. AC_MSG_RESULT([blocks (assuming 512b)])
  1398. ac_cv_swap_conv=2048
  1399. fi
  1400. AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
  1401. [Conversion factor to MB])
  1402. fi
  1403. dnl
  1404. dnl end tests for the swapctl system calls
  1405. dnl
  1406. if test "x$ac_cv_have_swap" != "x"
  1407. then
  1408. AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
  1409. EXTRAS="$EXTRAS check_swap"
  1410. fi
  1411. if test "x$ac_cv_swap_command" != "x"
  1412. then
  1413. AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
  1414. [Path to swap/swapinfo binary, with any args])
  1415. AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
  1416. [Format string for parsing swap output])
  1417. AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
  1418. [Conversion factor to MB])
  1419. fi
  1420. AC_ARG_WITH(proc-meminfo,
  1421. ACX_HELP_STRING([--with-proc-meminfo=PATH],
  1422. [path to /proc/meminfo or equivalent]),
  1423. ac_cv_proc_meminfo=$withval)
  1424. dnl dunno why this does not work below - use hack (kbd)
  1425. dnl fine on linux, broken on solaris
  1426. dnl if /bin/test -e "/proc/meminfo"
  1427. AC_MSG_CHECKING([for /proc/meminfo])
  1428. if test -n "$ac_cv_proc_meminfo"; then
  1429. AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
  1430. elif [cat /proc/meminfo > /dev/null 2>&1]; then
  1431. AC_MSG_RESULT([found /proc/meminfo])
  1432. ac_cv_proc_meminfo="/proc/meminfo"
  1433. else
  1434. AC_MSG_RESULT([no])
  1435. fi
  1436. if test -n "$ac_cv_proc_meminfo"; then
  1437. AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
  1438. AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
  1439. EXTRAS="$EXTRAS check_swap"
  1440. fi
  1441. AC_PATH_PROG(PATH_TO_DIG,dig)
  1442. AC_ARG_WITH(dig_command,
  1443. ACX_HELP_STRING([--with-dig-command=PATH],
  1444. [Path to dig command]), PATH_TO_DIG=$withval)
  1445. if test -n "$PATH_TO_DIG"; then
  1446. EXTRAS="$EXTRAS check_dig"
  1447. AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
  1448. fi
  1449. if test -f plugins/check_nt.c ; then
  1450. EXTRAS="$EXTRAS check_nt"
  1451. elif test -f ../plugins/check_nt.c ; then
  1452. EXTRAS="$EXTRAS check_nt"
  1453. fi
  1454. AC_MSG_CHECKING(for va_list)
  1455. AC_TRY_COMPILE([#ifdef __STDC__
  1456. #include <stdio.h>
  1457. #include <stdlib.h>
  1458. #include <stdarg.h>
  1459. #else
  1460. #include <sys/types.h>
  1461. #include <stdio.h>
  1462. #include <varargs.h>
  1463. #endif],
  1464. [va_list args;],
  1465. [AC_MSG_RESULT(yes)],
  1466. [NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
  1467. case $host in
  1468. *bsd*)
  1469. AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
  1470. ;;
  1471. *linux*)
  1472. AC_DEFINE(__linux__,1,[sun specific code in check_dhcp.c])
  1473. ;;
  1474. *sun* | solaris*)
  1475. AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
  1476. ;;
  1477. *hpux*)
  1478. AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
  1479. ;;
  1480. esac
  1481. AC_SUBST(EXTRAS)
  1482. AC_SUBST(EXTRA_NETOBJS)
  1483. AC_SUBST(DEPLIBS)
  1484. AM_GNU_GETTEXT([no-libtool], [need-ngettext])
  1485. AM_GNU_GETTEXT_VERSION(0.11.5)
  1486. dnl Check for Redhat spopen problem
  1487. dnl Wierd problem where ECHILD is returned from a wait call in error
  1488. dnl Only appears to affect nslookup and dig calls. Only affects redhat around
  1489. dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
  1490. dnl We patch plugins/popen.c
  1491. dnl Need to add smp because uname different on those
  1492. dnl Can force patch to be applied with --enable-redhat-pthread-workaround
  1493. AC_ARG_ENABLE(redhat-pthread-workaround,
  1494. AC_HELP_STRING([--enable-redhat-pthread-workaround],
  1495. [force Redhat patch to be applied (default: test system)]),
  1496. [ac_cv_enable_redhat_pthread_workaround=$enableval],
  1497. [ac_cv_enable_redhat_pthread_workaround=test])
  1498. if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
  1499. if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then
  1500. AC_MSG_CHECKING(for redhat spopen problem)
  1501. ( cd config_test && make && make test ) > /dev/null 2>&1
  1502. if test $? -eq 0 ; then
  1503. AC_MSG_RESULT(okay)
  1504. else
  1505. AC_MSG_RESULT(error)
  1506. AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
  1507. fi
  1508. fi
  1509. elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
  1510. AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
  1511. fi
  1512. dnl External libraries - see ACKNOWLEDGEMENTS
  1513. np_COREUTILS
  1514. np_CURL
  1515. AC_OUTPUT(
  1516. Makefile
  1517. lib/Makefile
  1518. m4/Makefile
  1519. plugins/Makefile
  1520. plugins/tests/Makefile
  1521. plugins-root/Makefile
  1522. plugins-scripts/Makefile
  1523. plugins-scripts/subst
  1524. plugins-scripts/utils.pm
  1525. plugins-scripts/utils.sh
  1526. command.cfg
  1527. test.pl
  1528. pkg/solaris/pkginfo
  1529. intl/Makefile
  1530. po/Makefile.in
  1531. )
  1532. dnl the ones below that are commented out need to be cleaned up
  1533. dnl in the configure code above to use with_foo instead of ac_cv_foo
  1534. dnl if we want them to show up here. it'd also make the code cleaner.
  1535. dnl i'll get to that on another rainy day :) -sf
  1536. dnl ACX_FEATURE([with],[dig-command])
  1537. dnl ACX_FEATURE([with],[fping-command])
  1538. dnl ACX_FEATURE([with],[mailq-command])
  1539. dnl ACX_FEATURE([with],[nslookup-command])
  1540. dnl ACX_FEATURE([with],[ntpdate-command])
  1541. ACX_FEATURE([with],[ping6-command])
  1542. ACX_FEATURE([with],[ping-command])
  1543. dnl ACX_FEATURE([with],[qstat-command])
  1544. dnl ACX_FEATURE([with],[rpcinfo-command])
  1545. dnl ACX_FEATURE([with],[smbclient-command])
  1546. dnl ACX_FEATURE([with],[snmpget-command])
  1547. dnl ACX_FEATURE([with],[snmpgetnext-command])
  1548. dnl ACX_FEATURE([with],[ssh-command])
  1549. dnl ACX_FEATURE([with],[uptime-command])
  1550. dnl ACX_FEATURE([with],[proc-loadavg])
  1551. dnl ACX_FEATURE([with],[proc-meminfo])
  1552. dnl ACX_FEATURE([with],[ps-command])
  1553. dnl ACX_FEATURE([with],[ps-format])
  1554. dnl ACX_FEATURE([with],[ps-cols])
  1555. dnl ACX_FEATURE([with],[ps-varlist])
  1556. ACX_FEATURE([with],[lwres])
  1557. ACX_FEATURE([with],[ipv6])
  1558. ACX_FEATURE([with],[openssl])
  1559. ACX_FEATURE([with],[gnutls])
  1560. ACX_FEATURE([enable],[emulate-getaddrinfo])
  1561. ACX_FEATURE([with],[perl])
  1562. ACX_FEATURE([with],[cgiurl])
  1563. ACX_FEATURE([with],[nagios-user])
  1564. ACX_FEATURE([with],[nagios-group])
  1565. ACX_FEATURE([with],[trusted-path])