skip to Main Content

I am exploring to monitor VPN Tunnel status using Azure Monitor via Azure Monitor metrics Exporter(https://github.com/webdevops/azure-metrics-exporter). Monitoring Stack is Victoria Metrics + Grafana. Currently We are using Diagnostic logs to fetch the S2S Tunnel Status using below query and sending the alerts over mail+webhook to the Dispatcher team.

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

How can we onboard this alert for S2S Tunnel status on my existing solution to make it automated and more efficient?

While going through the metrics offered by Azure Monitor(https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-setup-alerts-virtual-network-gateway-metric) I couldn’t find any metric related to my problem. Any kind of help is much appreciated

2

Answers


  1. 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

    I created one S2S VPN connection in my Azure Environment

    enter image description here

    S2S connection connected successfully :-

    enter image description here

    I enabled the logging for Virtual Network Gateway and created diagnostics settings:-

    enter image description here

    Sent logs to Log analytics workspace:-

    enter image description here

    enter image description here

    If you cannot find the required metrics or want to create an alert based on the query in the question, You can select Custom logs in the Alert and then provide your query to create an alert based on the query result.

    Go to your Log analytics workspace that contains your VPN logs.

    Select Log Analytics Workspace > Alerts > Create Alert > Condition > Custom log search > Type your Log query > Create an Alert

    enter image description here

    enter image description here

    enter image description here

    You can select Webhook below :-

    enter image description here

    Provide your Webhook URL and create an Alert.

    Login or Signup to reply.
  2. AFAIK for now, Prometheus integration in azure is still in Preview and only supported for Azure AKS and Kubernetes managed clusters, Refer here

    I might recommend investigating which metrics are exported by https://github.com/webdevops/azure-metrics-exporter and check if the right metrics are present in the Azure Monitor managed service, as the documentation may be out of date. If metrics are present – then just configure https://docs.victoriametrics.com/vmalert.html and it should works.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search