[erlang-questions] Erlang SNMP agent coexisting with net-snmp?
Martin Bjorklund
mbj@REDACTED
Wed Oct 6 00:19:32 CEST 2010
Hi,
Attila Rajmund Nohl <attila.r.nohl@REDACTED> wrote:
> Hello!
>
> I have an Erlang application and I want to return some stats about the
> application and the host via SNMP. Some of the stats (for example disk
> usage or load average) is already implemented by the snmpd in the
> net-snmp package (or at least there's a bundled example configuration
> file which can provide this data). The application-related stats can
> be queried from the application.
>
> I was wondering if it's possible that use the net-snmp snmpd as the
> SNMP master agent and the Erlang application as a subagent, so a
> single SNMP interface would return all data, but I haven't found in
> the documentation that Erlang would support AgentX.
The SNMP agent in OTP does not support any standard subagent protocol
(just the proprietary erlang-based one) but there is the application
"snmp_ext" in jungerl which contains some code for three different
"subagent" protocols - AgentX, SMUX, and SNMP. If all your MIBs are
read-only, it is actually possible to use SNMP as the subagent
protocol. net-snmp supports this as well, so you can run net-snmp as
the master, and OTP as the subagent, or the other way around.
> This (of course)
> excludes the other way, that the Erlang is the master and the net-snmp
> is the sub.
>
> I can also implement the host-based counters in Erlang or use the
> 'pass' or 'exec' directives in net-snmp to get the application-based
> counters via an other interface from the application.
>
> Am I missing an other alternative? Maybe an AgentX implementation for Erlang?
The AgentX code in snmp_ext is not complete at all; IIRC it contains
just the encode/decode functions. Feel free to use this code as a
starting point for a proper AgentX implementation! I think it would
be very useful to have this option for the OTP agent.
/martin
More information about the erlang-questions
mailing list