File: configure.server

package info (click to toggle)
xymon 4.3.30-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,384 kB
  • sloc: ansic: 69,137; sh: 3,601; makefile: 863; javascript: 452; perl: 48
file content (590 lines) | stat: -rwxr-xr-x 16,012 bytes parent folder | download | duplicates (2)
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
#!/bin/sh

# Configure script for Xymon server
# $Id: configure.server 8052 2019-04-22 18:20:02Z jccleaver $

echo ""
echo "Configuration script for Xymon"
echo ""

while test "$1" != ""
do
	OPT="$1"; shift

	case "$OPT" in
	  "--help")
	  	cat <<EOF
  To configure Xymon, the following options are available:
     --rrdinclude DIRECTORY   : Specify location of RRDtool include files
     --rrdlib DIRECTORY       : Specify location of RRDtool libraries
     --pcreinclude DIRECTORY  : Specify location of PCRE include files
     --pcrelib DIRECTORY      : Specify location of PCRE libraries
     --sslinclude DIRECTORY   : Specify location of OpenSSL include files
     --ssllib DIRECTORY       : Specify location of OpenSSL libraries
     --ldapinclude DIRECTORY  : Specify location of OpenLDAP include files
     --ldaplib DIRECTORY      : Specify location of OpenLDAP libraries
     --caresinclude DIRECTORY : Specify location of C-ARES include files
     --careslib DIRECTORY     : Specify location of C-ARES libraries
     --fping FILENAME         : Specify location of the Fping program

  The script will search a number of standard directories for
  all of these files, so you normally do not have to specify any options.
EOF
		exit 0
		;;
	  "--rrdinclude")
	  	USERRRDINC="$1"; shift
		;;
	  "--rrdlib")
	  	USERRRDLIB="$1"; shift
		;;
	  "--pcreinclude")
	  	USERPCREINC="$1"; shift
		;;
	  "--pcrelib")
	  	USERPCRELIB="$1"; shift
		;;
	  "--sslinclude")
	  	USEROSSLINC="$1"; shift
		;;
	  "--ssllib")
	  	USEROSSLLIB="$1"; shift
		;;
	  "--ldapinclude")
	  	USERLDAPINC="$1"; shift
		;;
	  "--ldaplib")
	  	USERLDAPLIB="$1"; shift
		;;
	  "--caresinclude")
	  	USERCARESINC="$1"; shift
		;;
	  "--careslib")
	  	USERCARESLIB="$1"; shift
		;;
	  "--fping")
	  	USERFPING="$1"; shift
		;;
	esac
done

if test -r Makefile
then
	echo "Already configured - remove Makefile to re-configure"
	exit 1
fi

echo "This script asks a few questions and builds a Makefile to compile Xymon"
echo ""

if test "$MAKE" = ""; then
	MAKE=make
fi
echo "Checking your make-utility"
MAKEVER=`$MAKE -version 2>&1 | head -n 1 | awk '{print $1 " " $2}'`
if test "$MAKEVER" != "GNU Make"
then
	echo "GNU make is required to build Xymon."
	echo "If it is available as \"gmake\", run configure as: 'MAKE=gmake $0'"
	exit 1
fi

echo "Checking pre-requisites for building Xymon"
echo ""
. build/fping.sh
echo ""; echo ""
. build/pcre.sh
echo ""; echo ""
. build/c-ares.sh
echo ""; echo ""

. build/rrd.sh
if test "$RRDOK" = "NO"
then
	ENABLERRD="n"
else
	ENABLERRD="y"
fi
echo ""; echo ""

. build/ssl.sh
if test "$SSLOK" = "NO"
then
	ENABLESSL="n"
	SSLDEF=""
else
	echo ""
	echo "Xymon can use the OpenSSL library to test SSL-enabled services"
	echo "like https-encrypted websites, POP3S, IMAPS, NNTPS and TELNETS."
	echo "If you have the OpenSSL library installed, I recommend that you enable this."
	echo ""
	echo "Do you want to be able to test SSL-enabled services (y) ?"
	if test "$ENABLESSL" = ""
	then
		read ENABLESSL
	fi
	if test "$ENABLESSL" = "" -o "$ENABLESSL" = "y"
	then
		ENABLESSL="y"
		SSLDEF="-DHAVE_OPENSSL"
		if test "$OSSL2OK" = "Y"
		then
			SSLDEF="$SSLDEF -DHAVE_SSLV2_SUPPORT=1"
		fi
		if test "$OSSL3OK" = "Y"
		then
			SSLDEF="$SSLDEF -DHAVE_SSLV3_SUPPORT=1"
		fi
	else
		ENABLESSL="n"
		SSLDEF=""
	fi
	echo ""
