summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorEthan Galstad <egalstad@users.sourceforge.net>2002-02-28 06:42:51 (GMT)
committerEthan Galstad <egalstad@users.sourceforge.net>2002-02-28 06:42:51 (GMT)
commit44a321cb8a42d6c0ea2d96a1086a17f2134c89cc (patch)
treea1a4d9f7b92412a17ab08f34f04eec45433048b7 /configure.in
parent54fd5d7022ff2d6a59bc52b8869182f3fc77a058 (diff)
downloadmonitoring-plugins-44a321cb8a42d6c0ea2d96a1086a17f2134c89cc.tar.gz
Initial revision
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in748
1 files changed, 748 insertions, 0 deletions
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..b2df783
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,748 @@
1dnl Process this file with autoconf to produce a configure script.
2include(`aclocal.m4')
3AC_REVISION ($Revision$)
4AC_INIT(package.def)
5VERSION=`cat $srcdir/package.def|sed -e 's/PACKAGE_RELEASE= *"//;s/"//'`
6PACKAGE=nagios-plugins
7dnl AM_INIT_AUTOMAKE(nagios-plugins,$VERSION)
8AM_CONFIG_HEADER(plugins/config.h plugins/common.h plugins/version.h plugins/netutils.h plugins/utils.h plugins/popen.h)
9
10AC_PREFIX_DEFAULT(/usr/local/nagios)
11
12dnl Figure out how to invoke "install" and what install options to use.
13
14AC_PROG_INSTALL
15AC_SUBST(INSTALL)
16
17AC_PROG_RANLIB
18
19AC_PATH_PROG(ACLOCAL,aclocal)
20AC_PATH_PROG(AUTOMAKE,automake)
21AC_PATH_PROG(AUTOCONF,autoconf)
22AC_PATH_PROG(AUTOHEADER,autoheader)
23
24PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
25AC_SUBST(PLUGIN_TEST)dnl
26
27SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
28AC_SUBST(SCRIPT_TEST)dnl
29
30WARRANTY="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"
31AC_SUBST(WARRANTY)
32
33SUPPORT="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\n"
34AC_SUBST(SUPPORT)
35
36AC_ARG_PROGRAM
37
38dnl AC_ARG_WITH(nonposix_state_defs,--with-nonposix-state-defs uses POSIXLY incorrect states for netsaint < 0.0.7b2,,AC_DEFINE(POSIX_STATE_DEFS))
39
40AC_ARG_WITH(cgiurl,--with-cgiurl=<dir> sets URL for cgi programs,cgiurl=$withval,cgiurl=/cgi-bin/nagios)
41CGIURL="$cgiurl"
42AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL")
43
44AC_ARG_WITH(nagios_user,--with-nagios-user=<user> sets user name to run nagios,nagios_usr=$withval,nagios_usr=nagios)
45AC_ARG_WITH(nagios_group,--with-nagios-group=<group> sets group name to run nagios,nagios_grp=$withval,nagios_grp=nagios)
46AC_SUBST(nagios_usr)
47AC_SUBST(nagios_grp)
48INSTALL_OPTS="-o $nagios_usr -g $nagios_grp"
49AC_SUBST(INSTALL_OPTS)
50
51AC_ARG_WITH(trusted_path,--with-trusted-path=/bin:/sbin:/usr/bin:/usr/sbin sets trusted path for executables called by scripts,trusted_path=$withval,trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
52AC_SUBST(trusted_path)
53
54EXTRAS=
55PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
56
57LDFLAGS="$LDFLAGS -L."
58
59dnl Checks for programs.
60AC_PROG_CC
61AC_PROG_MAKE_SET
62AC_PROG_AWK
63
64AC_PATH_PROG(PYTHON,python)
65AC_PATH_PROG(PERL,perl)
66AC_PATH_PROG(SH,sh)
67
68AC_PATH_PROG(HOSTNAME,hostname)
69AC_PATH_PROG(BASENAME,basename)
70
71
72dnl
73dnl Checks for libraries.
74dnl
75
76AC_FUNC_GETLOADAVG
77
78AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
79AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
80AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
81AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
82AC_SUBST(SOCKETLIBS)
83
84dnl Check for PostgreSQL libraries
85_SAVEDLIBS="$LIBS"
86_SAVEDCPPFLAGS="$CPPFLAGS"
87AC_ARG_WITH(pgsql,--with-pgsql=<dir> sets path to pgsql installation,[PGSQL=$withval])
88AC_CHECK_LIB(crypt,main)
89if test "$ac_cv_lib_crypt_main" = "yes"; then
90 if test -n "$PGSQL"; then
91 LIBS="$LIBS -L$PGSQL/lib"
92 CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
93 fi
94 AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
95 if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
96 AC_CHECK_HEADERS(pgsql/libpq-fe.h)
97 AC_CHECK_HEADERS(postgresql/libpq-fe.h)
98 AC_CHECK_HEADERS(libpq-fe.h)
99 if test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
100 PGLIBS="-lpq -lcrypt"
101 PGINCLUDE="-I/usr/include/pgsql"
102 elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
103 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
104 PGINCLUDE="-I/usr/include/postgresql"
105 elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
106 PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
107 PGINCLUDE="-I$PGSQL/include"
108 fi
109 if test -z "$PGINCLUDE"; then
110 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
111 AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see Requirements).])
112 else
113 AC_SUBST(PGLIBS)
114 AC_SUBST(PGINCLUDE)
115 EXTRAS="$EXTRAS check_pgsql"
116 fi
117 else
118 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
119 AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
120 AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see Requirements).])
121 fi
122else
123 AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
124 AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see Requirements).])
125fi
126LIBS="$_SAVEDLIBS"
127CPPFLAGS="$_SAVEDCPPFLAGS"
128
129dnl Check for radius libraries
130_SAVEDLIBS="$LIBS"
131AC_CHECK_LIB(radiusclient,rc_read_config)
132if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
133 EXTRAS="$EXTRAS check_radius"
134 RADIUSLIBS="-lradiusclient"
135 AC_SUBST(RADIUSLIBS)
136else
137 AC_MSG_WARN([Skipping radius plugin])
138 AC_MSG_WARN([install radius libs to compile this plugin (see Requirements).])
139fi
140LIBS="$_SAVEDLIBS"
141
142dnl Check for LDAP libraries
143_SAVEDLIBS="$LIBS"
144AC_CHECK_LIB(ldap,main,,,-llber)
145if test "$ac_cv_lib_ldap_main" = "yes"; then
146 LDAPLIBS="-lldap -llber"\
147 LDAPINCLUDE="-I/usr/include/ldap"
148 AC_SUBST(LDAPLIBS)
149 AC_SUBST(LDAPINCLUDE)
150 EXTRAS="$EXTRAS check_ldap"
151else
152 AC_MSG_WARN([Skipping LDAP plugin])
153 AC_MSG_WARN([install LDAP libs to compile this plugin (see Requirements).])
154fi
155LIBS="$_SAVEDLIBS"
156
157dnl Check for mysql libraries
158_SAVEDLIBS="$LIBS"
159_SAVEDCPPFLAGS="$CPPFLAGS"
160CPPFLAGS="-I/usr/include"
161AC_ARG_WITH(mysqllibdir,--with-mysqllibdir=<dir> sets path to mysql libraries,[MYSQLLIBDIR=$withval])
162if test -n "$MYSQLLIBS"; then
163 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR",,-L$MYSQLLIBDIR -lz)
164elif test -f /usr/lib/libmysqlclient.so; then
165 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
166 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
167elif test -f /usr/lib/libmysqlclient.a; then
168 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
169 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
170elif test -f /usr/lib/mysql/libmysqlclient.so; then
171 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
172 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
173elif test -f /usr/lib/mysql/libmysqlclient.a; then
174 AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
175 AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
176fi
177if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
178 AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h)
179 if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
180 EXTRAS="$EXTRAS check_mysql"
181 AC_SUBST(MYSQLLIBS)
182 AC_SUBST(check_mysql_LDFLAGS)
183 else
184 AC_MSG_WARN([Skipping mysql plugin])
185 AC_MSG_WARN([install mysql client headers to compile this plugin (see Requirements).])
186 fi
187else
188 AC_MSG_WARN([Skipping mysql plugin])
189 AC_MSG_WARN([install mysql client libs to compile this plugin (see Requirements).])
190fi
191LIBS="$_SAVEDLIBS"
192CPPFLAGS="$_SAVEDCPPFLAGS"
193
194dnl Check for OpenSSL location
195AC_PATH_PROG(OPENSSL,openssl)
196if test "$OPENSSL" = "/usr/bin/openssl"; then
197 OPENSSL=/usr
198elif test "$OPENSSL" = "/usr/sbin/openssl"; then
199 OPENSSL=/usr
200elif test "$OPENSSL" = "/opt/bin/openssl"; then
201 OPENSSL=/opt
202elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then
203 OPENSSL=/opt/openssl
204elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then
205 OPENSSL=/usr/slocal
206elif test "$OPENSSL" = "/usr/local/bin/openssl"; then
207 OPENSSL=/usr/local
208elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
209 OPENSSL=/usr/local/ssl
210fi
211AC_ARG_WITH(openssl,--with-openssl=<dir> sets path to openssl installation,[OPENSSL=$withval])
212
213dnl Check for OpenSSL header files
214_SAVEDCPPFLAGS="$CPPFLAGS"
215FOUNDINCLUDE=yes
216CPPFLAGS="-I$OPENSSL/include"
217AC_CHECK_HEADERS(openssl/x509.h openssl/ssl.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,SSLINCLUDE="-I$OPENSSL/include",FOUNDINCLUDE=no)
218if test "$FOUNDINCLUDE" = "no"; then
219 FOUNDINCLUDE=yes
220 AC_CHECK_HEADERS(x509.h ssl.h rsa.h pem.h crypto.h err.h,SSLINCLUDE="-I$OPENSSL/include",FOUNDINCLUDE=no)
221fi
222AC_SUBST(SSLINCLUDE)
223CPPFLAGS="$_SAVEDCPPFLAGS $SSLINCLUDE"
224
225dnl Check for crypto lib
226_SAVEDLIBS="$LIBS"
227AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib)
228if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
229 dnl Check for SSL lib
230 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)
231fi
232LIBS="$_SAVEDLIBS"
233
234dnl test headers and libs to decide whether check_http should use SSL
235if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
236 if test "$ac_cv_lib_ssl_main" = "yes"; then
237 if test "$FOUNDINCLUDE" = "yes"; then
238 AC_SUBST(SSLLIBS)
239 AC_DEFINE(HAVE_SSL)
240 fi
241 fi
242fi
243CPPFLAGS="$_SAVEDCPPFLAGS"
244
245dnl
246dnl Checks for header files.
247dnl
248
249AC_HEADER_STDC
250AC_HEADER_TIME
251AC_HEADER_SYS_WAIT
252AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h unistd.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h)
253
254dnl Checks for typedefs, structures, and compiler characteristics.
255AC_C_CONST
256AC_STRUCT_TM
257AC_TYPE_PID_T
258AC_TYPE_SIZE_T
259AC_TYPE_SIGNAL
260
261dnl EXTRA_LIBRARIES="libgetopt.a libsnprintf.a"
262dnl noinst_LIBRARIES="libgetopt.a libsnprintf.a"
263dnl libgetopt_a_SOURCES="getopt.c getopt1.c"
264dnl libgetopt_a_DEPENDENCIES=getopt.h
265dnl libsnprintf_a_SOURCES=snprintf.c
266dnl AC_SUBST(noinst_LIBRARIES)
267dnl AC_SUBST(libgetopt_a_SOURCES)
268dnl AC_SUBST(libgetopt_a_DEPENDENCIES)
269dnl AC_SUBST(libsnprintf_a_SOURCES)
270
271AC_MSG_CHECKING(for getopt_long)
272AC_TRY_COMPILE([#include <getopt.h>
273#include <stdlib.h>],
274[int option_index=0;
275static struct option *long_options;
276getopt_long(0,NULL,"+h",long_options,&option_index);],
277[AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(yes)],
278[AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(no) import_sources=getopt])
279
280AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a")
281
282AC_CHECK_FUNC(vsnprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a")
283
284dnl Checks for library functions.
285AC_CHECK_FUNCS(select socket strdup strstr strtod strtol strtoul)
286
287AC_MSG_CHECKING(for type of socket size)
288AC_TRY_COMPILE([#include <stdlib.h>
289#include <sys/types.h>
290#include <sys/socket.h>
291],
292[int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
293[AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)],
294[AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)])
295
296if test -f "/proc/loadavg"
297then
298 AC_DEFINE(HAVE_PROC_LOADAVG)
299 AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg")
300fi
301
302AC_PATH_PROG(PATH_TO_PS,ps)
303dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
304dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
305if [ps -axo 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i "^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null]
306then
307 AC_DEFINE(USE_PS_VARS)
308 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
309 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -axo 'stat user ppid args'")
310 EXTRAS="$EXTRAS check_nagios"
311 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -axo 'stat uid ppid comm args'")
312 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
313 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -axo 'vsz comm'")
314 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
315 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -axo 'rss comm'")
316 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
317 echo " ps syntax... $PATH_TO_PS -eo 'stat comm vsz rss user ppid args'"
318elif [ps -eo 's comm vsz rss user uid ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null]
319then
320 AC_DEFINE(USE_PS_VARS)
321 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
322 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -eo 's user ppid args'")
323 EXTRAS="$EXTRAS check_nagios"
324 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -eo 's uid ppid comm args'")
325 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
326 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -eo 'vsz comm'")
327 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
328 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -eo 'rss comm'")
329 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
330 echo " ps syntax... $PATH_TO_PS -eo 's comm vsz rss user ppid args'"
331elif [ps -Ao 's comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null]
332then
333 AC_DEFINE(USE_PS_VARS)
334 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
335 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -Ao 's user ppid args'")
336 EXTRAS="$EXTRAS check_nagios"
337 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Ao 's uid ppid comm args'")
338 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
339 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'")
340 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
341 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'")
342 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
343 echo " ps syntax... $PATH_TO_PS -Ao 's comm vsz rss'"
344elif [ps -Ao 'status comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null]
345then
346 AC_DEFINE(USE_PS_VARS)
347 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
348 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -Ao 'status user ppid args'")
349 EXTRAS="$EXTRAS check_nagios"
350 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Ao 'status uid ppid comm args'")
351 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
352 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'")
353 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
354 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'")
355 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
356 echo " ps syntax... $PATH_TO_PS -Ao 'status comm vsz rss'"
357elif [ps -Ao 'state comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null]
358then
359 AC_DEFINE(USE_PS_VARS)
360 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
361 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -Ao 'state user ppid args'")
362 EXTRAS="$EXTRAS check_nagios"
363 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Ao 'state uid ppid comm args'")
364 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
365 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'")
366 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
367 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'")
368 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
369 echo " ps syntax... $PATH_TO_PS -Ao 'state comm vsz rss'"
370elif [ps -ao 'state command vsz rss user ppid args' 2>/dev/null | egrep -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null]
371then
372 AC_DEFINE(USE_PS_VARS)
373 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
374 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -ao 'state user ppid args'")
375 EXTRAS="$EXTRAS check_nagios"
376 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -ao 'state uid ppid command args'")
377 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
378 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -ao 'vsz command'")
379 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
380 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -ao 'rss command'")
381 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
382 echo " ps syntax... $PATH_TO_PS -ao 'state command vsz rss'"
383dnl FreeBSD
384elif [ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i "^STAT +COMMAND +VSZ +RSS +UID +USER +PPID" >/dev/null]
385then
386 AC_DEFINE(USE_PS_VARS)
387 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
388 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS waxo 'state uid ppid command'")
389 EXTRAS="$EXTRAS check_nagios"
390 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS waxco 'state uid ppid command command'")
391 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
392 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS waxco 'vsz command'")
393 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
394 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxco 'rss command'")
395 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
396 echo " ps syntax... $PATH_TO_PS -Ao 'state command vsz rss'"
397dnl BSD-like mode in RH 6.1
398elif [ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null]
399then
400 AC_DEFINE(USE_PS_VARS)
401 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
402 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS waxno 'state user ppid comm'")
403 EXTRAS="$EXTRAS check_nagios"
404 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS waxno 'state uid ppid comm args'")
405 AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
406 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS waxno 'vsz comm'")
407 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
408 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxno 'rss comm'")
409 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
410 echo " ps syntax... $PATH_TO_PS -waxco 'state comm vsz rss'"
411dnl IRIX 53
412elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null]
413then
414 AC_DEFINE(USE_PS_VARS)
415 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog])
416 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -el")
417 AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s")
418 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -el")
419 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %d")
420 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -el")
421 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d")
422 echo " ps syntax... $PATH_TO_PS -el"
423dnl IRIX 63
424elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null]
425then
426 AC_DEFINE(USE_PS_VARS)
427 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog])
428 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -el")
429 AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s")
430 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -el")
431 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %d")
432 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -el")
433 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %d")
434 echo " ps syntax... $PATH_TO_PS -el"
435dnl SunOS 4.1.3:
436dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
437dnl
438elif [ps -laxnwww 2>/dev/null | egrep -i "^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND" >/dev/null]
439then
440 AC_DEFINE(USE_PS_VARS)
441 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww")
442 EXTRAS="$EXTRAS check_nagios"
443 AC_DEFINE_UNQUOTED(PS_VARLIST,[&procuid,&procppid,procstat,&pos,procprog])
444 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -laxnwww")
445 AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %d %*s %d %*s %*s %*s %*s %*s %*s %s %*s %*s %n%s")
446 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS laxnwww")
447 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %d")
448 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS laxnwww")
449 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %d")
450 echo " ps syntax... $PATH_TO_PS laxnwww"
451dnl Debian Linux / procps v1.2.9:
452dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
453dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
454dnl
455elif [ps laxnwww 2>/dev/null | egrep -i "^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND" >/dev/null]
456then
457 AC_DEFINE(USE_PS_VARS)
458 AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS laxnwww")
459 EXTRAS="$EXTRAS check_nagios"
460 AC_DEFINE_UNQUOTED(PS_VARLIST,[&procuid,&procppid,procstat,&pos,procprog])
461 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS laxnwww")
462 AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %d %*s %d %*s %*s %*s %*s %*s %s %*s %*s %n%s")
463 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS laxnwww")
464 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %*s %*s %d")
465 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS laxnwww")
466 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %d")
467 echo " ps syntax... $PATH_TO_PS laxnwww"
468dnl
469dnl AIX 4.1:
470dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
471dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
472elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null]
473then
474 AC_DEFINE(USE_PS_VARS)
475 AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog])
476 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -el")
477 AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s")
478 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -el")
479 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %d")
480 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -el")
481 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %*s %*s %d")
482 echo " ps syntax... $PATH_TO_PS -el"
483dnl AIX?
484elif [ps glaxen 2>/dev/null | egrep -i "^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND" >/dev/null]
485then
486 AC_DEFINE(USE_PS_VARS)
487 AC_DEFINE_UNQUOTED(PS_VARLIST,[&procuid,&procppid,procstat,&pos,procprog])
488 AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS glaxen")
489 AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %d %*s %d %*s %*s %*s %*s %*s %s %*s %*s %n%s")
490 AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS glaxen")
491 AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %*s %*s %d")
492 AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS glaxen")
493 AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s %*s %d")
494 echo " ps syntax... $PATH_TO_PS glaxen"
495dnl ucb style?
496dnl elif [ps axun 2>/dev/null | egrep -i "^USER +PID +%CPU +%MEM +SIZE +RSS +TTY +STAT +START +TIME +COMMAND *$" >/dev/null]
497dnl then
498dnl AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS axun")
499dnl AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %*s %*s %*s %*s %*s %s %*s %*s %s")
500dnl AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS axun")
501dnl AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %d")
502dnl AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS axun")
503dnl AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %d")
504dnl echo " ps syntax... $PATH_TO_PS axun"
505dnl ucb style?
506dnl elif [ps axun 2>/dev/null | egrep -i "^USER +PID +%CPU +%MEM +SIZE +RSS +TTY +STAT +START +TIME +COMMAND" >/dev/null]
507dnl then
508dnl AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS axun")
509dnl AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %*s %*s %*s %*s %*s %s %*s %*s %s")
510dnl AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS axun")
511dnl AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %d")
512dnl AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS axun")
513dnl AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %d")
514dnl echo " ps syntax... $PATH_TO_PS axun"
515else
516 echo "** Unable to find usable ps syntax"
517fi
518
519AC_ARG_WITH(df_command,--with-df-command=<syntax> sets syntax for df,DF_COMMAND=$withval)
520if test -n "$DF_COMMAND"
521then
522 AC_DEFINE_UNQUOTED(DF_COMMAND,"$DF_COMMAND")
523elif [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]
524then
525 AC_PATH_PROG(PATH_TO_DF,df)
526 AC_MSG_RESULT(" df syntax... $PATH_TO_DF -Pk")
527 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -Pk")
528elif [df -k 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null]
529then
530 AC_PATH_PROG(PATH_TO_DF,df)
531 AC_MSG_RESULT(" df syntax... $PATH_TO_DF -k")
532 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF -k")
533elif [df 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null]
534then
535 AC_PATH_PROG(PATH_TO_DF,df)
536 AC_MSG_RESULT(" df syntax... $PATH_TO_DF")
537 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF")
538elif [bdf 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null]
539then
540 AC_PATH_PROG(PATH_TO_DF,bdf)
541 AC_MSG_RESULT(" df syntax... $PATH_TO_DF")
542 AC_DEFINE_UNQUOTED(DF_COMMAND,"$PATH_TO_DF")
543else
544 AC_MSG_WARN("unable to find usable df syntax")
545fi
546
547AC_PATH_PROG(PATH_TO_PING,ping)
548
549AC_ARG_WITH(ping_command,--with-ping-command=<syntax> sets syntax for ping,PING_COMMAND=$withval)
550if test -n "$PING_COMMAND"
551then
552 echo " ping syntax... (command-line) $PING_COMMAND"
553 if test -n "$PING_PACKETS_FIRST"
554 then
555 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND")
556 fi
557elif [ping -n -U -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
558then
559 PING_COMMAND="$PATH_TO_PING -n -U -c %d %s"
560 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND")
561 echo " ping syntax... $PATH_TO_PING -n -U -c <count> <host>"
562elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
563then
564 PING_COMMAND="$PATH_TO_PING -n -c %d %s"
565 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND")
566 echo " ping syntax... $PATH_TO_PING -n -c <count> <host>"
567elif [ping -n 127.0.0.1 -c 1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
568then
569 PING_COMMAND="$PATH_TO_PING -n %s -c %d"
570 echo " ping syntax... $PATH_TO_PING -n <host> -c <count>"
571elif [ping 127.0.0.1 -n 1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
572then
573 PING_COMMAND="$PATH_TO_PING %s -n %d"
574 echo " ping syntax... $PATH_TO_PING <host> -n <count>"
575elif [ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
576then
577 PING_COMMAND="$PATH_TO_PING -n -s %s 56 %d"
578 echo " ping syntax... $PATH_TO_PING -n -s <host> 56 <count>"
579elif [ping -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
580then
581 PING_COMMAND="$PATH_TO_PING -n -h %s -s 56 -c %d"
582 echo " ping syntax... $PATH_TO_PING -n -h <host> -s 56 -c <count>"
583elif [ping -n -s 56 -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
584then
585 PING_COMMAND="$PATH_TO_PING -n -s 56 -c %d %s"
586 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND")
587 echo " ping syntax... $PATH_TO_PING -n -s 56 -c <count> <host>"
588elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null]
589then
590 PING_COMMAND="$PATH_TO_PING -n -c %d %s"
591 AC_DEFINE_UNQUOTED(PING_PACKETS_FIRST,"$PING_COMMAND")
592 echo " ping syntax... $PATH_TO_PING -n -c <count> <host>"
593else
594 AC_MSG_WARN("unable to find usable ping syntax")
595fi
596AC_DEFINE_UNQUOTED(PING_COMMAND,"$PING_COMMAND")
597
598AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
599if test -n "$ac_cv_path_PATH_TO_NSLOOKUP"
600then
601 AC_MSG_CHECKING("nslookup syntax")
602 if [nslookup -sil 127.0.0.1 2>&1 | grep "*** Invalid option: sil" >/dev/null]
603 then
604 AC_MSG_RESULT("$PATH_TO_NSLOOKUP")
605 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP")
606 else
607 AC_MSG_RESULT("$PATH_TO_NSLOOKUP -sil")
608 AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$PATH_TO_NSLOOKUP -sil")
609 fi
610 EXTRAS="$EXTRAS check_dns"
611else
612 AC_MSG_WARN("nslookup command not found")
613fi
614
615AC_PATH_PROG(PATH_TO_UPTIME,uptime)
616AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME")
617
618AC_PATH_PROG(PATH_TO_WHO,who)
619if [who -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
620then
621 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO -q")
622else
623 AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO")
624fi
625
626AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
627if test -f "$PATH_TO_SNMPGET"
628then
629 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET")
630 EXTRAS="$EXTRAS check_hpjd check_snmp"
631else
632 echo "** Get snmpget from http://ucd-snmp.ucdavis.edu to make check_hpjd and check_snmp plugins"
633fi
634
635AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
636if test -f "$PATH_TO_SNMPGETNEXT"
637then
638 AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT")
639fi
640
641AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
642AC_PATH_PROG(PATH_TO_QSTAT,qstat)
643if test -n "$PATH_TO_QUAKESTAT"
644then
645 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$PATH_TO_QUAKESTAT")
646 EXTRAS="$EXTRAS check_game"
647elif test -n "$PATH_TO_QSTAT"
648then
649 AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$PATH_TO_QSTAT")
650 EXTRAS="$EXTRAS check_game"
651else
652 echo "** Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin"
653fi
654
655AC_PATH_PROG(PATH_TO_FPING,fping)
656if test -n "$PATH_TO_FPING"
657then
658 AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING")
659 EXTRAS="$EXTRAS check_fping"
660else
661 echo "** Get fping from http://www.stanford.edu/~schemers/docs/fping/fping.html in order to make check_fping plugin"
662fi
663
664AC_PATH_PROG(PATH_TO_SSH,ssh)
665if test -f "$PATH_TO_SSH"
666then
667 AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH")
668 EXTRAS="$EXTRAS check_by_ssh"
669else
670 echo "** Get ssh in order to make check_by_ssh plugin"
671fi
672
673dnl dunno why this does not work below - use hack (kbd)
674dnl fine on linux, broken on solaris
675dnl if /bin/test -e "/proc/meminfo"
676
677if [cat /proc/meminfo > /dev/null 2>&1]
678then
679 echo "found /proc/meminfo"
680 AC_DEFINE(HAVE_PROC_MEMINFO)
681 AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo")
682 EXTRAS="$EXTRAS check_swap"
683elif [swap -l 2>&1 | egrep -i "swapfile" >/dev/null]
684then
685 echo "found swap command"
686 AC_DEFINE(HAVE_SWAP)
687 AC_PATH_PROG(PATH_TO_SWAP,swap)
688 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -l")
689 if [swap -l 2>/dev/null | egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" >/dev/null]
690 then
691 AC_DEFINE_UNQUOTED(SWAP_FORMAT,[" %*d %*s %*d,%*d %*d %*d %d %d"])
692 echo " using IRIX format"
693 elif [swap -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
694 then
695 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %*[[0-9,-]] %*d %d %d"])
696 echo " using Solaris format"
697 fi
698 EXTRAS="$EXTRAS check_swap"
699elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null]
700then
701 echo "found swapinfo command"
702 AC_DEFINE(HAVE_SWAP)
703 AC_PATH_PROG(PATH_TO_SWAP,swapinfo)
704 AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP -k")
705 if [swapinfo -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
706 then
707 AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"])
708 echo " using FreeBSD format"
709 fi
710 EXTRAS="$EXTRAS check_swap"
711fi
712
713AC_PATH_PROG(PATH_TO_DIG,dig)
714AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG")
715if test -n "$PATH_TO_DIG"; then
716 EXTRAS="$EXTRAS check_dig"
717fi
718
719if test -f plugins/check_nt.c ; then
720 EXTRAS="$EXTRAS check_nt"
721elif test -f ../plugins/check_nt.c ; then
722 EXTRAS="$EXTRAS check_nt"
723fi
724
725dnl AC_EGREP_HEADER (PATTERN, HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
726AC_TRY_COMPILE([#ifdef __STDC__
727#include <stdio.h>
728#include <stdlib.h>
729#include <stdarg.h>
730#else
731#include <sys/types.h>
732#include <stdio.h>
733#include <varargs.h>
734#endif],
735[va_list args;],
736[AC_MSG_RESULT(yes)],
737[NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
738
739AC_SUBST(EXTRAS)
740AC_SUBST(DEPLIBS)
741
742AC_SUBST(PACKAGE)
743AC_SUBST(VERSION)
744AC_DEFINE_UNQUOTED(PACKAGE,"${PACKAGE}")
745AC_DEFINE_UNQUOTED(VERSION,"${VERSION}")
746AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}")
747
748AC_OUTPUT(Makefile subst plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl,echo timestamp > plugins/stamp-h1;echo timestamp > plugins/stamp-h2;echo timestamp > plugins/stamp-h3;echo timestamp > plugins/stamp-h4;echo timestamp > plugins/stamp-h5;echo timestamp > plugins/stamp-h6;PATH=.:..:$PATH subst.sh command.cfg)