configure.in 47 KB

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