From 9d99ab7fa20d25de441c215c6f47efe4745e281c Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Fri, 29 Sep 2000 04:30:30 +0000 Subject: [PATCH] added files into CVS --- Makefile | 207 ++++++++++++++++++++++++++++++++++++++++++++++ config.mk | 38 +++++++++ httpd.in | 28 +++++++ spong.conf.in | 221 ++++++++++++++++++++++++++++++++++++++++++++++++++ spong.mk | 86 ++++++++++++++++++++ 5 files changed, 580 insertions(+) create mode 100644 Makefile create mode 100644 config.mk create mode 100644 httpd.in create mode 100644 spong.conf.in create mode 100644 spong.mk diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6c89af0 --- /dev/null +++ b/Makefile @@ -0,0 +1,207 @@ +# $Id: Makefile,v 1.1 2000/09/29 04:30:30 sljohnson Exp $ +# +# Makefile for Spong (Version 2.6f and up). +# +# Presently you can put this in the directory with the build script +# and run: +# +# make server +# make client SYSTEM=OS +# +# and if ./config/spong.conf.OS exists it will build a spong client +# installation in ./OS-client. +# +# Default for SYSTEM is defined in config.mk + +include config.mk +include spong.mk + +#---- Targets + +default: help + +help: + @echo "Try 'make client SYSTEM=' where is in the list: " + @echo " $(OS)" + @echo "Default OS is $(SYSTEM)" + +#---- Clients [ this is incredibly ugly, GH. ] +# +# A better way might be to use a client.mk include file :) and use the +# server part below ... We'd need to redefine the lists above. +# + +server: beroot bindir etcdir libdir webdir cgidir tmpdir dbdir + +beroot: + @[ `whoami` = root ] || false + @echo " Yer root" + +client: $(SYSTEM)-client + +$(SYSTEM)-test: + @[ -f ./config/spong.conf.$(SYSTEM) ] || \ + ( echo "No such system $(SYSTEM)" && false ) + mkdir -p $(SYSTEM)-client/lib/Spong + +$(SYSTEM)-client: $(SYSTEM)-test clientdir clientlib clientetc clientbin + find $(SYSTEM)-client -name CVS -exec rm -rf '{}' \; + +clientdir: $(SYSTEM)-client/lib/Spong + mkdir -p ./$(SYSTEM)-client/lib/Spong + mkdir ./$(SYSTEM)-client/etc + mkdir ./$(SYSTEM)-client/bin + +clientlib: + mkdir -p ./$(SYSTEM)-client/lib/Spong + for f in $(CLIENT_LIBS) ; do cp ./src/lib/Spong/$$f $(SYSTEM)-client/lib/Spong/; done + cp -rp ./src/lib/Spong/Client $(SYSTEM)-client/lib/Spong/ + chmod 644 $(SYSTEM)-client/lib/Spong/* + chmod 755 $(SYSTEM)-client/lib/Spong/Client + chown -R $(ADMUSER):$(ADMGROUP) ./$(SYSTEM)-client/lib + +clientbin: $(SYSTEM)-client/bin/spong-client + +$(SYSTEM)-client/bin/%: ./src/%.pl + sed -e "s%@@PERL@@%$(PERL)%g" \ + -e "s%@@BINDIR@@%$(BINDIR)%g" \ + -e "s%@@LIBDIR@@%$(LIBDIR)%g" \ + -e "s%@@ETCDIR@@%$(ETCDIR)%g" \ + -e "s%@@WWWDIR@@%$(WWWDIR)%g" \ + $< > $@ + chmod +x ./$(SYSTEM)-client/bin/* + chown $(ADMUSER):$(ADMGROUP) ./$(SYSTEM)-client/bin/* + +clientetc: + for f in $(CCONFIGS) ; do cp ./config/$$f $(SYSTEM)-client/etc; done + cat ./config/spong.conf.$(SYSTEM) >> ./$(SYSTEM)-client/etc/spong.conf + chown -R $(ADMUSER):$(ADMGROUP) ./$(SYSTEM)-client/etc + +# Server [ much nicer :) ] + +cvsclean: + find $(BINDIR) $(ETCDIR) $(LIBDIR) $(CGIDIR) $(WWWDIR) \ + -type d -name CVS -exec rm -rf '{}' \; + +# --- daemons --- + +bindir: $(BINDIR) daemons + +daemons: $(DAEMONS) + +$(BINDIR): + mkdir -p $@ + +daemons: $(DAEMONS) + +$(BINDIR)/%: ./src/%.pl + sed -e "s%@@PERL@@%$(PERL)%g" \ + -e "s%@@BINDIR@@%$(BINDIR)%g" \ + -e "s%@@LIBDIR@@%$(LIBDIR)%g" \ + -e "s%@@ETCDIR@@%$(ETCDIR)%g" \ + -e "s%@@WWWDIR@@%$(WWWDIR)%g" \ + $< > $@ + chmod -R 755 $(BINDIR) + chown -R $(ADMUSER):$(ADMGROUP) $(BINDIR) + +# --- configs --- + +etcdir: $(ETCDIR) configs etcown + +$(ETCDIR): + mkdir -p $@ + chmod 751 $(ETCDIR) +etcown: + chown -R $(ADMUSER):$(ADMGROUP) $(ETCDIR) + +configs: $(CONFIGS) + +$(ETCDIR)/spong.conf: ./config/spong.conf ./config/spong.conf.$(SYSTEM) + cat $< > $@.dist + cat ./config/spong.conf.$(SYSTEM) >> $@.dist + chmod 644 $@.dist + [ -f $@ ] || mv $@.dist $@ + touch $@ + +$(ETCDIR)/%: ./config/% + cat $< > $@.dist + [ -f $@ ] || mv $@.dist $@ + touch $@ + +# --- library --- + +libdir: $(LIBDIR) library + +$(LIBDIR): + mkdir -p $@ + +library: $(LIBDIR)/Spong + +$(LIBDIR)/Spong: ./src/lib/Spong + cp -rp ./src/lib/Spong $(LIBDIR)/Spong/ + chmod -R ugo+rwX,go-w $(LIBDIR)/Spong/ + chown -R $(ADMUSER):$(ADMGROUP) $(LIBDIR) + +# --- webpages --- + +webdir: $(WWWDIR) webpages + +$(WWWDIR): + mkdir -p $@ + mkdir $@/html + chown $(WEBUSER):$(WEBGROUP) $@ $@/html + +webpages: $(WEBDIRS) $(WEBPAGES) + +# $(WEBDIRS). Must create WEBDIR first and other directories must be +# Subdirectories. +$(WWWDIR)/docs: ./www/docs + cp -rp $< $@ + chmod -R ugo+rwX,go-w $@ + chown -R $(WEBUSER):$(WEBGROUP) $@ +$(WWWDIR)/gifs: ./www/gifs + cp -rp $< $@ + chmod -R ugo+rwX,go-w $@ + chown -R $(WEBUSER):$(WEBGROUP) $@ +$(WWWDIR)/screens: ./www/screens + cp -rp $< $@ + chmod -R ugo+rwX,go-w $@ + chown -R $(WEBUSER):$(WEBGROUP) $@ +$(WWWDIR)/html/%: ./www/html/% + sed -e "s%__DIR__%$(DOCROOT)%g" $< > $@ + chmod ugo+rwX,go-w $@ + chown $(WEBUSER):$(WEBGROUP) $@ + +# --- cgiscripts --- + +cgidir: $(CGIDIR) cgiscripts cgiown + +$(CGIDIR): + mkdir -p $@ +cgiown: + chown -R $(ADMUSER):$(ADMGROUP) $(CGIDIR) + +cgiscripts: $(CGISCRIPTS) + +$(CGIDIR)/%: ./src/%.pl + sed -e "s%@@PERL@@%$(PERL)%g" \ + -e "s%@@BINDIR@@%$(BINDIR)%g" \ + -e "s%@@LIBDIR@@%$(LIBDIR)%g" \ + -e "s%@@ETCDIR@@%$(ETCDIR)%g" \ + -e "s%@@WWWDIR@@%$(WWWDIR)%g" \ + $< > $@ + chown $(WEBUSER):$(WEBGROUP) $(CGIDIR)/* + +tmpdir: $(TMPDIR) + +$(TMPDIR): + [ -d $@ ] || mkdir -p $@ + chmod ugo+rwX,go-w $@ + chown $(WEBUSER):$(WEBGROUP) $@ + +dbdir: $(DBDIR) + +$(DBDIR): + [ -d $@ ] || mkdir -p $@ + chmod ugo+rwX,go-w $@ + chown $(WEBUSER):$(WEBGROUP) $@ diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..ccc0dba --- /dev/null +++ b/config.mk @@ -0,0 +1,38 @@ +# $Id: config.mk,v 1.1 2000/09/29 04:30:30 sljohnson Exp $ +# +# Test include for ./Makefile +# Rename this "config.mk" for testing. +# +#---- Default OS +SYSTEM=solaris + +#---- Modifiable Variables from Build Script ------------------ + +PERL=/usr/local/bin/perl + +PREFIX=/export/data/staff/guy/Apache/spong +BINDIR=$(PREFIX)/bin +ETCDIR=$(PREFIX)/etc +LIBDIR=$(PREFIX)/lib + +#WEBDIR=./WEBDIR +WEBDIR=$(PREFIX) +WWWDIR=$(WEBDIR)/www +CGIDIR=$(WEBDIR)/cgi-bin +TMPDIR=$(WEBDIR)/tmp +DBDIR=$(WEBDIR)/database + +# Apache configuration +DOMAIN=bioinfo.sickkids.on.ca +SERVER=kyle.$(DOMAIN) +VSERVER=spong-27s.$(DOMAIN) +ALIASES=spong-27s +ADMIN=guy@$(DOMAIN) + + +#DOCROOT=/www + +WEBUSER=nobody +WEBGROUP=nobody +ADMUSER=guy +ADMGROUP=jamie diff --git a/httpd.in b/httpd.in new file mode 100644 index 0000000..422a42e --- /dev/null +++ b/httpd.in @@ -0,0 +1,28 @@ +# NameVirtualHost @@SERVER@@ + + + ServerAdmin @@ADMIN@@ + ServerName @@VSERVER@@ + ServerAlias @@ALIASES@@ +# User nobody +# Group nobody + + DocumentRoot @@WWWDIR@@ + ScriptAlias /cgi/ @@CGIDIR@@ + DirectoryIndex /cgi/www-spong + + + Options Indexes FollowSymLinks + + allow from all + + + + + Options None + + allow from all + + + + diff --git a/spong.conf.in b/spong.conf.in new file mode 100644 index 0000000..20ea0ce --- /dev/null +++ b/spong.conf.in @@ -0,0 +1,221 @@ +# --------------------------------------------------------------------------- +# Generic SPONG settings, specifies where files are kept, etc... +# --------------------------------------------------------------------------- + +$SPONGSLEEP = 300; # Sleep time between check cycles. Depreciated + +# New config for specifying $SPONGSLEEP times, 'DEFAULT' value is used if not +# Overridden by program specific value. + +$SPONGSLEEP{'DEFAULT'} = 300; +# $SPONGSLEEP{'spong-network'} = 60; # Uncomment and change any of these +# $SPONGSLEEP{'spong-server'} = 120; # values to override the 'DEFAULT' +# $SPONGSLEEP{'spong-client'} = 300; # with the named program + +$SPONGSERVER = "@@VSERVER@@"; +$SPONGDB = "@@DBDIR@@"; +$SPONGTMP = "@@TMPDIR@@"; +$SPONG_UPDATE_PORT = 1998; +$SPONG_QUERY_PORT = 1999; +$SPONG_BB_UPDATE_PORT = 1984; + +# Keep status updates which cause generate an event (i.e. change of status) +# (Note: This option generate large amounts of data. Use with caution.) +$STATUS_HISTORY = 1; + +$SPONG_LOG_FILE = 1; # Log output to log file for spong-program in $SPONGTMP +$SPONG_LOG_SYSLOG = 0; # Log output to syslog + +$SPONG_SERVER_ALARM = 10; # Timeout for spong-server connection in seconds + # Set to 0 to disable + +# Number of frames to use in Web Displays +$WWWFRAMES = 3; # Can be 2 or 3, defaults to 2 + +# Set to show long host names on Host Summary web display +$WWW_FQDN = 1; + +$WWWGIFS = "/www/gifs"; +$WWWHTML = "@@WWWDIR@@/html"; +$WWWSPONG = "http://@@VSERVER@@/cgi-bin/www-spong"; +$WWWACK = "http://@@VSERVER@@/cgi-bin/www-spong-ack"; +$WWWCONTACT = "http://@@VSERVER@@/spong/page.cgi"; + +# Customized link(s) that can be added to the Host Display (right frame) +# $WWW_ACTIONBAR_CUSTOM = +# 'Machine Info'; +$WWW_ACTIONBAR_CUSTOM = ' + Charts || + Summary'; + +# Customizable link that can be added to Host Problems displays (left frame) +$WWW_PROB_ACTIONBAR = $WWW_ACTIONBAR_CUSTOM; # Default to Host Display + # actionbar + +# Customizable action bar of Title Frame (only if $WWWFRAMES = 3) +$WWW_TITLE_ACTIONBAR = ' Extended ActionBar: ' . +' Spong RRD Charts ' . +' || System Summaries'; + +# This is the default of the www-spong CGI program. Possible values are +# 'GROUPS' or 'HOST' +$WWW_DEFAULT_VIEW = "GROUPS"; + +# Date and time format strings. These are strftime() format variables +$DATEFMT = "%m/%d/%y"; # MM/DD/YY +$TIMEFMT = "%H:%M:%S"; # HH:MM:SS +$TIMEFMTNOSEC = "%H:%M"; # HH:MM +$DATETIMEFMT = "%c"; # scalar localtime() format + +$WWW_TITLE_COLOR = "#9999ff"; # Background color for table title cells +$WWW_CELL_COLOR = "#cccccc"; # Background color for table detail cells + +$WWW_USE_IMAGES = 0; + +$WWW_COLOR{"red"} = "#cc0000"; +$WWW_COLOR{"yellow"} = "#ffff00"; +$WWW_COLOR{"green"} = "#339900"; +$WWW_COLOR{"purple"} = "#990099"; +$WWW_COLOR{"blue"} = "#0000ff"; + +@WWW_REFRESH_ALLOW = ( '.*' ); +@WWW_REFRESH_DENY = ( ); + +# You should not have to changes these settings +$SERVICELISTFIX = 0; # Set his if host not displaying service status' +$HOSTGROUPALL = 0; # Set this to include the ALL group on Group Web + # displays + +# --------------------------------------------------------------------------- +# spong-cleanup parameters +# --------------------------------------------------------------------------- + +$SPONG_ARCHIVE = "/usr/local/spong/var/archives"; # Where to put the old + # history entries + +$OLD_SERVICE = 3; # How many days to keep stale status reported before + # removal +$OLD_HISTORY = 7; # How many days of history to keep for each host + +# --------------------------------------------------------------------------- +# spong-network parameters +# --------------------------------------------------------------------------- + +$CRIT_WARN_LEVEL = 1; # Number of critical failures before a service + # is reported as a critical + +$RECHECKSLEEP = 15; # Sleep time in seconds for down services recheck + # loop. Only effective if $CRIT_WARN_LEVEL is + # greater then 1 + + +# --------------------------------------------------------------------------- +# Thresholds, season to taste. These can be overridden on a host by host +# case in a spong.conf. file. +# --------------------------------------------------------------------------- + +$CHECKS = 'disk cpu processes logs'; # The client checks to run + +$MAILQWARN = 80; +$MAILQCRIT = 100; + +@DFIGNORE = ( "cd\d", "cdrom", ":" ); # List of raw fs's to ignore (regex) +$DFWARN{"ALL"} = 90; # Size to warn (yellow) on +$DFCRIT{"ALL"} = 95; # Size to panic (red) on +$DFWARN{"/usr"} = 95; # Some specifics... +$DFCRIT{"/usr"} = 98; +$DFWARN{"page"} = 50; +$DFCRIT{"page"} = 80; + +$CPUCRIT = 5.0; # Panic at load avg of 5.0 +$CPUWARN = 3.0; # Warn at load avg of 3.0 + +@PROCSWARN = ("xntpd"); +@PROCSCRIT = ("sendmail","httpd","mysqld","stidserver"); + +# $LOGWARN{"/var/log/messages"} = [ "WARNING" ]; +# $LOGCRIT{"/var/log/messages"} = [ "NOTICE" ]; + +# New Logmon configure syntax. +# The Syntax is must more complex that the old code, but it is inifinity more +# configurable. +# +# The top level varable ($LOGCHECKS) is a list of anonymous hashes +# (i.e. $LOGCHECKS is list of references to hashes). +# +# $LOGCHECKS = [ {hash}, {hash}, ]; +# +# Each hash look like the following: +# +# { logfile =>'/var/adm/messages', +# checks => [ +# { pattern =>'WARNING:(.*)', # Perl RegExp to look fo +# status =>'red', # Color to report 'green', +# # 'yellow',or 'red' +# duration =>60, # Number of minutes to report +# # events +# text =>'WARNING: $1', # Detail text to display. You +# # can use position var from +# # the regexp in the pattern +# }, +# { pattern =>'SU\s+(\S+)', +# status =>'yellow', +# duration =>10, +# text =>'SU to user $1', +# id =>'SU', # The id field is optional. It +# # is used to assign an internal +# # key to events. Normally the +# # the text field is used as the +# # key. The is field can used to +# # collapse multiple events to 1. +# }, + +$LOGCHECKS = [ { 'logfile' => '/var/log/messages', + 'checks' => [ { pattern=>'WARNING:(.*)', + status=> 'red', + duration=>60, + text=>'WARNING: $1', + }, + ], + } +]; + +# --------------------------------------------------------------------------- +# More configuration information - these variables are for the spong-network +# program, where the ones above are for the spong-client programs. +# --------------------------------------------------------------------------- + +$HTTPDOCS{"ALL"} = [ "/index.html" ]; +$HTTPPORT{"ALL"} = 80; + +# $HTTPDOCS{"sprite.its.uiowa.edu"} = [ "/index.html" ]; + +# URL's for for http check. These configuations use HTTP 1.1 for testing. +# The '_HOST_' string is replaced by the hostname as defined in spong.hosts. +# The 'DEFAULT' entry is used for testing all hosts if not overriden. +$HTTPURLS{"DEFAULT"} = [ "http://_HOST_/" ]; +$HHTPURLS{"aptest.my-inc.com"} = [ "http://_HOST_/", + "http://webtest.my-inc.com:8080/login.php3", + "http://_HOST_:8000/newapp/register.html", + ]; + +# --------------------------------------------------------------------------- +# Just a little more configuration information - these variables are for +# the spong-message program. +# --------------------------------------------------------------------------- + +# This variable controls notifications on status changes +$SEND_MESSAGE = "RED-CHANGE"; # Can be RED, or CHANGE + # or RED-CHANGE or NONE; + +# This varirable controls whether 'page' messages are allowed or not +$PAGE_MESSAGE = "YES"; # Can YES or NONE + +# This controls the max number of contact can receive in an hour +$MESSAGES_PER_HOUR = 5; + +# This controls the max number of times the same message is send in an hour +$IDENT_MESSAGES_PER_HOUR = 3; + +1; # I'm a file that gets included in perl code - leave this 1 here... diff --git a/spong.mk b/spong.mk new file mode 100644 index 0000000..1f6e915 --- /dev/null +++ b/spong.mk @@ -0,0 +1,86 @@ +# $Id: spong.mk,v 1.1 2000/09/29 04:30:30 sljohnson Exp $ +# +#---- Operating system list [ should match ./config/spong.conf.$OS ] + +OS=aix bsdi freebsd hpux irix linux osf1 solaris + +#---- Arrays from build script +# +# I don't think I'm using these at the moment but it still helps to track +# spong version differences + +BINLIST= \ + spong spong-server spong-network spong-client spong-message \ + spong-ack spong-cleanup spong-status + +LIBLIST= \ + Ack AckList History HistoryList Host HostList Info Service \ + ServiceList + +CGILIST= www-spong www-spong-ack + +#---- New "Arrays" + +DAEMONS= \ + $(BINDIR)/spong-ack \ + $(BINDIR)/spong-cleanup \ + $(BINDIR)/spong-client \ + $(BINDIR)/spong-message \ + $(BINDIR)/spong-network \ + $(BINDIR)/spong-server \ + $(BINDIR)/spong-status \ + $(BINDIR)/spong + +# For client +# CCONFIGS= spong.conf spong.hosts spong.groups spong.message +CCONFIGS= spong.conf + +CONFIGS= \ + $(ETCDIR)/spong.conf \ + $(ETCDIR)/spong.hosts \ + $(ETCDIR)/spong.groups \ + $(ETCDIR)/spong.message + +# For server, LIBRARY is lib/Spong/ +# For client, LIBRARY is lib/Spong/Client + CLIENT_LIBS in lib/Spong + +CLIENT_LIBS=Daemon.pm Status.pm + +WEBDIRS = \ + $(WWWDIR)/docs \ + $(WWWDIR)/gifs \ + $(WWWDIR)/screens +# +# This is somewhat ridiculous. We really only want to munge help.html +# but: +# 1. If we install $(WWWDIR)/html then help.html is up-to-date. +# 2. If we have a target $(WWWDIR)/%: it hides $(WWWDIR)/html/%: +# Need to talk to Stephen about completely redoing the documentation +# part of this. + +WEBPAGES = \ + $(WWWDIR)/html/cpu.html \ + $(WWWDIR)/html/disk.html \ + $(WWWDIR)/html/dns.html \ + $(WWWDIR)/html/ftp.html \ + $(WWWDIR)/html/help.html \ + $(WWWDIR)/html/history.html \ + $(WWWDIR)/html/home.html \ + $(WWWDIR)/html/host.html \ + $(WWWDIR)/html/http.html \ + $(WWWDIR)/html/imap.html \ + $(WWWDIR)/html/jobs.html \ + $(WWWDIR)/html/lan.html \ + $(WWWDIR)/html/logs.html \ + $(WWWDIR)/html/nntp.html \ + $(WWWDIR)/html/ping.html \ + $(WWWDIR)/html/pop3.html \ + $(WWWDIR)/html/procs.html \ + $(WWWDIR)/html/service.html \ + $(WWWDIR)/html/smtp.html \ + $(WWWDIR)/html/unix.html + +CGISCRIPTS= \ + $(CGIDIR)/www-spong \ + $(CGIDIR)/www-spong-ack + -- 2.30.2