# Identify router maintenance events

You can identify Cloud Router maintenance events and verify connectivity. For more information about maintenance
events, see [Software maintenance](https://docs.cloud.google.com/network-connectivity/docs/router/concepts/how-cloud-router-works#maintenance).

## Identify events using the *maintenance of router task* message

In the Google Cloud console, the following message appears:
**Maintenance of router task: BGP sessions will
restart. Routes are preserved for the duration of the configured timers. These
are normal events, and no data loss is expected to occur.**

This message indicates that a Cloud Router maintenance event occurred
during the issue or time period.

## Identify events using a log-based metric

### Console

1. In the Google Cloud console, go to the **Cloud Routers** page.

   [Go to Cloud Routers](https://console.cloud.google.com/hybrid/routers/list)
2. Find the Cloud Router from the list of Cloud Routers.

3. In the **Logs** column, click **View**.

   The default query appears in the query builder.
4. From the default query, note the value of the router ID of the
   `resource.labels.router_id` variable.

5. Build a new query by using the `resource.labels.router_id` value from the
   previous query as follows:

   ```
   resource.labels.router_id=ROUTER_ID
   textPayload=~"Maintenance of router task: BGP sessions will restart."
   ```
6. Create an alert with a notification of a maintenance event by using the
   previous query.

   This notification appears the first time the router is
   created and subsequently during every maintenance event.

   For more information about creating an alert,
   see [Create an alert policy on a counter metric](https://docs.cloud.google.com/logging/docs/logs-based-metrics/charts-and-alerts#alert-on-lbm).

## Verify connectivity between the on-premises router and the Cloud Router

Use the following methods to verify connectivity:

- For Cloud Router used with Cloud VPN, set up a dashboard
  for `network/received_packets_count` and `network/sent_packets_count` to
  monitor any loss in connectivity. For more information, see [View VPN
  metrics](https://docs.cloud.google.com/network-connectivity/docs/vpn/how-to/viewing-logs-metrics#metrics).

- For Cloud Router used with Cloud Interconnect, set up a
  dashboard for `network/attachment/sent_packets_count` and
  `network/attachment/received_packets_count` to monitor the connectivity of
  VLAN attachments. For more information, see [Interconnect
  metrics](https://docs.cloud.google.com/monitoring/api/metrics_gcp_i_o#gcp-interconnect).

During Cloud Router maintenance events, metrics for each resource
aren't expected to show any gap of connectivity.