|
From: SebA <sp...@sy...> - 2015-11-02 13:43:14
|
Typo in new branches/4.x-master/common/hosts.cfg.5: 's/list of hosts/list of tests' Kind regards, SebA > -----Original Message----- > From: jcc...@us... > [mailto:jcc...@us...] > Sent: 18 October 2015 01:30 > To: xym...@li... > Subject: [Xymon-developer] SF.net SVN: xymon:[7696] > branches/4.x-master > > Revision: 7696 > http://sourceforge.net/p/xymon/code/7696 > Author: jccleaver > Date: 2015-10-18 00:29:54 +0000 (Sun, 18 Oct 2015) > Log Message: > ----------- > Add 'noflap' hosts.cfg option to disable flap detection on > any/all tests for a host (Thanks, Martin Lenko) > > Modified Paths: > -------------- > branches/4.x-master/Changes > branches/4.x-master/common/hosts.cfg.5 > branches/4.x-master/common/xymoncmd.c > branches/4.x-master/debian/changelog > branches/4.x-master/lib/loadhosts.c > branches/4.x-master/lib/loadhosts.h > branches/4.x-master/xymond/xymond.8 > branches/4.x-master/xymond/xymond.c > > Modified: branches/4.x-master/Changes > =================================================================== > --- branches/4.x-master/Changes 2015-10-17 19:27:17 UTC > (rev 7695) > +++ branches/4.x-master/Changes 2015-10-18 00:29:54 UTC > (rev 7696) > @@ -38,6 +38,7 @@ > * Ensure that nostale is passed down during graph zooming > (Thanks, Stef Coene) > * Add missing XMH_DATA in loadhosts (Thanks, Jacek Tomasiak) > * Search in more locations for default environment files > when using xymoncmd > +* Add a "noflap" override to disable flap detection for > any/all tests on a given host (Thanks, Martin Lenko) > > > Changes from 4.3.20 -> 4.3.21 (22 May 2015) > > Modified: branches/4.x-master/common/hosts.cfg.5 > =================================================================== > --- branches/4.x-master/common/hosts.cfg.5 2015-10-17 > 19:27:17 UTC (rev 7695) > +++ branches/4.x-master/common/hosts.cfg.5 2015-10-18 > 00:29:54 UTC (rev 7696) > @@ -537,7 +537,14 @@ > must be available, e.g. "WARNPCT:98.5" if you want the threshold to > be at 98.5% > > +.IP "noflap" > +Flap detection is normally controlled by xymond command lines, but > +if you'd like to disable flap detection for a host (or for certain > +tests on a host), you can use this option. A "noflap" by itself > +disables all flap detection for the host, or you can specify a > +list of hosts as "noflap=test1,test2,test3". > > + > .SH NETWORK TEST SETTINGS > > .IP testip > > Modified: branches/4.x-master/common/xymoncmd.c > =================================================================== > --- branches/4.x-master/common/xymoncmd.c 2015-10-17 > 19:27:17 UTC (rev 7695) > +++ branches/4.x-master/common/xymoncmd.c 2015-10-18 > 00:29:54 UTC (rev 7696) > @@ -150,7 +150,7 @@ > if (stat(envfn, &st) == -1) sprintf(envfn, > "xymonserver.cfg"); > if (stat(envfn, &st) == -1) sprintf(envfn, > "xymonclient.cfg"); > > - envfile = &envfn; > + envfile = (char *)envfn; > dbgprintf("Using default environment file > %s\n", envfile); > > } > > Modified: branches/4.x-master/debian/changelog > =================================================================== > --- branches/4.x-master/debian/changelog 2015-10-17 > 19:27:17 UTC (rev 7695) > +++ branches/4.x-master/debian/changelog 2015-10-18 > 00:29:54 UTC (rev 7696) > @@ -38,6 +38,7 @@ > * Ensure that nostale is passed down during graph zooming > (Thanks, Stef Coene) > * Add missing XMH_DATA in loadhosts (Thanks, Jacek Tomasiak) > * Search in more locations for default environment files > when using xymoncmd > + * Add a "noflap" override to disable flap detection for > any/all tests on a given host (Thanks, Martin Lenko) > > -- Japheth Cleaver <cle...@te...> Fri, 22 > May 2015 18:15:00 -0700 > > > Modified: branches/4.x-master/lib/loadhosts.c > =================================================================== > --- branches/4.x-master/lib/loadhosts.c 2015-10-17 > 19:27:17 UTC (rev 7695) > +++ branches/4.x-master/lib/loadhosts.c 2015-10-18 > 00:29:54 UTC (rev 7696) > @@ -168,6 +168,8 @@ > xmh_item_name[XMH_FLAG_HIDEHTTP] = "XMH_FLAG_HIDEHTTP"; > xmh_item_key[XMH_PULLDATA] = "PULLDATA"; > xmh_item_name[XMH_PULLDATA] = "XMH_PULLDATA"; > + xmh_item_key[XMH_NOFLAP] = "NOFLAP"; > + xmh_item_name[XMH_NOFLAP] = "XMH_NOFLAP"; > xmh_item_key[XMH_FLAG_MULTIHOMED] = "MULTIHOMED"; > xmh_item_name[XMH_FLAG_MULTIHOMED] = "XMH_MULTIHOMED"; > xmh_item_key[XMH_FLAG_HTTP_HEADER_MATCH] = > "headermatch"; > @@ -606,6 +608,12 @@ > if (p == NULL) p = xmh_find_item(host, > XMH_FLAG_NOBB2); > return p; > > + case XMH_NOFLAP: > + /* special - can be 'noflap=test1,test2' or > just 'noflap' */ > + p = xmh_find_item(host, XMH_NOFLAP); > + if ((p != NULL) && (*(p) == '\0')) p = > xmh_item_key[XMH_NOFLAP]; /* mirror flag semantics */ > + return p; > + > case XMH_PULLDATA: > /* special - can be 'pulldata=IP:PORT' or > just 'pulldata' */ > p = xmh_find_item(host, XMH_PULLDATA); > > Modified: branches/4.x-master/lib/loadhosts.h > =================================================================== > --- branches/4.x-master/lib/loadhosts.h 2015-10-17 > 19:27:17 UTC (rev 7695) > +++ branches/4.x-master/lib/loadhosts.h 2015-10-18 > 00:29:54 UTC (rev 7696) > @@ -54,6 +54,7 @@ > XMH_FLAG_NOCLEAR, > XMH_FLAG_HIDEHTTP, > XMH_PULLDATA, > + XMH_NOFLAP, > XMH_FLAG_MULTIHOMED, > XMH_FLAG_SNI, > XMH_FLAG_NOSNI, > > Modified: branches/4.x-master/xymond/xymond.8 > =================================================================== > --- branches/4.x-master/xymond/xymond.8 2015-10-17 > 19:27:17 UTC (rev 7695) > +++ branches/4.x-master/xymond/xymond.8 2015-10-18 > 00:29:54 UTC (rev 7696) > @@ -98,8 +98,10 @@ > > .IP "\-\-flap\-count=N" > Track the N latest status-changes for flap-detection. See the > -\fB\-\-flap\-seconds\fR option also. To disable flap-checks, set > -N to zero. > +\fB\-\-flap\-seconds\fR option also. To disable flap-checks > globally, > +set N to zero. To disable for a specific host, you must use the > +"noflap" option in > +.I hosts.cfg(5). > Default: 5 > > .IP "\-\-flap\-seconds=N" > > Modified: branches/4.x-master/xymond/xymond.c > =================================================================== > --- branches/4.x-master/xymond/xymond.c 2015-10-17 > 19:27:17 UTC (rev 7695) > +++ branches/4.x-master/xymond/xymond.c 2015-10-18 > 00:29:54 UTC (rev 7696) > @@ -1338,6 +1338,32 @@ > return result; > } > > +static int isset_noflap(void *hinfo, char *testname, char *hostname) > +{ > + char *tok, *dstr; > + int keylen; > + > + dstr = xmh_item(hinfo, XMH_NOFLAP); > + if (!dstr) return 0; /* no 'noflap' set */ > + > + /* Check bare noflap (disable for host) vs > "noflap=test1,test2" */ > + /* A bare noflap will be set equal to the key itself > (usually NOFLAP) like a flag */ > + if (strcmp(dstr, "NOFLAP") == 0) return 1; > + > + /* if not 'NOFLAP', we should receive "=test1,test2". > Skip the = */ > + if (*dstr = '=') dstr++; > + > + keylen = strlen(testname); > + tok = strtok(dstr, ","); > + while (tok && (strncmp(testname, tok, keylen) != 0)) > tok = strtok(NULL, ","); > + if (!tok) return 0; /* specifies noflap, but this test > is not in the list */ > + > + /* do not use flapping for the test */ > + dbgprintf("Ignoring flapping for %s:%s due to noflap > set.\n", hostname, testname); > + > + return 1; > +} > + > void handle_status(unsigned char *msg, char *sender, char > *hostname, char *testname, char *grouplist, > xymond_log_t *log, int newcolor, char > *downcause, int modifyonly) > { > @@ -1424,7 +1450,7 @@ > if (modifyonly || issummary) { > /* Nothing */ > } > - else if ((flapcount > 0) && ((now - > log->lastchange[flapcount-1]) < flapthreshold)) { > + else if ((flapcount > 0) && ((now - > log->lastchange[flapcount-1]) < flapthreshold) && > (!isset_noflap(hinfo, testname, hostname))) { > if (!log->flapping) { > errprintf("Flapping detected for %s:%s > - %d changes in %d seconds\n", > hostname, testname, > flapcount, (now - log->lastchange[flapcount-1])); > > This was sent by the SourceForge.net collaborative > development platform, the world's largest Open Source > development site. > > > -------------------------------------------------------------- > ---------------- > _______________________________________________ > Xymon-developer mailing list > Xym...@li... > https://lists.sourceforge.net/lists/listinfo/xymon-developer > |