fi
echo ""; echo "";

. build/ldap.sh
if test "$LDAPOK" = "NO"
then
	ENABLELDAP="n"
	LDAPDEF=""
else
	echo ""
	echo "Xymon can use your $LDAPVENDOR LDAP client library to test LDAP servers."
	echo ""
	echo "Do you want to be able to test LDAP servers (y) ?"
	if test "$ENABLELDAP" = ""
	then
		read ENABLELDAP
	fi
	if test "$ENABLELDAP" = "" -o "$ENABLELDAP" = "y"
	then
		ENABLELDAP="y"
		LDAPDEF="-DHAVE_LDAP"
	else
		ENABLELDAP="n"
		LDAPDEF=""
	fi
	echo ""
fi
echo ""; echo "";

. build/clock-gettime-librt.sh
echo ""; echo ""

if test "$SNMP" = "1"
then
	. build/snmp.sh
	echo ""; echo ""
else
	DOSNMP=no
fi

MAKE="$MAKE -s" ./build/lfs.sh
if test $? -eq 0; then
	LFS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
else
	LFS=""
fi
echo ""; echo ""

# Pre-requisites completed.

echo "Setting up for a Xymon server"
echo ""; echo ""

echo "What userid will be running Xymon [xymon] ?"
if test -z "$XYMONUSER"
then
	read XYMONUSER
fi
if test -z "$XYMONUSER"
then
	XYMONUSER="xymon"
fi

if test -z "$XYMONTOPDIR"
then
	if test "`uname -s`" = "Darwin"
	then
		# Use "dscl" for locating user information. From Isaac Vetter
		# http://www.xymon.com/archive/2008/02/msg00173.html
		USERDATA="`dscl . -list /Users  | grep $XYMONUSER`"
		if test "$USERDATA" != ""
		then
			echo "Found Directory entry for user: $USERDATA"
		else
			echo "FAILURE: The user $XYMONUSER does not exist locally. Create user and try again."
			exit 1
		fi
		echo ""; echo ""
		HOMEDIR="`dscl . -read /Users/$XYMONUSER | grep HomeDirectory | awk '{print $2}'`"
	else
		USERDATA=`getent passwd $XYMONUSER 2>/dev/null || ypmatch "${XYMONUSER}" passwd || grep "^${XYMONUSER}:" /etc/passwd`
		if test $? -eq 0
		then
			echo "Found passwd entry for user $USERDATA"
		else
			echo "FAILURE: The user $XYMONUSER does not exist. Create user and try again."
			exit 1
		fi
		echo ""; echo ""
		HOMEDIR="`echo $USERDATA|cut -d: -f6`"
	fi
else
	HOMEDIR="$XYMONTOPDIR"
fi

echo "Where do you want the Xymon installation [${HOMEDIR}] ?"
if test -z "$XYMONTOPDIR"
then
	read XYMONTOPDIR
fi
if test -z "$XYMONTOPDIR"
then
	XYMONTOPDIR=${HOMEDIR}
fi
if test -d "$XYMONTOPDIR"
then
	echo "OK, will configure to use $XYMONTOPDIR as the Xymon toplevel directory"
else
	echo "WARNING: $XYMONTOPDIR does not exist."
fi
echo ""; echo ""

echo "What URL will you use for the Xymon webpages [/xymon] ? "
if test -z "$XYMONHOSTURL"
then
	read XYMONHOSTURL
fi

if test -z "$XYMONHOSTURL"
then
	XYMONHOSTURL="/xymon"
elif test "$XYMONHOSTURL" = "/"
then
	# For Xymon as the root URL, we must clear this setting.
	# Otherwise, gifs, menus etc stop working because we generate
	# URL's begining with "//"
	XYMONHOSTURL=""
fi
echo ""; echo ""

