Skip to content

Commit

Permalink
fix for Feuerlabs#41 User error: snmpa_trap: Invalid value: wrongType
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorKarymov committed Aug 29, 2014
1 parent 30200e6 commit 3e83037
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/exometer_report_snmp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ exometer_unsubscribe(Metric, DataPoint, Extra, St) ->
Entry = exometer:info(Metric, entry),
disable_inform(Entry, DataPoint, Extra, St).

exometer_report(Metric, DataPoint, _Extra, Value, St) ->
?debug("Report metric ~p_~p = ~p~n", [Metric, DataPoint, Value]),
exometer_report(Metric, DataPoint, _Extra, Value0, St) ->
?debug("Report metric ~p_~p = ~p~n", [Metric, DataPoint, Value0]),
Inform = erlang:binary_to_existing_atom(inform_name(Metric, DataPoint), latin1),
VarName = erlang:binary_to_existing_atom(metric_name(Metric, DataPoint), latin1),
{_, Value} = snmp_value(Metric, DataPoint, Value0),
Varbinds = [{VarName, Value}],
snmpa:send_notification(snmp_master_agent, Inform, no_receiver, Varbinds),
{ok, St}.
Expand Down

0 comments on commit 3e83037

Please sign in to comment.