Menu
Grafana Cloud

SNMP integration for Grafana Cloud

The SNMP integration lets you monitor any generic SNMP (Simple Network Management Protocol) device.

This integration includes 3 useful alerts and 1 pre-built dashboard to help monitor and visualize SNMP metrics.

Before you begin

The device you are monitoring must support reporting device data through SNMP protocol.

The instructions for enabling SNMP vary for each device. The SNMP daemon can also be installed on any linux device. Once SNMP is enabled for the device, install Grafana Alloy where it can access the SNMP device on SNMP ports UDP/TCP 161 and 162 using the instructions given below.

Install SNMP integration for Grafana Cloud

  1. In your Grafana Cloud stack, click Connections in the left-hand menu.
  2. Find SNMP and click its tile to open the integration.
  3. Review the prerequisites in the Configuration Details tab and set up Grafana Agent to send SNMP metrics to your Grafana Cloud instance.
  4. Click Install to add this integration’s pre-built dashboard and alerts to your Grafana Cloud instance, and you can start monitoring your SNMP setup.

Configuration snippets for Grafana Alloy

Advanced mode

To instruct Grafana Alloy to scrape your snmp target, go through the subsequent instructions.

The snippets provide examples to guide you through the configuration process.

First, manually copy and append the following snippets into your Grafana Alloy configuration file.

Then follow the instructions below to modify the necessary variables.

Advanced integrations snippets

alloy
prometheus.exporter.snmp "integrations_snmp" {
    target "network_switch_1" {
        address = "<host_address_1>"
        module  = "if_mib"
        auth    = "public_v2"
    }
    target "network_switch_2" {
        address = "<host_address_2>"
        module  = "if_mib"
        auth    = "public_v2"
    }
}
discovery.relabel "integrations_snmp" {
    targets = prometheus.exporter.snmp.integrations_snmp.targets

    rule {
        source_labels = ["job"]
        regex         = "(^.*snmp)\\/(.*)"
        target_label  = "job_snmp"
    }

    rule {
        source_labels = ["job"]
        regex         = "(^.*snmp)\\/(.*)"
        target_label  = "snmp_target"
        replacement   = "$2"
    }
}
prometheus.scrape "integrations_snmp" {
    targets    = discovery.relabel.integrations_snmp.output
    forward_to = [prometheus.remote_write.metrics_service.receiver]
    job_name   = "integrations/snmp"
}

Add a pair of prometheus.exporter.snmp and discovery.relabel to your Grafana Alloy configuration to monitor snmp device.

For ease of use, the provided snippets sets the instance label to the hostname using the constants.hostname Agent Flow constant variable.

If you want to monitor more than one snmp device running within the same host, set a different value for each one of them to avoid instance label conflicts. You will also need add an snmp target in the snmp_targets properties within prometheus.exporter.snmp for each target.

There is an array of options available within this component, like setting using custom snmp modules, using built in modules, setting custom walk and auth parameters.

Refer to prometheus.exporter.snmp in Grafana Alloy reference documentation for a complete description of the configuration options.

Grafana Agent static configuration (deprecated)

The following section shows configuration for running Grafana Agent in static mode which is deprecated. You should use Grafana Alloy for all new deployments.

Dashboards

The SNMP integration installs the following dashboards in your Grafana Cloud instance to help monitor your system.

  • SNMP Overview

SNMP Overview

SNMP Overview

Alerts

The SNMP integration includes the following useful alerts:

AlertDescription
SNMPRestartedInfo: SNMP target restarted.
SNMPTargetDownCritical: SNMP Target is down.
SNMPTargetInterfaceDownWarning: Network interface on SNMP target is down.

Metrics

The most important metrics provided by the SNMP integration, which are used on the pre-built dashboard and Prometheus alerts, are as follows:

  • ifHCInOctets
  • ifHCOutOctets
  • ifHighSpeed
  • ifInErrors
  • ifMtu
  • ifOperStatus
  • ifOutErrors
  • ifPhysAddress
  • ifType_info
  • snmp_scrape_duration_seconds
  • sysUpTime
  • up

Changelog

md
# 1.1.1 - November 2024

- Update status panel check queries

# 1.1.0 - July 2024

* Add asserts support
* Update mixin with additional alerts

# 1.0.1 - June 2024

* Update network interface table to use `ifHighSpeed` rather than `ifSpeed` to support interfaces capable of more than ~4.2Gb/s

# 1.0.0 - January 2024

* Fix out of date angular panel

# 0.0.3 - September 2023

* New Filter Metrics option for configuring the Grafana Agent, which saves on metrics cost by dropping any metric not used by this integration. Beware that anything custom built using metrics that are not on the snippet will stop working.

# 0.0.2 - November 2022

* Add integration status panel

# 0.0.1 - September 2022

* Initial release

Cost

By connecting your SNMP instance to Grafana Cloud, you might incur charges. To view information on the number of active series that your Grafana Cloud account uses for metrics included in each Cloud tier, see Active series and dpm usage and Cloud tier pricing.