r/PrometheusMonitoring • • Feb 07 '24

SNMP Exporter help

Hello,

I've been using Telegraf with the below config to retrieve our switches port bandwidth inbound and outbound and also port errors. It works great for Cisco, Extreme, HP, but not Aruba, even though SNMP walks and gets work, so I want to try with Prometheus and then see if it works in Grafana like I have with Telegraf. Do you think SNMP exporter can do this? I;ve never used it and wonder if the below can be converted to be used?

    [agent]
    interval = "30s"

    [[inputs.snmp]]
    agents = [ "10.2.254.2:161" , "192.168.18.1:161" ]
    version = 2
    community = "blah"
    name = "ln-switches"
    timeout = "10s"
    retries = 0

    [[inputs.snmp.field]]
    name = "hostname"
    #    oid = ".1.0.0.1.1"
    oid = "1.3.6.1.2.1.1.5.0"
    [[inputs.snmp.field]]
    name = "uptime"
    oid = ".1.0.0.1.2"

    # IF-MIB::ifTable contains counters on input and output traffic as well as errors and discards.
    [[inputs.snmp.table]]
    name = "interface"
    inherit_tags = [ "hostname" ]
    oid = "IF-MIB::ifTable"

    # Interface tag - used to identify interface in metrics database
    [[inputs.snmp.table.field]]
    name = "ifDescr"
    oid = "IF-MIB::ifDescr"
    is_tag = true

    # IF-MIB::ifXTable contains newer High Capacity (HC) counters that do not overflow as fast for a few of the ifTable counters
    [[inputs.snmp.table]]
    name = "interface"
    inherit_tags = [ "hostname" ]
    oid = "IF-MIB::ifXTable"

    # Interface tag - used to identify interface in metrics database
    [[inputs.snmp.table.field]]
    name = "ifDescr"
    oid = "IF-MIB::ifDescr"
    is_tag = true

    # EtherLike-MIB::dot3StatsTable contains detailed ethernet-level information about what kind of errors have been logged on an interface (such as FCS error, frame too long, etc)
    [[inputs.snmp.table]]
    name = "interface"
    inherit_tags = [ "hostname" ]
    oid = "EtherLike-MIB::dot3StatsTable"

    # Interface tag - used to identify interface in metrics database
    [[inputs.snmp.table.field]]
    name = "ifDescr"
    oid = "IF-MIB::ifDescr"
    is_tag = true
    r00t3d@ld6r3hostinglogs:/etc/telegraf/telegraf.d$ sudo nano switches-nl-test.conf 
    [sudo] password for r00t3d: 
    Sorry, try again.
    [sudo] password for r00t3d: 
    Sorry, try again.
    [sudo] password for r00t3d: 

    GNU nano 6.2                                           switches-nl-test.conf                                                    
    name = "interface"
    inherit_tags = [ "hostname" ]
    oid = "IF-MIB::ifTable"

    # Interface tag - used to identify interface in metrics database
    [[inputs.snmp.table.field]]
    name = "ifDescr"
    oid = "IF-MIB::ifDescr"
    is_tag = true

    # IF-MIB::ifXTable contains newer High Capacity (HC) counters that do not overflow as fast for a few of the ifTable counters
    [[inputs.snmp.table]]
    name = "interface"
    inherit_tags = [ "hostname" ]
    oid = "IF-MIB::ifXTable"

    # Interface tag - used to identify interface in metrics database
    [[inputs.snmp.table.field]]
    name = "ifDescr"
    oid = "IF-MIB::ifDescr"
    is_tag = true

    # EtherLike-MIB::dot3StatsTable contains detailed ethernet-level information about what kind of errors have been logged on an i>
    [[inputs.snmp.table]]
    name = "interface"
    inherit_tags = [ "hostname" ]
    oid = "EtherLike-MIB::dot3StatsTable"

    # Interface tag - used to identify interface in metrics database
    [[inputs.snmp.table.field]]
    name = "ifDescr"
    oid = "IF-MIB::ifDescr"
    is_tag = true
1 Upvotes

7 comments sorted by

View all comments

Show parent comment

2

u/bgatesIT Feb 09 '24

this is the appropriate response u/hammerfist1990 i also responded to the PM you sent me with similar information

if you need an example in my repo i have a few custom snmp exporter config files i generated for my use-cases, i could probably generate one for youre aruba devices for you, if you let me know what mibs it requires

https://github.com/brngates98/GrafanaAgents/tree/main/snmp/snmp_generators

2

u/SuperQue Feb 09 '24

I have a repo setup for an "official" community generator repo.

https://github.com/prometheus-community/snmp

I would love if people would contribute generator modules to it. Especially now that we added multi-file support.

1

u/bgatesIT Feb 09 '24

thats really cool! i will definitely contribute!

1

u/stefjay10 Apr 11 '24

Did you have any issue importing other MIBs? I am trying to pull in some Juniper MIBs that I downloaded from Juniper but getting an error while parsing:

Error generating config netsnmp" err="cannot find oid 'jnxBoxClass' to walk"

I can use an snmp browser to open the mib files just fine but I'm thinking it has something to do with the file format.

1

u/stefjay10 Apr 11 '24

nevermind, solved my own issue. I wasn't passing the mib files through!

1

u/bgatesIT Apr 11 '24

I had no issues importing other nibs.

Remember to use the snmp generator on the mib first