【问题标题】:Stopping VMs in Azure when CPU usage is lower than 10%当 CPU 使用率低于 10% 时停止 Azure 中的 VM
【发布时间】:2018-08-20 13:48:32
【问题描述】:

有没有办法在 Azure 中使用 runbook 编写脚本,以便运行一个脚本来检查 CPU 使用率,如果两个小时的平均值低于 10%,它会关闭 VM?

有人有示例脚本吗?

【问题讨论】:

  • 嘿!我正在寻找同样的东西。你能做到吗?

标签: azure virtual-machine runbook azure-runbook


【解决方案1】:

我没有示例代码,但会从 Azure Monitor 开始。使用 Azure Monitor,您可以创建具有特定条件的警报,例如 CPU 使用率和时间片。

Create, view, and manage alerts using Azure Monitor

在收到警报时,您可以使用 Azure 自动化 Web 挂钩来执行修复操作。

Webhook actions for alert rules

【讨论】:

    猜你喜欢
    • 2015-12-20
    • 1970-01-01
    • 2017-02-02
    • 1970-01-01
    • 1970-01-01
    • 2019-06-20
    • 2023-03-27
    • 2018-03-21
    • 2010-09-30
    相关资源
    最近更新 更多