Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
titilambert committed Mar 22, 2016
1 parent 0752879 commit cd9d2a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plugins/inputs/snmp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,23 +492,23 @@ Note: the plugin will add instance name as tag *instance*
# oid attribute is useless

# SNMP SUBTABLES
[[plugins.snmp.subtable]]
[[inputs.snmp.subtable]]
name = "bytes_recv"
oid = ".1.3.6.1.2.1.31.1.1.1.6"
unit = "octets"

[[plugins.snmp.subtable]]
[[inputs.snmp.subtable]]
name = "bytes_send"
oid = ".1.3.6.1.2.1.31.1.1.1.10"
unit = "octets"
```

#### Configuration notes

- In **plugins.snmp.table** section, the `oid` attribute is useless if
- In **inputs.snmp.table** section, the `oid` attribute is useless if
the `sub_tables` attributes is defined

- In **plugins.snmp.subtable** section, you can put a name from `snmptranslate_file`
- In **inputs.snmp.subtable** section, you can put a name from `snmptranslate_file`
as `oid` attribute instead of a valid OID

### Measurements & Fields:
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/snmp/snmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (s *Snmp) Gather(acc telegraf.Accumulator) error {
return err
} else {
for _, line := range strings.Split(string(data), "\n") {
oidsRegEx := regexp.MustCompile(`([^\t]*)\t*([^\t]*)`)
oidsRegEx := regexp.MustCompile(`([^ \t]*)[ \t]*([^ \t]*)`)
oids := oidsRegEx.FindStringSubmatch(string(line))
if oids[2] != "" {
oid_name := oids[1]
Expand Down

0 comments on commit cd9d2a4

Please sign in to comment.