-
Notifications
You must be signed in to change notification settings - Fork 656
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
Add fieldserver MIB #1392
base: main
Are you sure you want to change the base?
Add fieldserver MIB #1392
Conversation
For posterity, if anyone would like to test this, here is a minimal gateway configuration to expose data over SNMP:
As is commented in generator.yml, $ snmptable -Ci -r0 -v2c "${mygateway}" analogOutputsTable
SNMP table: FIELDSERVER-STD-MIB-v1-00aF::analogOutputsTable
index aoValue aoDescription
0 2 "AI[0] desc"
1 3 "AI[1] desc"
$ curl -fsS 'localhost:8080/snmp?target=mygateway&module=fieldserver' | grep aoValue
# HELP aoValue Value - 1.3.6.1.4.1.6347.2.3.1.1
# TYPE aoValue gauge
aoValue{aoDescription="",aoValue="0"} 2
aoValue{aoDescription="",aoValue="1"} 3 |
Signed-off-by: Luke Yeager <lyeager@nvidia.com>
generator/generator.yml
Outdated
overrides: | ||
# NOTE: snmp-exporter cannot parse these OCTET STRINGs | ||
# See https://github.com/prometheus/snmp_exporter/issues/264 | ||
aiDescription: { ignore: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this work?
aiDescription: { ignore: true } | |
aiDescription: | |
type: DisplayString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd think so, but no. It leads to this:
$ curl -fsS 'localhost:8080/snmp?target=mygateway&module=fieldserver' | grep aoValue
aoDescription{aoDescription="",aoValue="0"} 1
aoDescription{aoDescription="",aoValue="1"} 1
# HELP aoValue Value - 1.3.6.1.4.1.6347.2.3.1.1
# TYPE aoValue gauge
aoValue{aoDescription="",aoValue="0"} 2
aoValue{aoDescription="",aoValue="1"} 3
No errors in the exporter output, even with --log.level=debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, what does snmpwalk
return?
Also maybe try with --snmp.debug-packets
. That will provide the raw packet responses from the device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ snmpwalk -v2c mygateway analogOutputsTable
FIELDSERVER-STD-MIB-v1-00aF::aoValue.0 = INTEGER: 2
FIELDSERVER-STD-MIB-v1-00aF::aoValue.1 = INTEGER: 3
FIELDSERVER-STD-MIB-v1-00aF::aoDescription.0 = STRING: "AI[0] desc"
FIELDSERVER-STD-MIB-v1-00aF::aoDescription.1 = STRING: "AI[1] desc"
With --snmp.debug-packets
: snmp-exporter_log.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see the issue. The MIB does not match the data returned.
analogOutputsTable OBJECT-TYPE
SYNTAX SEQUENCE OF AnalogOutputsEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"Table of Analog Outputs"
::= { standard 3 }
analogOutputsEntry OBJECT-TYPE
SYNTAX AnalogOutputsEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"Analog Output."
INDEX {
aoValue,
aoDescription
}
::= { analogOutputsTable 1 }
AnalogOutputsEntry ::=
SEQUENCE {
aoValue
INTEGER,
aoDescription
OCTET STRING
}
This claims a 2-dimension index, but the snmpwalk clearly shows only the single integer index. This also matches what I see in the snmp_exporter debug packets log you provided.
aoDescription
is not part of the INDEX
returned by the device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find, thanks for the careful look! I believe I fixed it with a sed command in the makefile. With the current code, it produces the following output (looks great to me now!):
$ curl -fsS 'localhost:8080/snmp?target=mygateway&module=fieldserver' | grep -E '[ab][iov]'
# HELP aiValue Value - 1.3.6.1.4.1.6347.2.2.1.1
# TYPE aiValue gauge
aiValue{aiDescription="AI desc",aiValue="0"} 1
# HELP aoValue Value - 1.3.6.1.4.1.6347.2.3.1.1
# TYPE aoValue gauge
aoValue{aoDescription="AI[0] desc",aoValue="0"} 2
aoValue{aoDescription="AI[1] desc",aoValue="1"} 3
# HELP avValue Value - 1.3.6.1.4.1.6347.2.4.1.1
# TYPE avValue gauge
avValue{avDescription="AV desc",avValue="0"} 4
# HELP biValue Value - 1.3.6.1.4.1.6347.2.5.1.1
# TYPE biValue gauge
biValue{biDescription="BI desc",biValue="0"} 1
# HELP boValue Value - 1.3.6.1.4.1.6347.2.6.1.1
# TYPE boValue gauge
boValue{boDescription="BI desc",boValue="0"} 0
# HELP bvValue Value - 1.3.6.1.4.1.6347.2.7.1.1
# TYPE bvValue gauge
bvValue{bvDescription="BV desc",bvValue="0"} 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, any chance you can get the vendor to fix this?
Signed-off-by: Luke Yeager <lyeager@nvidia.com>
3886f8d
to
d18e94a
Compare
Signed-off-by: Luke Yeager <lyeager@nvidia.com>
- "FIELDSERVER-STD-MIB-v1-00aF::binaryOutputsTable" | ||
- "FIELDSERVER-STD-MIB-v1-00aF::binaryValuesTable" | ||
overrides: | ||
aiDescription: { type: DisplayString, ignore: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't mix yaml syntax.
aiDescription: { type: DisplayString, ignore: true } | |
aiDescription: | |
type: DisplayString | |
ignore: true |
No description provided.