configure.in 60 KB

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