echo "Where to put the Xymon CGI scripts [$XYMONTOPDIR/cgi-bin] ? "
echo "(Note: This is the filesystem directory - we will get to the URL shortly)"
if test -z "$CGIDIR"
then
	read CGIDIR
fi
if test -z "$CGIDIR"
then
	CGIDIR=$XYMONTOPDIR/cgi-bin
fi
echo ""; echo ""

echo "What is the URL for the Xymon CGI directory [/xymon-cgi] ? "
echo "(Note: This is the URL - NOT the filesystem directory)"
if test -z "$XYMONCGIURL"
then
	read XYMONCGIURL
fi
if test -z "$XYMONCGIURL"
then
	XYMONCGIURL="/xymon-cgi"
fi
echo ""; echo ""

echo "********************** SECURITY NOTICE ****************************"
echo "If your Xymon server is accessible by outsiders, then you should"
echo "restrict access to the CGI scripts that handle enable/disable of"
echo "hosts, and acknowledging of alerts. The easiest way to do this is"
echo "to put these in a separate CGI directory and require a password to"
echo "access them."
echo "Even if your Xymon server is on a secured, internal network, you"
echo "may want to have some operations (like disabling a host) be password-"
echo "protected - that lets you see who disabled or acknowledged an alert."
echo ""
echo "Where to put the Xymon Administration CGI scripts [$XYMONTOPDIR/cgi-secure] ? "
echo "(Note: This is the filesystem directory - we will get to the URL shortly)"
if test -z "$SECURECGIDIR"
then
	read SECURECGIDIR
fi
if test -z "$SECURECGIDIR"
then
	SECURECGIDIR=$XYMONTOPDIR/cgi-secure
fi
echo ""; echo ""

if test "$CGIDIR" != "$SECURECGIDIR"
then
	echo "What is the URL for the Xymon Administration CGI directory [/xymon-seccgi] ? "
	echo "(Note: This is the URL - NOT the filesystem directory)"
	if test -z "$SECUREXYMONCGIURL"
	then
		read SECUREXYMONCGIURL
	fi
	if test -z "$SECUREXYMONCGIURL"
	then
		SECUREXYMONCGIURL="/xymon-seccgi"
	fi
else
	SECUREXYMONCGIURL="$XYMONCGIURL"
fi
echo ""; echo ""

echo "** Note that you may need to modify your webserver configuration."
echo "** After installing, see $XYMONTOPDIR/server/etc/xymon-apache.conf for an example configuration."
echo ""; echo ""

echo "To generate Xymon availability reports, your webserver"
echo "must have write-access to a directory below the Xymon"
echo "top-level directory. I can set this up if you tell me"
echo "what group-ID your webserver runs with. This is typically"
echo "'nobody' or 'apache' or 'www-data'"
echo ""
echo "What group-ID does your webserver use [nobody] ?"
if test -z "$HTTPDGID"
then
	read HTTPDGID
fi
if test -z "$HTTPDGID"
then
	HTTPDGID="nobody"
fi
echo ""; echo ""

echo "Where to put the Xymon logfiles [/var/log/xymon] ? "
if test -z "$XYMONLOGDIR"
then
	read XYMONLOGDIR
fi
if test -z "$XYMONLOGDIR"
then
	XYMONLOGDIR=/var/log/xymon
fi
echo ""; echo ""

echo "What is the name of this host [`uname -n`] ? "
if test -z "$XYMONHOSTNAME"
then
	read XYMONHOSTNAME
fi
if test -z "$XYMONHOSTNAME"
then
	XYMONHOSTNAME=`uname -n`
fi
echo ""; echo ""

echo "What is the IP-address of this host [127.0.0.1] ? "
if test -z "$XYMONHOSTIP"
then
	read XYMONHOSTIP
fi
if test -z "$XYMONHOSTIP" -o "$XYMONHOSTIP" = "127.0.0.1"
then
	echo "** NOTE: Using 127.0.0.1 (loopback), but it is probably not what you want **"
	XYMONHOSTIP=127.0.0.1
fi
echo ""; echo ""

XYMONHOSTOS=`uname -s | tr '[A-Z]' '[a-z]'`
if test "$XYMONVAR" = ""; then
	XYMONVAR=$XYMONTOPDIR/data
fi

echo "Where should I install the Xymon man-pages (/usr/local/man) ?"
if test -z "$MANROOT"
then
	read MANROOT
