]> git.ipfire.org Git - thirdparty/samba.git/commit
ctdb-scripts: Support periodic printing of warnings
authorMartin Schwenke <mschwenke@ddn.com>
Fri, 27 Feb 2026 07:20:21 +0000 (18:20 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 9 Jul 2026 16:02:43 +0000 (16:02 +0000)
commitce37002102ce5cc33ffeca519a631cccf62342aa
tree6e715ebb336d13e4574f3587dfa1bf02a7079042
parent5df9b4dbc9b9820069dd2d83753d67b471530d23
ctdb-scripts: Support periodic printing of warnings

In the case where a failcount only produces warnings (not
errors/unhealthy), the warnings could continue forever.  A constant
stream of warnings could dominate the logs, possibly obscuring other
useful messages.

To avoid this, add interval-based printing of warnings.  It can be set
to "hourly", "daily", any number of seconds (up to 4 digits) or
"none" (no periodic warning, use current behaviour).  The default is
"hourly".

Generally, the same interval will apply to all failcounts in a script.
However, multiple carefully placed calls to
failcount_set_warning_interval() can cause different intervals to be
used for different counters.

Add an extra unit test for vsftp monitoring to test this.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions
ctdb/doc/ctdb-script.options.5.xml
ctdb/tests/UNIT/eventscripts/40.vsftpd.monitor.003.sh [new file with mode: 0755]
ctdb/tests/UNIT/eventscripts/scripts/local.sh