aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/netsaint-plugins/files/patch-ab
blob: 4d27df545d40f795f9d88d80070cfd0a4d5a2381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
--- configure.in.orig   Tue Mar  6 06:40:44 2001
+++ configure.in    Mon Apr 16 12:24:22 2001
@@ -7,7 +7,7 @@
 dnl AM_INIT_AUTOMAKE(netsaint-plugins,$VERSION)
 AM_CONFIG_HEADER(plugins/config.h plugins/common.h plugins/version.h plugins/netutils.h plugins/utils.h plugins/popen.h)
 
-AC_PREFIX_DEFAULT(/usr/local/netsaint)
+dnl AC_PREFIX_DEFAULT(/usr/local/netsaint)
 
 dnl Figure out how to invoke "install" and what install options to use.
 
@@ -126,25 +126,37 @@
 LIBS="$_SAVEDLIBS"
 CPPFLAGS="$_SAVEDCPPFLAGS"
 
+AC_ARG_ENABLE(radius,--enable-radius compile check_radius)
+if test $enableval; then
+dnl Check for radiusclient header file
+_SAVEDCPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LOCALBASE}/include"
+AC_CHECK_HEADERS(radiusclient.h,RADIUSINCLUDE="-I${LOCALBASE}/include")
+AC_SUBST(RADIUSINCLUDE)
+CPPFLAGS="$_SAVEDCPPFLAGS $RADIUSINCLUDE"
+
 dnl Check for radius libraries
 _SAVEDLIBS="$LIBS"
-AC_CHECK_LIB(radiusclient,rc_read_config)
+AC_CHECK_LIB(radiusclient,rc_read_config,,,-L${LOCALBASE}/lib)
 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
   EXTRAS="$EXTRAS check_radius"
-   RADIUSLIBS="-lradiusclient"
+   RADIUSLIBS="-L${LOCALBASE}/lib -lradiusclient"
   AC_SUBST(RADIUSLIBS)
 else
   AC_MSG_WARN([Skipping radius plugin])
   AC_MSG_WARN([install radius libs to compile this plugin (see Requirements).])
 fi
 LIBS="$_SAVEDLIBS"
+fi
 
+AC_ARG_ENABLE(ldap,--enable-ldap compile check_ldap)
+if test $enableval; then
 dnl Check for LDAP libraries
 _SAVEDLIBS="$LIBS"
-AC_CHECK_LIB(ldap,main,,,-llber)
-if test "$ac_cv_lib_ldap_main" = "yes"; then
-  LDAPLIBS="-lldap -llber"\
-  LDAPINCLUDE="-I/usr/include/ldap"
+AC_CHECK_LIB(ldap,ldap_simple_bind,,,-L${LOCALBASE}/lib -llber)
+if test "$ac_cv_lib_ldap_ldap_simple_bind" = "yes"; then
+  LDAPLIBS="-L${LOCALBASE}/lib -lldap -llber"\
+  LDAPINCLUDE="-I${LOCALBASE}/include"
   AC_SUBST(LDAPLIBS)
   AC_SUBST(LDAPINCLUDE)
   EXTRAS="$EXTRAS check_ldap"
@@ -153,13 +165,14 @@
   AC_MSG_WARN([install LDAP libs to compile this plugin (see Requirements).])
 fi
 LIBS="$_SAVEDLIBS"
+fi
 
 dnl Check for mysql libraries
 _SAVEDLIBS="$LIBS"
 _SAVEDCPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I/usr/include"
+CPPFLAGS="-I${LOCALBASE}/include"
 AC_ARG_WITH(mysqllibdir,--with-mysqllibdir=<dir> sets path to mysql libraries,[MYSQLLIBDIR=$withval])
-if test -n "$MYSQLLIBS"; then
+if test -n "$MYSQLLIBDIR"; then
   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR",,-L$MYSQLLIBDIR -lz)
 elif test -f /usr/lib/libmysqlclient.so; then
   AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
