Skip to content

Commit 7f570fb

Browse files
committed
MB-60837 Add new alerts to setting-alert
Change-Id: Iff036f0c2f42f39b8bc2c5d3b04369c297aa588d Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/207017 Well-Formed: Restriction Checker Reviewed-by: Safian Ali <safian.ali@couchbase.com> Tested-by: Matt Hall <matt.hall@couchbase.com>
1 parent 06c0a6e commit 7f570fb

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

cbmgr.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,6 +2336,10 @@ def __init__(self):
23362336
action="store_true", help="Alert when system memory usage exceeds threshold")
23372337
group.add_argument("--alert-bucket-history-size", dest="alert_bucket_history_size",
23382338
action="store_true", help="Alert when history size for a bucket reaches 90%%")
2339+
group.add_argument("--alert-indexer-low-resident-percentage", dest="alert_indexer_low_resident_percentage",
2340+
action="store_true", help="Alert when approaching indexer low resident percentage")
2341+
group.add_argument("--alert-memcached-connections", dest="alert_memcached_connections",
2342+
action="store_true", help="Alert when the memcached connection threshold is exceeded")
23392343

23402344
@rest_initialiser(cluster_init_check=True, version_check=True)
23412345
def execute(self, opts):
@@ -2386,6 +2390,10 @@ def execute(self, opts):
23862390
alerts.append('memory_threshold')
23872391
if opts.alert_bucket_history_size:
23882392
alerts.append('history_size_warning')
2393+
if opts.alert_indexer_low_resident_percentage:
2394+
alerts.append('indexer_low_resident_percentage')
2395+
if opts.alert_memcached_connections:
2396+
alerts.append('memcached_connections')
23892397

23902398
enabled = "true"
23912399
if opts.enabled == "0":

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ _couchbase-cli setting-alert_ [--cluster <url>] [--username <user>] [--password
2525
[--alert-audit-msg-dropped] [--alert-indexer-max-ram]
2626
[--alert-timestamp-drift-exceeded] [--alert-node-time] [--alert-disk-analyzer]
2727
[--alert-memory-threshold] [--alert-bucket-history-size]
28+
[--alert-indexer-low-resident-percentage] [--alert-memcached-connections]
2829

2930
== DESCRIPTION
3031

@@ -146,6 +147,14 @@ include::{partialsdir}/cbcli/part-common-options.adoc[]
146147
Specifies that an email alert should be sent when the size of history for a
147148
bucket reaches 90% of the maximum history size.
148149

150+
--alert-indexer-low-resident-percentage::
151+
Specifies that an email alert should be sent when approaching the indexer low
152+
resident percentage.
153+
154+
--alert-memcached-connections::
155+
Specifies that an email alert should be sent when the memcached connection
156+
threshold is exceeded.
157+
149158
include::{partialsdir}/cbcli/part-host-formats.adoc[]
150159

151160
include::{partialsdir}/cbcli/part-certificate-authentication.adoc[]

test/test_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,8 @@ def setUp(self):
11131113
'--alert-meta-overhead', '--alert-meta-oom', '--alert-write-failed',
11141114
'--alert-audit-msg-dropped', '--alert-indexer-max-ram', '--alert-timestamp-drift-exceeded',
11151115
'--alert-communication-issue', '--alert-node-time', '--alert-disk-analyzer',
1116-
'--alert-bucket-history-size']
1116+
'--alert-bucket-history-size', '--alert-indexer-low-resident-percentage',
1117+
'--alert-memcached-connections']
11171118
self.server_args = {'enterprise': True, 'init': True, 'is_admin': True}
11181119
super(TestSettingAlert, self).setUp()
11191120

0 commit comments

Comments
 (0)