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

input: snmp with subtables #1121

Closed
grisu-cl opened this issue Apr 28, 2016 · 7 comments
Closed

input: snmp with subtables #1121

grisu-cl opened this issue Apr 28, 2016 · 7 comments
Labels
bug unexpected problem or unintended behavior

Comments

@grisu-cl
Copy link

Hi,

i just go a strange result when using subtables

config1:

[[inputs.snmp.host]]
    address = "vie-sw1:161"
[[inputs.snmp.host.table]]
      name = "iftable"
[[inputs.snmp.table]]
    name = iftable"
    oid = ".1.3.6.1.2.1.2.2.1.10"
    mapping_table = ".1.3.6.1.2.1.31.1.1.1.1"  # ifname

and the output looks like expected:

 Plugin: snmp, Collection 1
* Internal: 30s
> ifInOctets,host=vie-sw1,instance=g1 ifInOctets=0i 1461877530443457065
> ifInOctets,host=vie-sw1,instance=g2 ifInOctets=0i 1461877530443672186
> ifInOctets,host=vie-sw1,instance=g3 ifInOctets=96614124i 1461877530443736317
> ifInOctets,host=vie-sw1,instance=g4 ifInOctets=313296936i 1461877530443765621
> ifInOctets,host=vie-sw1,instance=g5 ifInOctets=445335367i 1461877530443796753

if i change the config to:

  [[inputs.snmp.table]]
    name = "iftable"
    mapping_table = ".1.3.6.1.2.1.31.1.1.1.1"
    sub_tables=[".1.3.6.1.2.1.2.2.1.10"]

i got a strange output like this:

* Plugin: snmp, Collection 1
* Internal: 30s
> ifInOctets,host=vie-sw1,instance=g14 ifInOctets=53629182i 1461878069443400890
> ifInOctets,host=vie-sw1,instance=g2 ifInOctets=292292893i 1461878069443604120
> ifInOctets,host=vie-sw1,instance=g44 ifInOctets=0i 1461878069443785045
2016/04/28 23:14:29 [snmp input] Oid not found: .1.3.6.1.2.1.2.2.1.10.3
> ifInOctets,host=vie-sw1,instance=11 ifInOctets=0i 1461878069444049657
> ifInOctets,host=vie-sw1,instance=g6 ifInOctets=1721907502i 1461878069444141690
> ifInOctets,host=vie-sw1,instance=g2 ifInOctets=2435497231i 1461878069444209182
> ifInOctets,host=vie-sw1,instance=ch1 ifInOctets=1103123398i 1461878069444280801
> ifInOctets,host=vie-sw1,instance=g1 ifInOctets=0i 1461878069444351160
2016/04/28 23:14:29 [snmp input] Oid not found: .1.3.6.1.2.1.2.2.1.10.30
> ifInOctets,host=vie-sw1,instance=4 ifInOctets=0i 1461878069444534323
> ifInOctets,host=vie-sw1,instance=g25 ifInOctets=0i 1461878069444603355
> ifInOctets,host=vie-sw1,instance=g3 ifInOctets=2811876i 1461878069444742629
> ifInOctets,host=vie-sw1,instance=g3 ifInOctets=0i 1461878069444815085

as i understand the 2 config should be equal
also if i use oid=".1.3.6.1.2.1.2.2.1" the output is ok (but i dont i dont want all subtables)

any ideas?

the switch is a cisco sge2000 ....

@sparrc sparrc added the bug unexpected problem or unintended behavior label Apr 28, 2016
@sparrc
Copy link
Contributor

sparrc commented Apr 28, 2016

@titilambert another SNMP one :-), see anything obvious?

@grisu-cl
Copy link
Author

yes, there is a obvious thing ... if i am adding
include_instances = ["g1", "g10"]

it shows:

* Plugin: snmp, Collection 1
* Internal: 30s
> ifInOctets,host=vie-sw1,instance=g1 ifInOctets=0i 1461916847966013700
> ifInOctets,host=vie-sw1,instance=g1 ifInOctets=2119761526i 1461916847966128160

the snmp-response for ifName looks like that, so it is ok

data: get-response (2)
    get-response
        request-id: -1635893253
        error-status: noError (0)
        error-index: 0
        variable-bindings: 32 items
            1.3.6.1.2.1.31.1.1.1.1.1: 6731
                Object Name: 1.3.6.1.2.1.31.1.1.1.1.1 (iso.3.6.1.2.1.31.1.1.1.1.1)
                Value (OctetString): 6731
            .....
            1.3.6.1.2.1.31.1.1.1.1.10: 673130
                Object Name: 1.3.6.1.2.1.31.1.1.1.1.10 (iso.3.6.1.2.1.31.1.1.1.1.10)
                Value (OctetString): 673130

and thats the data response for ifInOctets

    data: get-response (2)
        get-response
            request-id: -283694755
            error-status: noError (0)
            error-index: 0
            variable-bindings: 2 items
                1.3.6.1.2.1.2.2.1.10.1: 0
                    Object Name: 1.3.6.1.2.1.2.2.1.10.1 (iso.3.6.1.2.1.2.2.1.10.1)
                    Value (Counter32): 0
                1.3.6.1.2.1.2.2.1.10.10: 2119761526
                    Object Name: 1.3.6.1.2.1.2.2.1.10.10 (iso.3.6.1.2.1.2.2.1.10.10)
                    Value (Counter32): 2119761526

also:
seems i have to widen my golang knowledge

@grisu-cl
Copy link
Author

grisu-cl commented May 5, 2016

short update:

in a self-compiled version this error does not occur

# ~/work/bin/telegraf version
Telegraf - Version 0.12.1-97-g4c28f15

@sparrc
Copy link
Contributor

sparrc commented May 5, 2016

which version were you using in the first case?

@sparrc
Copy link
Contributor

sparrc commented May 5, 2016

it's possible that this pr fixed your issue? #1044

@titilambert
Copy link
Contributor

@sparrc you're right, it seems related to #1044
@grisu-cl your self-compiled version does include #1044 ?

@sparrc
Copy link
Contributor

sparrc commented May 5, 2016

version 0.12.1-97-g4c28f15 would contain #1044, closing this as fixed by #1044

@sparrc sparrc closed this as completed May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants