Sensu Bonsai Asset Build Status Gem Version Code Climate Test Coverage Dependency Status

Sensu SNMP Plugin


This plugin provides native SNMP instrumentation for monitoring and metrics collection, including: generic OID single/bulk query for status and metrics, and ifTable metrics.

The Sensu assets packaged from this repository are built against the Sensu ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator or handler), make sure you include the corresponding Sensu ruby runtime asset in the list of assets needed by the resource. The current ruby-runtime assets can be found here in the Bonsai Asset Index


  • bin/check-snmp.rb
  • bin/check-snmp-disk.rb
  • bin/metrics-snmp-bulk.rb
  • bin/metrics-snmp-if.rb
  • bin/metrics-snmp.rb

Usage examples


Usage: metrics-snmp.rb (options)
    -C snmp community
    -g                               Replace dots with underscores in hostname
    -h host
    -d mibdir                        Full path to custom MIB directory.
    -l mib[,mib,mib...]              Custom MIBs to load (from custom mib path).
    -O OID
    -P, --port PORT
    -p prefix                        prefix to attach to graphite path
    -v version                       SNMP version to use (SNMPv1, SNMPv2c (default))
    -s suffix                        suffix to attach to graphite path (required)


Sensu Go

Asset registration

Assets are the best way to make use of this handler. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:

sensuctl asset add sensu-plugins/sensu-plugins-snmp

If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai Asset Index page.

Asset definition
type: Asset
api_version: core/v2
  name: sensu-plugins-snmp
  sha512: 7edd57dab82bfd97662d3f2d6ddfb70c41bbcba591b1c2c4077d0107c667fbd2c64ad2bcef51e0192e18176ade60fde403c4784ac141ba1a932cc65c8c897169
  - entity.system.os == 'linux'
  - entity.system.arch == 'amd64'
  - entity.system.platform_family == 'rhel'
Check definition
type: CheckConfig
  command: "metrics-snmp.rb -h -O"
  interval: 10
  publish: true
  - sensu-plugins-snmp
  - sensu-ruby-runtime
  - snmp-pollers
  output_metric_format: graphite_plaintext
  - influx-db

Sensu Core

Check definition
  "checks": {
    "check-snmp": {
    "command": "metrics-snmp.rb -h -O",
    "subscribers": [
    "interval": 60


Sensu Go

See the instructions above for asset registration

Sensu Core

Install and setup plugins on Sensu Core