Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snmp support for the IF-MIB #53

Open
stackmagic opened this issue Mar 5, 2014 · 0 comments
Open

Snmp support for the IF-MIB #53

stackmagic opened this issue Mar 5, 2014 · 0 comments

Comments

@stackmagic
Copy link

Hi

Here's a little update to the snmp plugin so it supports data retrieved via the IF-MIB (RFC2233: https://tools.ietf.org/html/rfc2233 ):
stackmagic@68edff3

It supports several pieces of information such as in/out for octetc, errors, unicast, multicast, broadcast for each port of a switch (or other device that supports the IF-MIB).

The collectd configuration required is as follows:

<Plugin snmp>
    <Data "traffic">
        Type "net_if_octets"
        Table true
        Instance "IF-MIB::ifDescr"
        Values "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
    </Data>

    <Data "errors">
        Type "net_if_errors"
        Table true
        Instance "IF-MIB::ifDescr"
        Values "IF-MIB::ifInErrors" "IF-MIB::ifOutErrors"
    </Data>

    <Data "discards">
        Type "net_if_discards"
        Table true
        Instance "IF-MIB::ifDescr"
        Values "IF-MIB::ifInDiscards" "IF-MIB::ifOutDiscards"
    </Data>

    <Data "unicast">
        Type "net_if_unicast_pkts"
        Table true
        Instance "IF-MIB::ifDescr"
        Values "IF-MIB::ifInUcastPkts" "IF-MIB::ifOutUcastPkts"
    </Data>

    <Data "broadcast">
        Type "net_if_broadcast_pkts"
        Table true
        Instance "IF-MIB::ifDescr"
        Values "IF-MIB::ifInBroadcastPkts" "IF-MIB::ifOutBroadcastPkts"
    </Data>

    <Data "multicast">
        Type "net_if_multicast_pkts"
        Table true
        Instance "IF-MIB::ifDescr"
        Values "IF-MIB::ifInMulticastPkts" "IF-MIB::ifOutMulticastPkts"
    </Data>

    <Host "YOUR_SWITCH">
        Address   "YOUR_SWITCH"
        Version   2
        Community "public"
        Collect   "traffic" "errors" "discards" "unicast" "broadcast" "multicast"
    </Host>

You'll also need additional collectd types and reference them from the collectd config:

net_if_octets         ifInOctets:DERIVE:0:U,        ifOutOctets:DERIVE:0:U
net_if_errors         ifInErrors:DERIVE:0:U,        ifOutErrors:DERIVE:0:U
net_if_discards       ifInDiscards:DERIVE:0:U,      ifOutDiscards:DERIVE:0:U
net_if_unicast_pkts   ifInUcastPkts:DERIVE:0:U,     ifOutUcastPkts:DERIVE:0:U
net_if_broadcast_pkts ifInBroadcastPkts:DERIVE:0:U, ifOutBroadcastPkts:DERIVE:0:U
net_if_multicast_pkts ifInMulticastPkts:DERIVE:0:U, ifOutMulticastPkts:DERIVE:0:U

On debian, the mib can be installed via aptitude install snmp-mibs-downloader the mid definition is then available at /usr/share/mibs/ietf/IF-MIB

Manual querying would work like this `snmpwalk -v 2c -c YOUR_COMMUNITY -m ALL YOUR_SWITCH ifInUcastPkts?

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant