diff options
author | Ethan Galstad <egalstad@users.sourceforge.net> | 2002-02-28 06:42:51 (GMT) |
---|---|---|
committer | Ethan Galstad <egalstad@users.sourceforge.net> | 2002-02-28 06:42:51 (GMT) |
commit | 44a321cb8a42d6c0ea2d96a1086a17f2134c89cc (patch) | |
tree | a1a4d9f7b92412a17ab08f34f04eec45433048b7 /configure.in | |
parent | 54fd5d7022ff2d6a59bc52b8869182f3fc77a058 (diff) | |
download | monitoring-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.in | 748 |
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 @@ | |||
1 | dnl Process this file with autoconf to produce a configure script. | ||
2 | include(`aclocal.m4') | ||
3 | AC_REVISION ($Revision$) | ||
4 | AC_INIT(package.def) | ||
5 | VERSION=`cat $srcdir/package.def|sed -e 's/PACKAGE_RELEASE= *"//;s/"//'` | ||
6 | PACKAGE=nagios-plugins | ||
7 | dnl AM_INIT_AUTOMAKE(nagios-plugins,$VERSION) | ||
8 | AM_CONFIG_HEADER(plugins/config.h plugins/common.h plugins/version.h plugins/netutils.h plugins/utils.h plugins/popen.h) | ||
9 | |||
10 | AC_PREFIX_DEFAULT(/usr/local/nagios) | ||
11 | |||
12 | dnl Figure out how to invoke "install" and what install options to use. | ||
13 | |||
14 | AC_PROG_INSTALL | ||
15 | AC_SUBST(INSTALL) | ||
16 | |||
17 | AC_PROG_RANLIB | ||
18 | |||
19 | AC_PATH_PROG(ACLOCAL,aclocal) | ||
20 | AC_PATH_PROG(AUTOMAKE,automake) | ||
21 | AC_PATH_PROG(AUTOCONF,autoconf) | ||
22 | AC_PATH_PROG(AUTOHEADER,autoheader) | ||
23 | |||
24 | PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'` | ||
25 | AC_SUBST(PLUGIN_TEST)dnl | ||
26 | |||
27 | SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'` | ||
28 | AC_SUBST(SCRIPT_TEST)dnl | ||
29 | |||
30 | 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" | ||
31 | AC_SUBST(WARRANTY) | ||
32 | |||
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\n" | ||
34 | AC_SUBST(SUPPORT) | ||
35 | |||
36 | AC_ARG_PROGRAM | ||
37 | |||
38 | dnl 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 | |||
40 | AC_ARG_WITH(cgiurl,--with-cgiurl=<dir> sets URL for cgi programs,cgiurl=$withval,cgiurl=/cgi-bin/nagios) | ||
41 | CGIURL="$cgiurl" | ||
42 | AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL") | ||
43 | |||
44 | AC_ARG_WITH(nagios_user,--with-nagios-user=<user> sets user name to run nagios,nagios_usr=$withval,nagios_usr=nagios) | ||
45 | AC_ARG_WITH(nagios_group,--with-nagios-group=<group> sets group name to run nagios,nagios_grp=$withval,nagios_grp=nagios) | ||
46 | AC_SUBST(nagios_usr) | ||
47 | AC_SUBST(nagios_grp) | ||
48 | INSTALL_OPTS="-o $nagios_usr -g $nagios_grp" | ||
49 | AC_SUBST(INSTALL_OPTS) | ||
50 | |||
51 | AC_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) | ||
52 | AC_SUBST(trusted_path) | ||
53 | |||
54 | EXTRAS= | ||
55 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH | ||
56 | |||
57 | LDFLAGS="$LDFLAGS -L." | ||
58 | |||
59 | dnl Checks for programs. | ||
60 | AC_PROG_CC | ||
61 | AC_PROG_MAKE_SET | ||
62 | AC_PROG_AWK | ||
63 | |||
64 | AC_PATH_PROG(PYTHON,python) | ||
65 | AC_PATH_PROG(PERL,perl) | ||
66 | AC_PATH_PROG(SH,sh) | ||
67 | |||
68 | AC_PATH_PROG(HOSTNAME,hostname) | ||
69 | AC_PATH_PROG(BASENAME,basename) | ||
70 | |||
71 | |||
72 | dnl | ||
73 | dnl Checks for libraries. | ||
74 | dnl | ||
75 | |||
76 | AC_FUNC_GETLOADAVG | ||
77 | |||
78 | AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce") | ||
79 | AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl") | ||
80 | AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket") | ||
81 | AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv") | ||
82 | AC_SUBST(SOCKETLIBS) | ||
83 | |||
84 | dnl Check for PostgreSQL libraries | ||
85 | _SAVEDLIBS="$LIBS" | ||
86 | _SAVEDCPPFLAGS="$CPPFLAGS" | ||
87 | AC_ARG_WITH(pgsql,--with-pgsql=<dir> sets path to pgsql installation,[PGSQL=$withval]) | ||
88 | AC_CHECK_LIB(crypt,main) | ||
89 | if 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 | ||
122 | else | ||
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).]) | ||
125 | fi | ||
126 | LIBS="$_SAVEDLIBS" | ||
127 | CPPFLAGS="$_SAVEDCPPFLAGS" | ||
128 | |||
129 | dnl Check for radius libraries | ||
130 | _SAVEDLIBS="$LIBS" | ||
131 | AC_CHECK_LIB(radiusclient,rc_read_config) | ||
132 | if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then | ||
133 | EXTRAS="$EXTRAS check_radius" | ||
134 | RADIUSLIBS="-lradiusclient" | ||
135 | AC_SUBST(RADIUSLIBS) | ||
136 | else | ||
137 | AC_MSG_WARN([Skipping radius plugin]) | ||
138 | AC_MSG_WARN([install radius libs to compile this plugin (see Requirements).]) | ||
139 | fi | ||
140 | LIBS="$_SAVEDLIBS" | ||
141 | |||
142 | dnl Check for LDAP libraries | ||
143 | _SAVEDLIBS="$LIBS" | ||
144 | AC_CHECK_LIB(ldap,main,,,-llber) | ||
145 | if 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" | ||
151 | else | ||
152 | AC_MSG_WARN([Skipping LDAP plugin]) | ||
153 | AC_MSG_WARN([install LDAP libs to compile this plugin (see Requirements).]) | ||
154 | fi | ||
155 | LIBS="$_SAVEDLIBS" | ||
156 | |||
157 | dnl Check for mysql libraries | ||
158 | _SAVEDLIBS="$LIBS" | ||
159 | _SAVEDCPPFLAGS="$CPPFLAGS" | ||
160 | CPPFLAGS="-I/usr/include" | ||
161 | AC_ARG_WITH(mysqllibdir,--with-mysqllibdir=<dir> sets path to mysql libraries,[MYSQLLIBDIR=$withval]) | ||
162 | if test -n "$MYSQLLIBS"; then | ||
163 | AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR",,-L$MYSQLLIBDIR -lz) | ||
164 | elif 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") | ||
167 | elif 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") | ||
170 | elif 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) | ||
173 | elif 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) | ||
176 | fi | ||
177 | if 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 | ||
187 | else | ||
188 | AC_MSG_WARN([Skipping mysql plugin]) | ||
189 | AC_MSG_WARN([install mysql client libs to compile this plugin (see Requirements).]) | ||
190 | fi | ||
191 | LIBS="$_SAVEDLIBS" | ||
192 | CPPFLAGS="$_SAVEDCPPFLAGS" | ||
193 | |||
194 | dnl Check for OpenSSL location | ||
195 | AC_PATH_PROG(OPENSSL,openssl) | ||
196 | if test "$OPENSSL" = "/usr/bin/openssl"; then | ||
197 | OPENSSL=/usr | ||
198 | elif test "$OPENSSL" = "/usr/sbin/openssl"; then | ||
199 | OPENSSL=/usr | ||
200 | elif test "$OPENSSL" = "/opt/bin/openssl"; then | ||
201 | OPENSSL=/opt | ||
202 | elif test "$OPENSSL" = "/opt/openssl/bin/openssl"; then | ||
203 | OPENSSL=/opt/openssl | ||
204 | elif test "$OPENSSL" = "/usr/slocal/bin/openssl"; then | ||
205 | OPENSSL=/usr/slocal | ||
206 | elif test "$OPENSSL" = "/usr/local/bin/openssl"; then | ||
207 | OPENSSL=/usr/local | ||
208 | elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then | ||
209 | OPENSSL=/usr/local/ssl | ||
210 | fi | ||
211 | AC_ARG_WITH(openssl,--with-openssl=<dir> sets path to openssl installation,[OPENSSL=$withval]) | ||
212 | |||
213 | dnl Check for OpenSSL header files | ||
214 | _SAVEDCPPFLAGS="$CPPFLAGS" | ||
215 | FOUNDINCLUDE=yes | ||
216 | CPPFLAGS="-I$OPENSSL/include" | ||
217 | AC_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) | ||
218 | if 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) | ||
221 | fi | ||
222 | AC_SUBST(SSLINCLUDE) | ||
223 | CPPFLAGS="$_SAVEDCPPFLAGS $SSLINCLUDE" | ||
224 | |||
225 | dnl Check for crypto lib | ||
226 | _SAVEDLIBS="$LIBS" | ||
227 | AC_CHECK_LIB(crypto,CRYPTO_lock,,,-L$OPENSSL/lib) | ||
228 | if 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) | ||
231 | fi | ||
232 | LIBS="$_SAVEDLIBS" | ||
233 | |||
234 | dnl test headers and libs to decide whether check_http should use SSL | ||
235 | if 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 | ||
242 | fi | ||
243 | CPPFLAGS="$_SAVEDCPPFLAGS" | ||
244 | |||
245 | dnl | ||
246 | dnl Checks for header files. | ||
247 | dnl | ||
248 | |||
249 | AC_HEADER_STDC | ||
250 | AC_HEADER_TIME | ||
251 | AC_HEADER_SYS_WAIT | ||
252 | AC_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 | |||
254 | dnl Checks for typedefs, structures, and compiler characteristics. | ||
255 | AC_C_CONST | ||
256 | AC_STRUCT_TM | ||
257 | AC_TYPE_PID_T | ||
258 | AC_TYPE_SIZE_T | ||
259 | AC_TYPE_SIGNAL | ||
260 | |||
261 | dnl EXTRA_LIBRARIES="libgetopt.a libsnprintf.a" | ||
262 | dnl noinst_LIBRARIES="libgetopt.a libsnprintf.a" | ||
263 | dnl libgetopt_a_SOURCES="getopt.c getopt1.c" | ||
264 | dnl libgetopt_a_DEPENDENCIES=getopt.h | ||
265 | dnl libsnprintf_a_SOURCES=snprintf.c | ||
266 | dnl AC_SUBST(noinst_LIBRARIES) | ||
267 | dnl AC_SUBST(libgetopt_a_SOURCES) | ||
268 | dnl AC_SUBST(libgetopt_a_DEPENDENCIES) | ||
269 | dnl AC_SUBST(libsnprintf_a_SOURCES) | ||
270 | |||
271 | AC_MSG_CHECKING(for getopt_long) | ||
272 | AC_TRY_COMPILE([#include <getopt.h> | ||
273 | #include <stdlib.h>], | ||
274 | [int option_index=0; | ||
275 | static struct option *long_options; | ||
276 | getopt_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 | |||
280 | AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a") | ||
281 | |||
282 | AC_CHECK_FUNC(vsnprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") | ||
283 | |||
284 | dnl Checks for library functions. | ||
285 | AC_CHECK_FUNCS(select socket strdup strstr strtod strtol strtoul) | ||
286 | |||
287 | AC_MSG_CHECKING(for type of socket size) | ||
288 | AC_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 | |||
296 | if test -f "/proc/loadavg" | ||
297 | then | ||
298 | AC_DEFINE(HAVE_PROC_LOADAVG) | ||
299 | AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg") | ||
300 | fi | ||
301 | |||
302 | AC_PATH_PROG(PATH_TO_PS,ps) | ||
303 | dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs) | ||
304 | dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND | ||
305 | if [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] | ||
306 | then | ||
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'" | ||
318 | elif [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] | ||
319 | then | ||
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'" | ||
331 | elif [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] | ||
332 | then | ||
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'" | ||
344 | elif [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] | ||
345 | then | ||
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'" | ||
357 | elif [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] | ||
358 | then | ||
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'" | ||
370 | elif [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] | ||
371 | then | ||
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'" | ||
383 | dnl FreeBSD | ||
384 | elif [ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i "^STAT +COMMAND +VSZ +RSS +UID +USER +PPID" >/dev/null] | ||
385 | then | ||
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'" | ||
397 | dnl BSD-like mode in RH 6.1 | ||
398 | elif [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] | ||
399 | then | ||
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'" | ||
411 | dnl IRIX 53 | ||
412 | elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] | ||
413 | then | ||
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" | ||
423 | dnl IRIX 63 | ||
424 | elif [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] | ||
425 | then | ||
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" | ||
435 | dnl SunOS 4.1.3: | ||
436 | dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND | ||
437 | dnl | ||
438 | elif [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] | ||
439 | then | ||
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" | ||
451 | dnl Debian Linux / procps v1.2.9: | ||
452 | dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND | ||
453 | dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2] | ||
454 | dnl | ||
455 | elif [ps laxnwww 2>/dev/null | egrep -i "^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND" >/dev/null] | ||
456 | then | ||
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" | ||
468 | dnl | ||
469 | dnl AIX 4.1: | ||
470 | dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD | ||
471 | dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper | ||
472 | elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] | ||
473 | then | ||
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" | ||
483 | dnl AIX? | ||
484 | elif [ps glaxen 2>/dev/null | egrep -i "^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND" >/dev/null] | ||
485 | then | ||
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" | ||
495 | dnl ucb style? | ||
496 | dnl elif [ps axun 2>/dev/null | egrep -i "^USER +PID +%CPU +%MEM +SIZE +RSS +TTY +STAT +START +TIME +COMMAND *$" >/dev/null] | ||
497 | dnl then | ||
498 | dnl AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS axun") | ||
499 | dnl AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %*s %*s %*s %*s %*s %s %*s %*s %s") | ||
500 | dnl AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS axun") | ||
501 | dnl AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %d") | ||
502 | dnl AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS axun") | ||
503 | dnl AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %d") | ||
504 | dnl echo " ps syntax... $PATH_TO_PS axun" | ||
505 | dnl ucb style? | ||
506 | dnl elif [ps axun 2>/dev/null | egrep -i "^USER +PID +%CPU +%MEM +SIZE +RSS +TTY +STAT +START +TIME +COMMAND" >/dev/null] | ||
507 | dnl then | ||
508 | dnl AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS axun") | ||
509 | dnl AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %*s %*s %*s %*s %*s %s %*s %*s %s") | ||
510 | dnl AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS axun") | ||
511 | dnl AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %d") | ||
512 | dnl AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS axun") | ||
513 | dnl AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %d") | ||
514 | dnl echo " ps syntax... $PATH_TO_PS axun" | ||
515 | else | ||
516 | echo "** Unable to find usable ps syntax" | ||
517 | fi | ||
518 | |||
519 | AC_ARG_WITH(df_command,--with-df-command=<syntax> sets syntax for df,DF_COMMAND=$withval) | ||
520 | if test -n "$DF_COMMAND" | ||
521 | then | ||
522 | AC_DEFINE_UNQUOTED(DF_COMMAND,"$DF_COMMAND") | ||
523 | 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] | ||
524 | then | ||
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") | ||
528 | 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] | ||
529 | then | ||
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") | ||
533 | elif [df 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] | ||
534 | then | ||
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") | ||
538 | elif [bdf 2>/dev/null | egrep -i "^/dev/[a-z0-9/]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+% +/[a-z0-9/]*" >/dev/null] | ||
539 | then | ||
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") | ||
543 | else | ||
544 | AC_MSG_WARN("unable to find usable df syntax") | ||
545 | fi | ||
546 | |||
547 | AC_PATH_PROG(PATH_TO_PING,ping) | ||
548 | |||
549 | AC_ARG_WITH(ping_command,--with-ping-command=<syntax> sets syntax for ping,PING_COMMAND=$withval) | ||
550 | if test -n "$PING_COMMAND" | ||
551 | then | ||
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 | ||
557 | elif [ping -n -U -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
558 | then | ||
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>" | ||
562 | elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
563 | then | ||
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>" | ||
567 | elif [ping -n 127.0.0.1 -c 1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
568 | then | ||
569 | PING_COMMAND="$PATH_TO_PING -n %s -c %d" | ||
570 | echo " ping syntax... $PATH_TO_PING -n <host> -c <count>" | ||
571 | elif [ping 127.0.0.1 -n 1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
572 | then | ||
573 | PING_COMMAND="$PATH_TO_PING %s -n %d" | ||
574 | echo " ping syntax... $PATH_TO_PING <host> -n <count>" | ||
575 | elif [ping -n -s 127.0.0.1 56 1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
576 | then | ||
577 | PING_COMMAND="$PATH_TO_PING -n -s %s 56 %d" | ||
578 | echo " ping syntax... $PATH_TO_PING -n -s <host> 56 <count>" | ||
579 | elif [ping -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
580 | then | ||
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>" | ||
583 | elif [ping -n -s 56 -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
584 | then | ||
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>" | ||
588 | elif [ping -n -c 1 127.0.0.1 2>/dev/null | egrep -i "^round-trip" >/dev/null] | ||
589 | then | ||
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>" | ||
593 | else | ||
594 | AC_MSG_WARN("unable to find usable ping syntax") | ||
595 | fi | ||
596 | AC_DEFINE_UNQUOTED(PING_COMMAND,"$PING_COMMAND") | ||
597 | |||
598 | AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup) | ||
599 | if test -n "$ac_cv_path_PATH_TO_NSLOOKUP" | ||
600 | then | ||
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" | ||
611 | else | ||
612 | AC_MSG_WARN("nslookup command not found") | ||
613 | fi | ||
614 | |||
615 | AC_PATH_PROG(PATH_TO_UPTIME,uptime) | ||
616 | AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME") | ||
617 | |||
618 | AC_PATH_PROG(PATH_TO_WHO,who) | ||
619 | if [who -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null] | ||
620 | then | ||
621 | AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO -q") | ||
622 | else | ||
623 | AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO") | ||
624 | fi | ||
625 | |||
626 | AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) | ||
627 | if test -f "$PATH_TO_SNMPGET" | ||
628 | then | ||
629 | AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET") | ||
630 | EXTRAS="$EXTRAS check_hpjd check_snmp" | ||
631 | else | ||
632 | echo "** Get snmpget from http://ucd-snmp.ucdavis.edu to make check_hpjd and check_snmp plugins" | ||
633 | fi | ||
634 | |||
635 | AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext) | ||
636 | if test -f "$PATH_TO_SNMPGETNEXT" | ||
637 | then | ||
638 | AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT") | ||
639 | fi | ||
640 | |||
641 | AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) | ||
642 | AC_PATH_PROG(PATH_TO_QSTAT,qstat) | ||
643 | if test -n "$PATH_TO_QUAKESTAT" | ||
644 | then | ||
645 | AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$PATH_TO_QUAKESTAT") | ||
646 | EXTRAS="$EXTRAS check_game" | ||
647 | elif test -n "$PATH_TO_QSTAT" | ||
648 | then | ||
649 | AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$PATH_TO_QSTAT") | ||
650 | EXTRAS="$EXTRAS check_game" | ||
651 | else | ||
652 | echo "** Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin" | ||
653 | fi | ||
654 | |||
655 | AC_PATH_PROG(PATH_TO_FPING,fping) | ||
656 | if test -n "$PATH_TO_FPING" | ||
657 | then | ||
658 | AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING") | ||
659 | EXTRAS="$EXTRAS check_fping" | ||
660 | else | ||
661 | echo "** Get fping from http://www.stanford.edu/~schemers/docs/fping/fping.html in order to make check_fping plugin" | ||
662 | fi | ||
663 | |||
664 | AC_PATH_PROG(PATH_TO_SSH,ssh) | ||
665 | if test -f "$PATH_TO_SSH" | ||
666 | then | ||
667 | AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH") | ||
668 | EXTRAS="$EXTRAS check_by_ssh" | ||
669 | else | ||
670 | echo "** Get ssh in order to make check_by_ssh plugin" | ||
671 | fi | ||
672 | |||
673 | dnl dunno why this does not work below - use hack (kbd) | ||
674 | dnl fine on linux, broken on solaris | ||
675 | dnl if /bin/test -e "/proc/meminfo" | ||
676 | |||
677 | if [cat /proc/meminfo > /dev/null 2>&1] | ||
678 | then | ||
679 | echo "found /proc/meminfo" | ||
680 | AC_DEFINE(HAVE_PROC_MEMINFO) | ||
681 | AC_DEFINE_UNQUOTED(PROC_MEMINFO,"/proc/meminfo") | ||
682 | EXTRAS="$EXTRAS check_swap" | ||
683 | elif [swap -l 2>&1 | egrep -i "swapfile" >/dev/null] | ||
684 | then | ||
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" | ||
699 | elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null] | ||
700 | then | ||
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" | ||
711 | fi | ||
712 | |||
713 | AC_PATH_PROG(PATH_TO_DIG,dig) | ||
714 | AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG") | ||
715 | if test -n "$PATH_TO_DIG"; then | ||
716 | EXTRAS="$EXTRAS check_dig" | ||
717 | fi | ||
718 | |||
719 | if test -f plugins/check_nt.c ; then | ||
720 | EXTRAS="$EXTRAS check_nt" | ||
721 | elif test -f ../plugins/check_nt.c ; then | ||
722 | EXTRAS="$EXTRAS check_nt" | ||
723 | fi | ||
724 | |||
725 | dnl AC_EGREP_HEADER (PATTERN, HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
726 | AC_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 | |||
739 | AC_SUBST(EXTRAS) | ||
740 | AC_SUBST(DEPLIBS) | ||
741 | |||
742 | AC_SUBST(PACKAGE) | ||
743 | AC_SUBST(VERSION) | ||
744 | AC_DEFINE_UNQUOTED(PACKAGE,"${PACKAGE}") | ||
745 | AC_DEFINE_UNQUOTED(VERSION,"${VERSION}") | ||
746 | AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}") | ||
747 | |||
748 | AC_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) | ||