This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SNMP Query Interface Traffic

Hello,

I try to get it working via SNMP to get the Speed of the Interfaces. I use the program telegraf from Influx to get the data and Grafana to visualize it. I got every values which I need via snmpwalk but when I query for example the Table IF-MIB::ifDescr which provides the Names of the Interfaces then I will get this error from snmptable "Was that a table? IF-MIB::ifDescr".  I also get this error message when I query the  table IF-MIB::ifInOctets and the  IF-MIB::ifOutOctets. 

Is there any way to fix this or is it not possible to get the Interface Speed via SNMP?

Thank you.



This thread was automatically locked due to age.
  • Hi Matthias,

    thanks for your question, i just enabled snmp at my "Home XG" and gave it a try.

     

    If i query the interface description Table of my XG17 MR2 i get the following:

    Interface Description OID: 1.3.6.1.2.1.2.2.1.2

     

     

    Values Table seems to be working fine:

     

    i use the following OIDs:

    snmpIfOperStatus        = '1.3.6.1.2.1.2.2.1.8';
    snmpIfInOctets          = '1.3.6.1.2.1.2.2.1.10';
    snmpIfOutOctets         = '1.3.6.1.2.1.2.2.1.16';
    snmpIfDescr             = '1.3.6.1.2.1.2.2.1.2';
    snmpIfSpeed             = '1.3.6.1.2.1.2.2.1.5';
    snmpIPAdEntIfIndex      = '1.3.6.1.2.1.4.20.1.2';

     

    Yours Lukas

  • Hi Lukas,

     thanks for you reply. When I do an snmpwalk I also get the correct results with these command  "snmpwalk -v2c -c test1 172.16.0.254"

    IF-MIB::ifDescr.1 = STRING: lo
    IF-MIB::ifDescr.2 = STRING: ipsec0
    IF-MIB::ifDescr.3 = STRING: sit0
    IF-MIB::ifDescr.4 = STRING: ip6tnl0
    IF-MIB::ifDescr.5 = STRING: Port1
    IF-MIB::ifDescr.6 = STRING: Port2
    IF-MIB::ifDescr.7 = STRING: imq0
    IF-MIB::ifDescr.8 = STRING: imq1
    IF-MIB::ifDescr.9 = STRING: gre0
    IF-MIB::ifDescr.10 = STRING: gretap0
    IF-MIB::ifDescr.11 = STRING: GuestAP
    IF-MIB::ifDescr.13 = STRING: Port2_ppp

     

    When I test the config with telegraf then I get this error: "Was that a table? IF-MIB::ifDescr"

    This is my telegraf config for the Sophos XG:

    [[inputs.snmp]]
    agents = [ "172.16.0.254:161" ]
    version = 2
    community = "test1"
    name = "snmp"

    [[inputs.snmp.field]]
    name = "hostname"
    oid = "1.3.6.1.2.1.1.5"
    is_tag = true

    [[inputs.snmp.table]]
    name = "snmp"
    inherit_tags = [ "hostname" ]
    oid = "1.3.6.1.2.1.2.2.1.2"

    [[inputs.snmp.table.field]]
    name = "ifName"
    oid = "IF-MIB::ifDescr"
    is_tag = true

    When I do an snmptable with the command "snmptable -v 2c -c test1 172.16.0.254 IF-MIB::ifDescr" then I also get the error "IF-MIB::ifDescr". In the config you can also see, that I have used the same oid as you have at "snmpIfDescr". 

     Do you have maybe another hint for me?

     

    Thank you.

    Regards

    Matthias

  • Hi Matthias,

    i would call it "wrong use if snmptable"

    you get this error because it is just a list of oids not a table ;)

    i don't know how telegraf works, mostly i work with nagios/icinga or icinga2 - maybe you can force it to use snmpget / snmpwalk for given OIDs.

     

  • Hi Lukas,

    I will check if telegraf support snmpget or snmpwalk otherwise I can also write a script which polls the data via snmpget and let it write to InfluxDB then, that Grafana can get the values. I also tried it with Check_MK but it was also not able to retrieve the data via SNMP.

    Regards

    Matthias