This is a global setting for all clusters. You need to be authenticated to change this value. If this is enabled, Couchbase Server sends an email when certain events occur. Only events related to auto-failover will trigger notification:
shell> curl -i -u Administrator:letmein \ -d 'enabled=true&sender=couchbase@localhost&recipients=admin@localhost,membi@localhost&emailHost=localhost&emailPort=25&emailEncrypt=false' http://localhost:8091/settings/alerts
Possible parameters include:
enabled: (true or false) (required).
Whether to enable or disable email notifications,
sender (string) (optional, default:
couchbase@localhost). Email address of the sender,
recipients (string) (required).
Comma-separated list of email recipients,
emailHost (string) (optional,
default: localhost). Host address of the SMTP server,
emailPort (integer) (optional,
default: 25). Port of the SMTP server,
emailEncrypt (true|false) (optional,
default: false). Whether you want to use TLS or not,
emailUser (string) (optional,
default: ""): Username for the SMTP server,
emailPass (string) (optional,
default: ""): Password for the SMTP server,
alerts (string) (optional, default:
auto_failover_node, auto_failover_maximum_reached,
auto_failover_other_nodes_down,
auto_failover_cluster_too_small). Comma separated list of
alerts that should cause an email to be sent. Possible values
are: auto_failover_node, auto_failover_maximum_reached,
auto_failover_other_nodes_down,
auto_failover_cluster_too_small.
POST /settings/alerts HTTP/1.1 Host: node.in.your.cluster:8091 Content-Type: application/x-www-form-urlencoded Authorization: Basic YWRtaW46YWRtaW4= Content-Length: 14 enabled=true&sender=couchbase@localhost&recipients=admin@localhost,membi@localhost&emailHost=localhost&emailPort=25&emailEncrypt=false�
200 OKPossible HTTP errors include:
400 Bad Request 401 Unauthorized JSON object ({"errors": {"key": "error"}}) with errors.
Possible errors returned in a JSON document include:
alerts: alerts contained invalid keys. Valid keys are: [list_of_keys].
email_encrypt: emailEncrypt must be either true or false.
email_port: emailPort must be a positive integer less than 65536.
enabled: enabled must be either true or false.
recipients: recipients must be a comma separated list of valid email addresses.
sender: sender must be a valid email address.
general: No valid parameters given.