@@ -175,7 +188,8 @@
   AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
 fi
 if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
-  AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h)
+  AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h,MYSQLINCLUDE="-I${LOCALBASE}/include")
+  AC_SUBST(MYSQLINCLUDE)
   if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
     EXTRAS="$EXTRAS check_mysql"
     AC_SUBST(MYSQLLIBS)
@@ -189,7 +203,7 @@
   AC_MSG_WARN([install mysql client libs to compile this plugin (see Requirements).])
 fi
 LIBS="$_SAVEDLIBS"
-CPPFLAGS="$_SAVEDCPPFLAGS"
+CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE"
 
 dnl Check for OpenSSL location
 AC_PATH_PROG(OPENSSL,openssl)
@@ -268,16 +282,16 @@
 dnl AC_SUBST(libgetopt_a_DEPENDENCIES)
 dnl AC_SUBST(libsnprintf_a_SOURCES)
 
-AC_MSG_CHECKING(for getopt_long)
-AC_TRY_COMPILE([#include <getopt.h>
-#include <stdlib.h>],
-[int option_index=0;
-static struct option *long_options;
-getopt_long(0,NULL,"+h",long_options,&option_index);],
-[AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(yes)],
-[AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(no) import_sources=getopt])
+dnl AC_MSG_CHECKING(for getopt_long)
+dnl AC_TRY_COMPILE([#include <getopt.h>
+dnl #include <stdlib.h>],
+dnl [int option_index=0;
+dnl static struct option *long_options;
+dnl getopt_long(0,NULL,"+h",long_options,&option_index);],
+dnl [AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(yes)],
+dnl [AC_DEFINE(HAVE_GETOPT_H) AC_DEFINE(HAVE_GETOPT_LONG) AC_MSG_RESULT(no) import_sources=getopt])
 
-AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a")
+dnl AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a")
 
 AC_CHECK_FUNC(vsnprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a")
 
@@ -328,72 +342,72 @@
    AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -eo 'rss comm'")
    AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
         echo "      ps syntax... $PATH_TO_PS -eo 's  comm vsz rss user ppid args'"
-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]
+elif [ps -axo '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]
 then
    AC_DEFINE(USE_PS_VARS)
    AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
-   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -Ao 's user ppid args'")
+   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -axo 's user ppid args'")
    EXTRAS="$EXTRAS check_netsaint"
-   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Ao 's uid ppid comm args'")
+   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -axo 's uid ppid comm args'")
    AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
-   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'")
+   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -axo 'vsz comm'")
    AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
-   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'")
+   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -axo 'rss comm'")
    AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
-   echo "      ps syntax... $PATH_TO_PS -Ao 's comm vsz rss'"
-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]
+   echo "      ps syntax... $PATH_TO_PS -axo 's comm vsz rss'"
+elif [ps -axo '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]
 then
    AC_DEFINE(USE_PS_VARS)
    AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
-   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -Ao 'status user ppid args'")
+   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -axo 'status user ppid args'")
    EXTRAS="$EXTRAS check_netsaint"
-   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Ao 'status uid ppid comm args'")
+   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -axo 'status uid ppid comm args'")
    AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
-   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'")
+   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -axo 'vsz comm'")
    AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
-   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'")
+   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -axo 'rss comm'")
    AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
-   echo "      ps syntax... $PATH_TO_PS -Ao 'status comm vsz rss'"
-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]
+   echo "      ps syntax... $PATH_TO_PS -axo 'status comm vsz rss'"
+elif [ps -axo '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]
 then
    AC_DEFINE(USE_PS_VARS)
    AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
-   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -Ao 'state user ppid args'")
+   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -axo 'state user ppid args'")
    EXTRAS="$EXTRAS check_netsaint"
-   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -Ao 'state uid ppid comm args'")
+   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -axo 'state uid ppid comm args'")
    AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
-   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -Ao 'vsz comm'")
+   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -axo 'vsz comm'")
    AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
-   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -Ao 'rss comm'")
+   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -axo 'rss comm'")
    AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
-   echo "      ps syntax... $PATH_TO_PS -Ao 'state comm vsz rss'"
-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]
+   echo "      ps syntax... $PATH_TO_PS -axo 'state comm vsz rss'"
+elif [ps -axo '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]
 then
    AC_DEFINE(USE_PS_VARS)
    AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
-   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -ao 'state user ppid args'")
+   AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -axo 'state user ppid args'")
    EXTRAS="$EXTRAS check_netsaint"
-   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -ao 'state uid ppid command args'")
+   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -axo 'state uid ppid command args'")
    AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
-   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -ao 'vsz command'")
+   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -axo 'vsz command'")
    AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
-   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -ao 'rss command'")
+   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -axo 'rss command'")
    AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
-   echo "      ps syntax... $PATH_TO_PS -ao 'state command vsz rss'"
+   echo "      ps syntax... $PATH_TO_PS -axo 'state command vsz rss'"
 dnl FreeBSD
-elif [ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i "^STAT +COMMAND +VSZ +RSS +UID +USER +PPID" >/dev/null]
+elif [ps waxo 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i "^STAT +COMMAND +VSZ +RSS +UID +USER +PPID" >/dev/null]
 then
    AC_DEFINE(USE_PS_VARS)
    AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos])
    AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS waxo 'state uid ppid command'")
    EXTRAS="$EXTRAS check_netsaint"
-   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS waxco 'state uid ppid command command'")
+   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS waxo 'state uid ppid command command'")
    AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n")
-   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS waxco 'vsz command'")
+   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS waxo 'vsz command'")
    AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
-   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxco 'rss command'")
+   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxo 'rss command'")
    AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
-   echo "      ps syntax... $PATH_TO_PS -Ao 'state command vsz rss'"
+   echo "      ps syntax... $PATH_TO_PS -axo 'state command vsz rss'"
 dnl BSD-like mode in RH 6.1
 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]
 then
