From: Andrew Ruthven Date: Sun, 23 Dec 2007 03:44:11 +0000 (+1300) Subject: Move the logfiles to SPONGLOG. Allows easier seperation, including putting them... X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94d411a19e982838b58f8fe6d9240ea9165e350a;p=spong.git Move the logfiles to SPONGLOG. Allows easier seperation, including putting them in /var/log/spong. --- diff --git a/config/spong.conf b/config/spong.conf new file mode 100644 index 0000000..b23dd72 --- /dev/null +++ b/config/spong.conf @@ -0,0 +1,249 @@ +# --------------------------------------------------------------------------- +# Generic SPONG settings, specifies where files are kept, etc... +# --------------------------------------------------------------------------- +# $Id: spong.conf.in,v 1.6 2005/11/15 12:38:22 scriptkiller Exp $ + +$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 = "spong-server.example.com"; +$SPONGDB = "/usr/local/spong/var/database"; +$SPONGTMP = "/usr/local/spong/tmp"; +$SPONGLOG = "/usr/local/spong/log"; +$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 +# 1: display only data +# 2: display GROUPS- or HOST-View in left frame, display data +# in right frame +# 3: same as 2 but also including a title-frame on top of the others +$WWWFRAMES = 3; # Can be 1, 2 or 3, defaults to 2 + +# This specifies where main content is displayed. +# Only useful if you use spong with $WWWFRAMES set to 1 and +# have spong embedded in some other web-based system. +# Set this to "right" if you don't use this feature! +$WWW_MAIN_DISPLAY_FRAME = "right"; + + +# Title Frame Size (if $WWWFRAMES = 3) (In HTML Frame size specs) +$WWW_TITLE_SIZE = "40"; + +# Set to show long host names on Host Summary web display +$WWW_FQDN = 1; + +$WWWGIFS = "/spong/gifs"; # URL to www/gifs dir +$WWWDOCS = "/spong/docs"; # URL to www/docs dir +$WWWHTML = "/usr/local/spong/www/html"; # File path to SPONG/www dir +$WWWSPONG = "/cgi-bin/www-spong"; # URL path to www-spong program +$WWWACK = "/cgi-bin/www-spong-ack"; # URL path to www-spong-ack pgm + +$WAPSPONG = "/cgi-bin/wap-spong"; # URL path to wap-spong pgm + # BETA version of this feature + +#$WWWCONTACT = "/spong/page.cgi"; # This CGI script is not provided. See + # the admin-guide for more infomation + +# 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 'HOSTS' +$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 + +# Set to 1 if you want to use images in output +$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 this 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 +# Not supported in all configs: 'memory' + +$MAILQWARN = 80; +$MAILQCRIT = 100; + +@DFIGNORE = ( "cd\d", "cdrom", ":", "proc" ); # 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; + +$CPUWARN = 3.0; # Warn at load avg of 3.0 +$CPUCRIT = 5.0; # Panic at load avg of 5.0 + +$MEMWARN = 90; # Warn at 90% memory usage +$MEMCRIT = 95; # Panic at 95% memory usage + +@PROCSWARN = ("xntpd"); +@PROCSCRIT = ("sendmail","httpd","mysqld","stidserver"); + +# $LOGWARN{"/var/log/messages"} = [ "WARNING" ]; +# $LOGCRIT{"/var/log/messages"} = [ "NOTICE" ]; + +# New Logmon configure syntax. +# The Syntax is much more complex than 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. +# --------------------------------------------------------------------------- + +# 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_/" ]; +$HTTPURLS{"aptest.my-inc.com"} = [ "http://_HOST_/", + "http://webtest.my-inc.com:8080/login.php3", + "http://_HOST_:8000/newapp/register.html", + ]; + +# --------------------------------------------------------------------------- +# MySQL plugin +# --------------------------------------------------------------------------- + +$MYSQLADMIN = "/usr/bin/mysqladmin -h"; + +# --------------------------------------------------------------------------- +# 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/src/spong-client.pl b/src/spong-client.pl index 052c31b..4b91db5 100755 --- a/src/spong-client.pl +++ b/src/spong-client.pl @@ -149,7 +149,7 @@ sub init_logging { Spong::Log::set_debug_context( 'debuglevel' => $debug ); - my $filename = ($SPONG_LOG_FILE) ? "$SPONGTMP/spong-client.log" : ""; + my $filename = ($SPONG_LOG_FILE) ? "$SPONGLOG/spong-client.log" : ""; my $syslog = ($SPONG_LOG_SYSLOG) ? 1 : 0; Spong::Log::set_error_context( syslog => $syslog, diff --git a/src/spong-network.pl b/src/spong-network.pl index 86d0439..c52e393 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -447,7 +447,7 @@ sub init_logging { Spong::Log::set_debug_context( 'debuglevel' => $debug ); - my $filename = ($SPONG_LOG_FILE) ? "$SPONGTMP/spong-network.log" : ""; + my $filename = ($SPONG_LOG_FILE) ? "$SPONGLOG/spong-network.log" : ""; my $syslog = ($SPONG_LOG_SYSLOG) ? 1 : 0; Spong::Log::set_error_context( syslog => $syslog, diff --git a/src/spong-server.pl b/src/spong-server.pl index e832e2d..d9db565 100755 --- a/src/spong-server.pl +++ b/src/spong-server.pl @@ -1184,7 +1184,7 @@ sub init_logging { Spong::Log::set_debug_context( 'debuglevel' => $debug ); - my $filename = ($SPONG_LOG_FILE) ? "$SPONGTMP/spong-server.log" : ""; + my $filename = ($SPONG_LOG_FILE) ? "$SPONGLOG/spong-server.log" : ""; my $syslog = ($SPONG_LOG_SYSLOG) ? 1 : 0; Spong::Log::set_error_context( syslog => $syslog, diff --git a/src/spong-status.pl b/src/spong-status.pl index 2ad71b6..630e9cd 100755 --- a/src/spong-status.pl +++ b/src/spong-status.pl @@ -157,7 +157,7 @@ sub init_logging { Spong::Log::set_debug_context( 'debuglevel' => $debug ); - my $filename = ($SPONG_LOG_FILE) ? "$SPONGTMP/spong-server.log" : ""; + my $filename = ($SPONG_LOG_FILE) ? "$SPONGLOG/spong-server.log" : ""; my $syslog = ($SPONG_LOG_SYSLOG) ? 1 : 0; Spong::Log::set_error_context( syslog => $syslog, diff --git a/www/docs/spong-client.html b/www/docs/spong-client.html index e838bce..4e0bba4 100755 --- a/www/docs/spong-client.html +++ b/www/docs/spong-client.html @@ -174,7 +174,7 @@ The directory that Spong programs use for temporary store and work files. It should be different directory than /tmp for operation and security reasons.
$SPONG_LOG_FILE
-If set to 1, spong-client will log errors to a log file in $SPONGTMP +If set to 1, spong-client will log errors to a log file in $SPONGLOG named spong-client.log.
$SPONG_LOG_SYSLOG
diff --git a/www/docs/spong-network.html b/www/docs/spong-network.html index 4c5a846..bbcad4a 100755 --- a/www/docs/spong-network.html +++ b/www/docs/spong-network.html @@ -173,7 +173,7 @@ The directory that Spong programs use for temporary store and work files. It should be different a directory than /tmp for operation and security reasons.
$SPONG_LOG_FILE
-If set to 1, spong-network will log errors to a log file in $SPONGTMP +If set to 1, spong-network will log errors to a log file in $SPONGLOG named spong-network.log.
$SPONG_LOG_SYSLOG
diff --git a/www/docs/spong-server.html b/www/docs/spong-server.html index 54349a5..df2eb70 100755 --- a/www/docs/spong-server.html +++ b/www/docs/spong-server.html @@ -242,7 +242,7 @@ log. This status message information is access via the web interface by click on the status color or icon link of an event in a History Listing.
$SPONG_LOG_FILE
-If set to 1, spong-network will log errors to a log file in $SPONGTMP +If set to 1, spong-network will log errors to a log file in $SPONGLOG named spong-network.log.
$SPONG_LOG_SYSLOG
diff --git a/www/docs/spong.conf.html b/www/docs/spong.conf.html index af912dc..ab13203 100644 --- a/www/docs/spong.conf.html +++ b/www/docs/spong.conf.html @@ -110,7 +110,7 @@ periods of time. For security reasons, this should probably be something other then /tmp, or /var/tmp.
$SPONG_LOG_FILE
-If set to 1, spong-network will log errors to a log file in $SPONGTMP +If set to 1, spong-network will log errors to a log file in $SPONGLOG named spong-network.log.
$SPONG_LOG_SYSLOG