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

User error: snmpa_trap: Invalid value: wrongType #41

Open
ates opened this issue Mar 25, 2014 · 6 comments
Open

User error: snmpa_trap: Invalid value: wrongType #41

ates opened this issue Mar 25, 2014 · 6 comments
Assignees
Labels

Comments

@ates
Copy link
Contributor

ates commented Mar 25, 2014

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"}
                ]}
            ]}
        ]}
    ]}
@tolbrino
Copy link
Contributor

Can you share the template file as well?

@ates
Copy link
Contributor Author

ates commented Mar 26, 2014

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

@tolbrino tolbrino self-assigned this Mar 26, 2014
@ates
Copy link
Contributor Author

ates commented Mar 28, 2014

Any news?

@ates
Copy link
Contributor Author

ates commented May 26, 2014

ping

@IgorKarymov
Copy link
Contributor

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.

@tolbrino
Copy link
Contributor

You are correct. I'll add the proper data conversion to the outbound calls as well.

@tolbrino tolbrino added the bug label Aug 15, 2014
IgorKarymov added a commit to IgorKarymov/exometer that referenced this issue Aug 26, 2014
IgorKarymov added a commit to unisontech/exometer that referenced this issue Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants