Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
a95710ed
Commit
a95710ed
authored
9 years ago
by
Thibault Cohen
Committed by
Cameron Sparr
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
SNMP plugin fixes
fixes #873
parent
51d77242
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
plugins/inputs/snmp/README.md
+4
-4
4 additions, 4 deletions
plugins/inputs/snmp/README.md
plugins/inputs/snmp/snmp.go
+4
-6
4 additions, 6 deletions
plugins/inputs/snmp/snmp.go
with
9 additions
and
10 deletions
CHANGELOG.md
+
1
−
0
View file @
a95710ed
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
-
[
#656
](
https://github.com/influxdata/telegraf/issues/656
)
: No longer run
`lsof`
on linux to get netstat data, fixes permissions issue.
-
[
#656
](
https://github.com/influxdata/telegraf/issues/656
)
: No longer run
`lsof`
on linux to get netstat data, fixes permissions issue.
-
[
#907
](
https://github.com/influxdata/telegraf/issues/907
)
: Fix prometheus invalid label/measurement name key.
-
[
#907
](
https://github.com/influxdata/telegraf/issues/907
)
: Fix prometheus invalid label/measurement name key.
-
[
#841
](
https://github.com/influxdata/telegraf/issues/841
)
: Fix memcached unix socket panic.
-
[
#841
](
https://github.com/influxdata/telegraf/issues/841
)
: Fix memcached unix socket panic.
-
[
#873
](
https://github.com/influxdata/telegraf/issues/873
)
: Fix SNMP plugin sometimes not returning metrics. Thanks @titiliambert!
## v0.11.1 [2016-03-17]
## v0.11.1 [2016-03-17]
...
...
This diff is collapsed.
Click to expand it.
plugins/inputs/snmp/README.md
+
4
−
4
View file @
a95710ed
...
@@ -492,12 +492,12 @@ Note: the plugin will add instance name as tag *instance*
...
@@ -492,12 +492,12 @@ Note: the plugin will add instance name as tag *instance*
# oid attribute is useless
# oid attribute is useless
# SNMP SUBTABLES
# SNMP SUBTABLES
[[
plugin
s.snmp.subtable]]
[[
input
s.snmp.subtable]]
name = "bytes_recv"
name = "bytes_recv"
oid = ".1.3.6.1.2.1.31.1.1.1.6"
oid = ".1.3.6.1.2.1.31.1.1.1.6"
unit = "octets"
unit = "octets"
[[
plugin
s.snmp.subtable]]
[[
input
s.snmp.subtable]]
name = "bytes_send"
name = "bytes_send"
oid = ".1.3.6.1.2.1.31.1.1.1.10"
oid = ".1.3.6.1.2.1.31.1.1.1.10"
unit = "octets"
unit = "octets"
...
@@ -505,10 +505,10 @@ Note: the plugin will add instance name as tag *instance*
...
@@ -505,10 +505,10 @@ Note: the plugin will add instance name as tag *instance*
#### Configuration notes
#### Configuration notes
- In **
plugin
s.snmp.table** section, the `
oid
` attribute is useless if
- In **
input
s.snmp.table** section, the `
oid
` attribute is useless if
the `
sub_tables
` attributes is defined
the `
sub_tables
` attributes is defined
- In **
plugin
s.snmp.subtable** section, you can put a name from `
snmptranslate_file
`
- In **
input
s.snmp.subtable** section, you can put a name from `
snmptranslate_file
`
as `
oid
` attribute instead of a valid OID
as `
oid
` attribute instead of a valid OID
### Measurements & Fields:
### Measurements & Fields:
...
...
This diff is collapsed.
Click to expand it.
plugins/inputs/snmp/snmp.go
+
4
−
6
View file @
a95710ed
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"io/ioutil"
"io/ioutil"
"log"
"log"
"net"
"net"
"regexp"
"strconv"
"strconv"
"strings"
"strings"
"time"
"time"
...
@@ -308,11 +307,10 @@ func (s *Snmp) Gather(acc telegraf.Accumulator) error {
...
@@ -308,11 +307,10 @@ func (s *Snmp) Gather(acc telegraf.Accumulator) error {
return
err
return
err
}
else
{
}
else
{
for
_
,
line
:=
range
strings
.
Split
(
string
(
data
),
"
\n
"
)
{
for
_
,
line
:=
range
strings
.
Split
(
string
(
data
),
"
\n
"
)
{
oidsRegEx
:=
regexp
.
MustCompile
(
`([^\t]*)\t*([^\t]*)`
)
oids
:=
strings
.
Fields
(
string
(
line
))
oids
:=
oidsRegEx
.
FindStringSubmatch
(
string
(
line
))
if
len
(
oids
)
==
2
&&
oids
[
1
]
!=
""
{
if
oids
[
2
]
!=
""
{
oid_name
:=
oids
[
0
]
oid_name
:=
oids
[
1
]
oid
:=
oids
[
1
]
oid
:=
oids
[
2
]
fillnode
(
s
.
initNode
,
oid_name
,
strings
.
Split
(
string
(
oid
),
"."
))
fillnode
(
s
.
initNode
,
oid_name
,
strings
.
Split
(
string
(
oid
),
"."
))
s
.
nameToOid
[
oid_name
]
=
oid
s
.
nameToOid
[
oid_name
]
=
oid
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment