Skip to content

ensc/snmpd-diskio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snmpd-diskio -- an extension for net-snmp to give out diskio stats

This tool is a 'pass' script for net-snmp which returns the Linux IO
counters (keyword: /proc/diskstats, /sys/block/*/stat).  There must be
added an entry like

| pass .1.3.6.1.4.1.22683.1	/usr/sbin/snmpd-diskio

in snmpd.conf; the returned suboids are:

  .1.3.6.1.4.1.22683.1.0.0   -- number of indices
  .1.3.6.1.4.1.22683.1.1     -- name/alias
  .1.3.6.1.4.1.22683.1.2     -- numeric index
  .1.3.6.1.4.1.22683.1.10    -- reads completed
  .1.3.6.1.4.1.22683.1.11    -- reads merged
  .1.3.6.1.4.1.22683.1.12    -- sectors read
  .1.3.6.1.4.1.22683.1.13    -- read time (ms)
  .1.3.6.1.4.1.22683.1.20    -- writes completed
  .1.3.6.1.4.1.22683.1.21    -- writes merged
  .1.3.6.1.4.1.22683.1.22    -- sectors written
  .1.3.6.1.4.1.22683.1.23    -- write time (ms)
  .1.3.6.1.4.1.22683.1.30    -- num ios
  .1.3.6.1.4.1.22683.1.31    -- io time (ms)
  .1.3.6.1.4.1.22683.1.32    -- weighted


This plugin returns information only for configured devices which can
be specified by their path or by their label or uuid. For example, the
configuration file could look like


  # identifier            alias   idx
  UUID="559900ff-79fa-49a7-8c0f-f37e5b04e747"     sda2    1
  LABEL="/"               sda1     2
  /dev/sda5               "sda5"  10
  /dev/vg00/usr-share     xxxx    20

and an snmpwalk returns

  $ snmpwalk -c public -v 2c localhost .1.3.6.1.4.1.22683.1
  SNMPv2-SMI::enterprises.22683.1.1.1 = STRING: "sda2"
  SNMPv2-SMI::enterprises.22683.1.1.2 = STRING: "sda1"
  SNMPv2-SMI::enterprises.22683.1.1.10 = STRING: "sda5"
  SNMPv2-SMI::enterprises.22683.1.1.20 = STRING: "xxxx"
  SNMPv2-SMI::enterprises.22683.1.10.1 = Counter32: 1571
  SNMPv2-SMI::enterprises.22683.1.10.2 = Counter32: 1764628
  SNMPv2-SMI::enterprises.22683.1.10.10 = Counter32: 2628619
  SNMPv2-SMI::enterprises.22683.1.10.20 = Counter32: 720922
  SNMPv2-SMI::enterprises.22683.1.11.1 = Counter32: 2680
  SNMPv2-SMI::enterprises.22683.1.11.2 = Counter32: 7882
  SNMPv2-SMI::enterprises.22683.1.11.10 = Counter32: 967523
  SNMPv2-SMI::enterprises.22683.1.11.20 = Counter32: 0
  ...
  SNMPv2-SMI::enterprises.22683.1.32.1 = Counter32: 355519
  SNMPv2-SMI::enterprises.22683.1.32.2 = Counter32: 284710552
  SNMPv2-SMI::enterprises.22683.1.32.10 = Counter32: 1405787979
  SNMPv2-SMI::enterprises.22683.1.32.20 = Counter32: 2626589987
  SNMPv2-SMI::enterprises.22683.1.32.20 = No more variables left in this MIB View (It is past the end of the MIB tree)



Requirements:
 * recent kernel which returns diskstats in /sys/block/*/stat
 * libblkid > 2.0
 * (highly recommended) dietlibc



Locations:
  default setup:
    /usr/local/sbin/snmpd-diskio          --  program given to 'pass'
    /usr/local/libexec/snmpd-diskio-cache --  helper program compiling
                                              the configuration file
    /usr/local/etc/snmp/diskio.conf       --  configuration file
    /var/run/snmpd-diskio/volumes         --  compiled configuration file


  sample .spec:
    /usr/sbin/snmpd-diskio          --  program given to 'pass'
    /usr/libexec/snmpd-diskio-cache --  helper program compiling the
                                        configuration file
    /etc/snmp/diskio.conf           --  configuration file
    /var/run/snmpd-diskio/volumes   --  compiled configuration file

About

extension for net-snmp to give out diskio stats

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published