Skip to content

Commit 87caeda

Browse files
MB-53077 Add support for memory threshold alert
Change-Id: I16644a5bfdb945513bb9440d9e614851012c6cb2 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/178164 Well-Formed: Restriction Checker Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Dave Finlay <dave.finlay@couchbase.com>
1 parent 1058d4d commit 87caeda

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

cbmgr.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,8 @@ def __init__(self):
21012101
action="store_true", help="Alert when clocks on two servers are more than five seconds apart")
21022102
group.add_argument("--alert-communication-issue", dest="alert_communication_issue",
21032103
action="store_true", help="Alert when nodes are experiencing communication issues")
2104+
group.add_argument("--alert-memory-threshold", dest="alert_memory_threshold",
2105+
action="store_true", help="Alert when system memory usage exceeds threshold")
21042106

21052107
def execute(self, opts):
21062108
rest = ClusterManager(opts.cluster, opts.username, opts.password, opts.ssl, opts.ssl_verify,
@@ -2147,6 +2149,8 @@ def execute(self, opts):
21472149
alerts.append('ep_clock_cas_drift_threshold_exceeded')
21482150
if opts.alert_communication_issue:
21492151
alerts.append('communication_issue')
2152+
if opts.alert_memory_threshold:
2153+
alerts.append('memory_threshold')
21502154

21512155
enabled = "true"
21522156
if opts.enabled == "0":

docs/generated/doc/couchbase-cli/couchbase-cli-setting-alert.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,11 @@ <h2 id="_options">OPTIONS</h2>
619619
<p>Specifies that an email alert should be sent when nodes are experiencing
620620
communication issues.</p>
621621
</dd>
622+
<dt class="hdlist1">--alert-memory-threshold</dt>
623+
<dd>
624+
<p>Specifies that an email alert should be sent when any node&#8217;s system memory
625+
usage exceeds a threshold</p>
626+
</dd>
622627
</dl>
623628
</div>
624629
</div>

docs/generated/man/man1/couchbase-cli-setting-alert.1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: couchbase-cli-setting-alert
33
.\" Author: Couchbase
44
.\" Generator: Asciidoctor 2.0.10
5-
.\" Date: 2021-04-22
5+
.\" Date: 2022-07-28
66
.\" Manual: Couchbase CLI Manual
77
.\" Source: Couchbase CLI 1.0.0
88
.\" Language: English
99
.\"
10-
.TH "COUCHBASE\-CLI\-SETTING\-ALERT" "1" "2021-04-22" "Couchbase CLI 1.0.0" "Couchbase CLI Manual"
10+
.TH "COUCHBASE\-CLI\-SETTING\-ALERT" "1" "2022-07-28" "Couchbase CLI 1.0.0" "Couchbase CLI Manual"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -213,6 +213,12 @@ machines in the cluster are more that five seconds apart.
213213
Specifies that an email alert should be sent when nodes are experiencing
214214
communication issues.
215215
.RE
216+
.sp
217+
\-\-alert\-memory\-threshold
218+
.RS 4
219+
Specifies that an email alert should be sent when any node\(cqs system memory
220+
usage exceeds a threshold
221+
.RE
216222
.SH "HOST FORMATS"
217223
.sp
218224
When specifying a host for the couchbase\-cli command the following formats are expected:

docs/modules/cli/pages/cbcli/couchbase-cli-setting-alert.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ include::{partialsdir}/cbcli/part-common-options.adoc[]
128128
Specifies that an email alert should be sent when nodes are experiencing
129129
communication issues.
130130

131+
--alert-memory-threshold::
132+
Specifies that an email alert should be sent when any node's system memory
133+
usage exceeds a threshold
134+
131135
include::{partialsdir}/cbcli/part-host-formats.adoc[]
132136

133137
== EXAMPLES

0 commit comments

Comments
 (0)