使用单元管理工具的 manage-email 命令可管理创建电子邮件警示时系统所使用的模板。
默认情况下将系统配置为发送电子邮件警示以便通知系统管理员可能需要干预的事件和状况。可以使用 vCloud API 或 Web 控制台更新电子邮件收件人列表。可以通过使用以下形式的单元管理工具命令行替代每种警示的默认电子邮件内容:
cell-management-toolmanage-email options
选项 | 参数 | 描述 |
---|---|---|
--help | 无 | 提供此类别中可用命令的摘要。 |
--delete | 模板名称 | 要删除的模板的名称。 |
--lookup | 模板名称 | 此参数是可选的。如果不提供此选项,该命令会返回所有模板名称的列表。 |
--locale | 模板区域设置 | 默认情况下,会在 en-US 区域设置中的模板上运行此命令。使用此选项指定其他区域设置。 |
--set-template | 包含已更新的电子邮件模板的文件的路径名 | 此文件必须能够在本地主机上访问并可由用户 vcloud.vcloud 读取。例如,/tmp/my-email-template.txt |
更新电子邮件模板
以下命令可将 DISK_STORAGE_ALERT 电子邮件模板的当前内容替换为在名为
/tmp/DISK_STORAGE_ALERT-new.txt 的文件中创建的内容。
[root@cell1 /opt/vmware/vcloud-director/bin]#./cell-management-tool manage-email --set-template DISK_STORAGE_ALERT /tmp/DISK_STORAGE_ALERT-new.txt New property being stored: Property "email.template.DISK_STORAGE_ALERT.en-US" has value "This is an alert from $productName The $datastore is used by the following PVDC(s): $pvdcsList " Property "email.template.DISK_STORAGE_ALERT.en-US" has value "This is an alert from $productName The $datastore is used by the followingProvider VDC(s): $pvdcsList " VCD Email notification details: name : DISK_STORAGE_ALERT description : Alert when used disk storage exceeds threshold config key : email.template.DISK_STORAGE_ALERT.en-US template placeholders : [productName, storageContainerType, datastore, percentage, currentFreeSpaceMB, diskSizeBytes, pvdcsList] template content : This is an alert from $productName The $datastore is used by the followingProvider VDC(s): $pvdcsList