fi
if test -z "$MANROOT"
then
	MANROOT=/usr/local/man
fi
echo ""; echo ""

echo "# Toplevel Makefile for Xymon"    > Makefile

echo "BUILDTOPDIR=\`pwd\`"               >>Makefile
echo ""                                  >>Makefile
echo "# configure settings for Xymon"   >>Makefile
echo "#"                                 >>Makefile
echo "# Toplevel dir"                    >>Makefile
echo "XYMONTOPDIR = $XYMONTOPDIR"        >>Makefile
echo "# Server data dir for hist/ etc."  >>Makefile
echo "XYMONVAR = $XYMONVAR"              >>Makefile
echo "# CGI scripts go in CGIDIR"        >>Makefile
echo "CGIDIR = $CGIDIR"                  >>Makefile
echo "# Admin CGI scripts go in SECURECGIDIR" >>Makefile
echo "SECURECGIDIR = $SECURECGIDIR"      >>Makefile
echo "# Where to put logfiles"           >>Makefile
echo "XYMONLOGDIR = $XYMONLOGDIR"        >>Makefile
echo "# Where to install manpages"       >>Makefile
echo "MANROOT = $MANROOT"                >>Makefile
echo "# How to run fping or xymonping"   >>Makefile
echo "FPING = $FPING"                    >>Makefile
echo ""                                  >>Makefile
echo "# Username running Xymon"          >>Makefile
echo "XYMONUSER = $XYMONUSER"            >>Makefile
echo "# Xymon server hostname"           >>Makefile
echo "XYMONHOSTNAME = $XYMONHOSTNAME"    >>Makefile
echo "# Xymon server IP-address"         >>Makefile
echo "XYMONHOSTIP = $XYMONHOSTIP"        >>Makefile
echo "# Xymon server OS"                 >>Makefile
echo "XYMONHOSTOS = $XYMONHOSTOS"        >>Makefile
echo ""                                  >>Makefile
echo "# URL for Xymon webpages"          >>Makefile
echo "XYMONHOSTURL = $XYMONHOSTURL"      >>Makefile
echo "# URL for Xymon CGIs"              >>Makefile
echo "XYMONCGIURL = $XYMONCGIURL"        >>Makefile
echo "# URL for Xymon Admin CGIs"        >>Makefile
echo "SECUREXYMONCGIURL = $SECUREXYMONCGIURL"  >>Makefile
echo "# Webserver group-ID"              >>Makefile
echo "HTTPDGID=$HTTPDGID"                >>Makefile
echo ""                                  >>Makefile

echo "# C-ARES settings"                 >>Makefile
if test "$CARESOK" = "YES"
then
    echo "SYSTEMCARES = yes"             >>Makefile

    if test "$CARESINC" != ""; then
	echo "CARESINCDIR = -I$CARESINC" >>Makefile
    fi
    if test "$CARESLIB" != ""; then
	echo "CARESLIBS = -L$LIB -lcares" >>Makefile
	echo "RPATHVAL += ${LIB}"        >>Makefile
    else
	echo "CARESLIBS = -lcares"       >>Makefile
    fi
else
    echo "SYSTEMCARES = no"              >>Makefile
fi
echo ""                                  >>Makefile

echo "# PCRE settings"                   >>Makefile
if test "$PCREOK" = "YES"
then
    if test "$PCREINC" != ""; then
	echo "PCREINCDIR = -I$PCREINC"   >>Makefile
    fi
    if test "$PCRELIB" != ""; then
	echo "PCRELIBS = -L$PCRELIB -lpcre2-8" >>Makefile
	echo "RPATHVAL += ${PCRELIB}"       >>Makefile
    else
	echo "PCRELIBS = -lpcre2-8"      >>Makefile
    fi
fi
echo ""                                  >>Makefile
if test "$ENABLERRD" = "y"
then
    echo "# RRDtool settings"            >>Makefile
    echo "RRDDEF = $RRDDEF"              >>Makefile
    if test "$RRDINC" != ""; then
	echo "RRDINCDIR = -I$RRDINC"     >>Makefile
    fi
    if test "$RRDLIB" != ""; then
	echo "RRDLIBS = -L$RRDLIB -lrrd $PNGLIB" >>Makefile
	echo "RPATHVAL += ${RRDLIB}"             >>Makefile
    else
	echo "RRDLIBS = -lrrd $PNGLIB"   >>Makefile
    fi
    echo "DORRD = yes"                   >>Makefile
