用于监视 VPN 隧道状态的 Azure Monitor 指标

标签 azure prometheus azure-monitoring victoriametrics

我正在探索通过 Azure Monitor 指标导出器 ( https://github.com/webdevops/azure-metrics-exporter ) 使用 Azure Monitor 监视 VPN 隧道状态。监控堆栈是Victoria Metrics + Grafana。目前,我们正在使用诊断日志来使用以下查询获取 S2S 隧道状态,并通过邮件+webhook 将警报发送给调度程序团队。

AzureDiagnostics
| where TimeGenerated > ago(5m)
| where Category == "TunnelDiagnosticLog" and OperationName == "TunnelDisconnected"
| project
TimeGenerated,
Resource,
status_s,
remoteIP_s,
stateChangeReason_s,
OperationName

我们如何在我现有的解决方案上加入此 S2S 隧道状态警报,以使其自动化且更加高效?

在查看 Azure Monitor( https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-setup-alerts-virtual-network-gateway-metric ) 提供的指标时,我找不到与我的问题相关的任何指标。非常感谢任何形式的帮助

最佳答案

How can we onboard this alert for S2S Tunnel status on my existing solution to make it automated and more efficient? I couldn’t find any metric related to my problem. Any kind of help is much appreciated

我在 Azure 环境中创建了一个 S2S VPN 连接

enter image description here

S2S 连接成功:-

enter image description here

我启用了虚拟网络网关的日志记录并创建了诊断设置:-

enter image description here

将日志发送到日志分析工作区:-

enter image description here

enter image description here

如果您找不到所需的指标或想要根据问题中的查询创建警报,您可以在警报中选择自定义日志,然后提供您的查询以根据查询结果创建警报。

转到包含 VPN 日志的日志分析工作区。

选择 Log Analytics 工作区 > 警报 > 创建警报 > 条件 > 自定义日志搜索 > 键入日志查询 > 创建警报

enter image description here

enter image description here

enter image description here

您可以选择下面的 Webhook :-

enter image description here

提供您的 Webhook URL 并创建警报。

关于用于监视 VPN 隧道状态的 Azure Monitor 指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75255289/

相关文章:

Azure DevOps 托管代理 : How to build into a container, 然后提取构建工件

sql - 我可以将列的默认值设置为同一表中同一行的另一列的字符串吗?

azure - 尝试让 Azure Kubernetes 服务使用服务中的集群负载均衡器时出错

java - 使用 Prometheus 和 Grafana 监控基于 Jetty 的 Java 应用程序

go - 普罗米修斯计数器 : How to get current value with golang client?

azure-data-factory-2 - 对长期运行的 Azure 数据工厂管道发出警报的方法

用于容器的 Azure 监视器与应用程序洞察

c# - 开发期间访问 Azure 存储时无法加载程序集 'Microsoft.Data.OData'

apache-kafka - Kafka Streams K-Table 大小监控

azure - 如何测量 Azure Web 角色中的内存消耗