Revision: 6767
http://xymon.svn.sourceforge.net/xymon/?rev=6767&view=rev
Author: storner
Date: 2011-10-13 12:49:56 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
xymond: Use STATUSLIFETIME in xymonserver.cfg for the default time a status is valid, instead of hard-coding this to 30.
Modified Paths:
--------------
trunk/common/xymonserver.cfg.5
trunk/xymond/etcfiles/xymonserver.cfg.DIST
trunk/xymond/xymond.c
Modified: trunk/common/xymonserver.cfg.5
===================================================================
--- trunk/common/xymonserver.cfg.5 2011-10-13 11:55:42 UTC (rev 6766)
+++ trunk/common/xymonserver.cfg.5 2011-10-13 12:49:56 UTC (rev 6767)
@@ -144,7 +144,12 @@
the COMMENT value is displayed next to the hostname on the webpages.
Default: CDI
+.IP STATUSLIFETIME
+The number of minutes that a status is considered valid after an update.
+After this time elapses, the status will go purple.
+Default: 30 minutes
+
.SH DIRECTORIES
.IP XYMONSERVERROOT
Modified: trunk/xymond/etcfiles/xymonserver.cfg.DIST
===================================================================
--- trunk/xymond/etcfiles/xymonserver.cfg.DIST 2011-10-13 11:55:42 UTC (rev 6766)
+++ trunk/xymond/etcfiles/xymonserver.cfg.DIST 2011-10-13 12:49:56 UTC (rev 6767)
@@ -40,6 +40,8 @@
FQDN="TRUE" # Use fully-qualified hostnames internally. Keep it TRUE unless you know better.
XYMONLOGSTATUS="DYNAMIC" # Are HTML status logs statically or dynamically generated?
# Use DYNAMIC with Xymon, unless you run xymond_filestore --status --html
+STATUSLIFETIME="30" # Default number of minutes a status is valid after an update. After this
+ # time has elapsed, the status will go purple.
PINGCOLUMN="conn" # Column where the ping-test reports results.
INFOCOLUMN="info" # Column where the info-pages are reported.
Modified: trunk/xymond/xymond.c
===================================================================
--- trunk/xymond/xymond.c 2011-10-13 11:55:42 UTC (rev 6766)
+++ trunk/xymond/xymond.c 2011-10-13 12:49:56 UTC (rev 6767)
@@ -176,6 +176,7 @@
int clientsavemem = 1; /* In memory */
int clientsavedisk = 0; /* On disk via the CLICHG channel */
int allow_downloads = 1;
+int defaultvalidity = 30; /* Minutes */
#define NOTALK 0
@@ -1225,7 +1226,7 @@
void handle_status(unsigned char *msg, char *sender, char *hostname, char *testname, char *grouplist,
xymond_log_t *log, int newcolor, char *downcause, int modifyonly)
{
- int validity = 30; /* validity is counted in minutes */
+ int validity = defaultvalidity;
time_t now = getcurrenttime(NULL);
int msglen, issummary;
enum alertstate_t oldalertstatus, newalertstatus;
@@ -4847,6 +4848,11 @@
hostsfn = strdup(xgetenv("HOSTSCFG"));
}
+ if (xgetenv("STATUSLIFETIME")) {
+ int n = atoi(xgetenv("STATUSLIFETIME"));
+ if (n > 0) defaultvalidity = n;
+ }
+
/* Make sure we load hosts.cfg file, and not via the network from ourselves */
hostsfn = (char *)realloc(hostsfn, strlen(hostsfn) + 2);
memmove(hostsfn+1, hostsfn, strlen(hostsfn));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|