fi
echo "#"                                 >>Makefile
echo "# OpenSSL settings"                >>Makefile
if test "$ENABLESSL" = "y"
then
    echo "SSLFLAGS = $SSLFLAGS"          >>Makefile
    if test "$OSSLINC" != ""; then
	echo "SSLINCDIR = -I$OSSLINC"    >>Makefile
    fi
    if test "$OSSLLIB" != ""; then
	echo "SSLLIBS = -L$OSSLLIB -lssl -lcrypto" >>Makefile
	echo "RPATHVAL += ${OSSLLIB}"    >>Makefile
    else
	echo "SSLLIBS = -lssl -lcrypto"  >>Makefile
    fi
    echo "DOSSL = yes"                   >>Makefile
fi
echo "#"                                 >>Makefile
echo "# OpenLDAP settings"               >>Makefile
echo "LDAPFLAGS = $LDAPDEF"              >>Makefile
if test "$ENABLELDAP" = "y"
then
    echo 
    if test "$LDAPINC" != ""; then
	echo "LDAPINCDIR = -I$LDAPINC"   >>Makefile
    fi
    if test "$LDAPLIB" != ""; then
	echo "LDAPLIBS = -L$LDAPLIB -lldap $LDAPLBER" >>Makefile
	echo "RPATHVAL += ${LDAPLIB}"       >>Makefile
    else
	echo "LDAPLIBS = -lldap $LDAPLBER"  >>Makefile
    fi
    echo "DOLDAP = yes"                  >>Makefile
fi
echo "#"                                 >>Makefile
echo "# clock_gettime() settings"        >>Makefile
echo "LIBRTDEF = $LIBRTDEF"              >>Makefile
echo ""                                  >>Makefile
echo "# Net-SNMP settings"               >>Makefile
echo "DOSNMP = $DOSNMP"                  >>Makefile
echo ""                                  >>Makefile

echo "# Large File Support settings"     >>Makefile
echo "LFSDEF = $LFS"                     >>Makefile

echo "" >>Makefile
if test -r build/Makefile.`uname -s | tr '/' '_'`
then
	echo "include build/Makefile.`uname -s | tr '/' '_'`" >>Makefile
	echo ""
	echo "Using `uname -s | tr '/' '_'` Makefile settings"
	echo ""
else
	echo "include build/Makefile.generic" >>Makefile
	echo ""
	echo "Using GENERIC Makefile settings (uname -s is `uname -s`)"
	echo ""
	echo "If this fails, change the compile settings in Makefile"
	echo ""
	echo "I would appreciate it if you send the changes to"
	echo "xymon-owner@xymon.com so I can include it in the next version."
	echo ""
fi
echo "" >>Makefile
if test "$INSTALLBINDIR" != ""; then
	echo "INSTALLBINDIR = $INSTALLBINDIR"   >>Makefile
fi
if test "$INSTALLETCDIR" != ""; then
	echo "INSTALLETCDIR = $INSTALLETCDIR"   >>Makefile
fi
if test "$INSTALLEXTDIR" != ""; then
	echo "INSTALLEXTDIR = $INSTALLEXTDIR"   >>Makefile
fi
if test "$INSTALLTMPDIR" != ""; then
	echo "INSTALLTMPDIR = $INSTALLTMPDIR"   >>Makefile
fi
if test "$INSTALLWEBDIR" != ""; then
	echo "INSTALLWEBDIR = $INSTALLWEBDIR"   >>Makefile
fi
if test "$INSTALLWWWDIR" != ""; then
	echo "INSTALLWWWDIR = $INSTALLWWWDIR"   >>Makefile
fi
echo "" >>Makefile
echo "# Add local CFLAGS etc. settings here" >>Makefile
echo "" >>Makefile
echo "include build/Makefile.rules" >> Makefile
echo "" >> Makefile

echo ""; echo ""
echo "Created Makefile with the necessary information to build Xymon"
echo "Some defaults are used, so do look at the Makefile before continuing."
echo ""

echo "Configuration complete - now run $MAKE (GNU make) to build the tools"

exit 0