@@ -407,7 +421,7 @@
    AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s")
    AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxno 'rss comm'")
    AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s")
-   echo "      ps syntax... $PATH_TO_PS -waxco 'state comm vsz rss'"
+   echo "      ps syntax... $PATH_TO_PS -waxo 'state comm vsz rss'"
 dnl IRIX 53
 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]
 then
@@ -618,6 +632,8 @@
    AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO")
 fi
 
+AC_ARG_ENABLE(snmp,--enable-snmp compile check_hpjd and check_snmp)
+if test $enableval; then
 AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
 if test -f "$PATH_TO_SNMPGET"
 then
@@ -626,6 +642,7 @@
 else
    echo "** Get snmpget from http://ucd-snmp.ucdavis.edu to make check_hpjd and check_snmp plugins"
 fi
+fi
 
 AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
 if test -f "$PATH_TO_SNMPGETNEXT"
@@ -633,6 +650,8 @@
    AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT")
 fi
 
+AC_ARG_ENABLE(qstat,--enable-qstat compile check_game)
+if test $enableval; then
 AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
 AC_PATH_PROG(PATH_TO_QSTAT,qstat)
 if test -n "$PATH_TO_QUAKESTAT"
@@ -646,7 +665,10 @@
 else
    echo "** Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin"
 fi
+fi
 
+AC_ARG_ENABLE(fping,--enable-fping compile check_fping)
+if test $enableval; then
 AC_PATH_PROG(PATH_TO_FPING,fping)
 if test -n "$PATH_TO_FPING"
 then
@@ -654,6 +676,7 @@
    EXTRAS="$EXTRAS check_fping"
 else
    echo "** Get fping from http://www.stanford.edu/~schemers/docs/fping/fping.html in order to make check_fping plugin"
+fi
 fi
 
 AC_PATH_PROG(PATH_TO_SSH,ssh)