exometer
exometer copied to clipboard
User error: snmpa_trap: Invalid value: wrongType
How to reproduce:
1> application:ensure_all_started(snmp).
{ok,[snmp]}
2> application:ensure_all_started(exometer).
{ok,[syntax_tools,compiler,goldrush,lager,exometer]}
3> exometer:new([foo, bar], histogram, [{snmp, [{min, 1000}, {mean, 1000}]}]).
ok
Got in shell:
18:17:16.226 [error] ** User error: snmpa_trap: Invalid value: wrongType
Oid: [1,3,6,1,4,1,40076,1,3,0]
Val: {value,0}
Type: {asn1_type,'OCTET STRING',0,64,[],true,'OCTET STRING',false,undefined}
Exometer configuration:
{exometer, [
{report, [
{reporters, [
{exometer_report_snmp, [
{mib_template, "priv/mibs/APP-METRICS-MIB.mib"},
{mib_dir, "tmp/exometer"}
]}
]}
]}
]}
Can you share the template file as well?
APP-METRICS-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, Counter32, Counter64, Gauge32, enterprises FROM SNMPv2-SMI
MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP FROM SNMPv2-CONF;
sifox MODULE-IDENTITY
LAST-UPDATED "201401190525Z"
ORGANIZATION "Company"
CONTACT-INFO "[email protected]"
DESCRIPTION
"This MIB module is used for exposing app metrics."
REVISION "201401190525Z"
DESCRIPTION
"The initial version"
::= { enterprises 40076 }
exometerMetrics OBJECT IDENTIFIER ::= { sifox 1 }
-- CONTENT START
-- CONTENT END
END
Any news?
ping
I faced with the same issue. Looks like that root of issue here in next: "mean" datapoint in generated mib configured as OCTET STRING (i guess it's because lack of support of floating point values in snmp), but internal exometer representation is integer or float. So it require some additional converting and has special processing case when it returning with snmp get command response https://github.com/Feuerlabs/exometer/blob/master/src/exometer_report_snmp.erl#L524 But this special handling ommited when value pushed to snmp agent as result of calling exometer_report_snmp:exometer_report/5 function.
You are correct. I'll add the proper data conversion to the outbound calls as well.