Using the Ceph Manager alerts module

You can use the Ceph Manager alerts module to send simple alert messages about the IBM Storage Ceph cluster’s health by email.

Note: This module is not intended to be a robust monitoring solution. The fact that it is run as part of the Ceph cluster itself is fundamentally limiting in that a failure of the ceph-mgr daemon prevents alerts from being sent. This module can, however, be useful for standalone clusters that exist in environments where existing monitoring infrastructure does not exist.

Prerequisites

  • A running IBM Storage Ceph cluster.

  • Root-level access to the Ceph Monitor node.

Procedure

  1. Log into the cephadm shell:

    Example

    [root@host01 ~]# cephadm shell
  2. Enable the alerts module:

    Example

    [ceph: root@host01 /]# ceph mgr module enable alerts
  3. Ensure the alerts module is enabled:

    Example

    [ceph: root@host01 /]# ceph mgr module ls | more
    {
        "always_on_modules": [
            "balancer",
            "crash",
            "devicehealth",
            "orchestrator",
            "pg_autoscaler",
            "progress",
            "rbd_support",
            "status",
            "telemetry",
            "volumes"
        ],
        "enabled_modules": [
            "alerts",
            "cephadm",
            "dashboard",
            "iostat",
            "prometheus",
            "restful"
        ]
  4. Configure the Simple Mail Transfer Protocol (SMTP):

    Syntax

    ceph config set mgr mgr/alerts/smtp_host SMTP_SERVER
    ceph config set mgr mgr/alerts/smtp_destination RECEIVER_EMAIL_ADDRESS
    ceph config set mgr mgr/alerts/smtp_sender SENDER_EMAIL_ADDRESS

    Example

    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/smtp_host smtp.example.com
    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/smtp_destination example@example.com
    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/smtp_sender example2@example.com
  5. Optional: By default, the alerts module uses SSL and port 465.

    Syntax

    ceph config set mgr mgr/alerts/smtp_port PORT_NUMBER

    Example

    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/smtp_port 587

    Do not set the smtp_ssl parameter while configuring alerts.

  6. Authenticate to the SMTP server:

    Syntax

    ceph config set mgr mgr/alerts/smtp_user USERNAME
    ceph config set mgr mgr/alerts/smtp_password PASSWORD

    Example

    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/smtp_user admin1234
    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/smtp_password admin1234
  7. Optional: By default, SMTP From name is Ceph. To change that, set the smtp_from_name parameter:

    Syntax

    ceph config set mgr mgr/alerts/smtp_from_name CLUSTER_NAME

    Example

    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/smtp_from_name 'Ceph Cluster Test'
  8. Optional: By default, the alerts module checks the storage cluster’s health every minute, and sends a message when there is a change in the cluster health status. To change the frequency, set the interval parameter:

    Syntax

    ceph config set mgr mgr/alerts/interval INTERVAL

    Example

    [ceph: root@host01 /]# ceph config set mgr mgr/alerts/interval "5m"

    In this example, the interval is set to 5 minutes.

  9. Optional: Send an alert immediately:

    Example

    [ceph: root@host01 /]# ceph alerts send