2.4. 在 Ceph 仪表板上设置当日消息(MOTD)

有时,需要告知 Ceph 控制面板用户有关 Red Hat Ceph Storage 的最新新闻、更新和信息。

作为存储管理员,您可以使用命令行界面(CLI)配置当日消息(MOTD)。

当用户登录到 Ceph 控制面板时,配置的 MOTD 会在与 Telemetry 模块类似的 Ceph 仪表板的顶部显示。

MOTD 的重要性可以根据严重性进行配置,如 infowarningdanger

用户可以关闭带有 信息 或警告严重性的 MOTD。在清除本地存储 Cookie 或显示具有不同严重性的新 MOTD 前,信息 MOTD 不再显示。在新会话中再次显示带有 警告 严重性的 MOTD。

先决条件

  • 安装了监控堆栈的 Red Hat Ceph Storage 集群。
  • cephadm 主机的 root 级别访问权限。
  • 启用 dashboard 模块。

流程

  1. 为仪表板配置 MOTD:

    语法

    ceph dashboard motd set SEVERITY EXPIRES MESSAGE

    示例

    [ceph: root@host01 /]# ceph dashboard motd set danger 2d "Custom login message"
    
    Message of the day has been set.

    替换

    • SEVERITY 可以是 infowarningdanger
    • EXPIRES 可以是秒(s)、分钟(m)、小时(h)、天(d)、周(w)或永不过期(0)。
    • MESSAGE 可以是用户在登录仪表板后马上查看的任何自定义消息。
  2. 可选:设置没有过期的 MOTD:

    示例

    [ceph: root@host01 /]# ceph dashboard motd set danger 0 "Custom login message"
    
    Message of the day has been set.

  3. 获取配置的 MOTD:

    示例

    [ceph: root@host01 /]# ceph dashboard motd get
    
    Message="Custom login message", severity="danger", expires="2022-09-08T07:38:52.963882Z"

  4. 可选:使用 clear 命令清除配置 MOTD:

    示例

    [ceph: root@host01 /]# ceph dashboard motd clear
    
    Message of the day has been cleared.

验证

  • 登录到仪表板:

    https://HOST_NAME:8443
    MOTD