Git Product home page Git Product logo

elixir-snmp's People

Contributors

jeanparpaillon avatar mattjg908 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mattjg908 petrn

elixir-snmp's Issues

Q: what is the way to send notifications using this library?

First, thanks for this module, it has helped me a lot. I have implemented an agent with multiple variables and tables and it seems to work fine, although to implement the tables, it was more work than I have originally assumed (I am not using the generic instrumentation nor ecto).

Now I need to implement sending SNMP notifications/traps and the library does not seem to provide much help with this. The config files it generates seem to lack support for notifications.

Is there any guidance how to support notifications on top of this library?

MIB compiler architecture

MIB compiler generates a lof of instrumentation functions, types, ecto types, etc

We want to implement the following architecture:

  • MIB compiler compiles .mib file into mib record and makes it a module attribute
  • MIB generators implements before_compile callbacks and generates whatever they want from this
  • List of generators can be changed through Mib.__using__ macro option

Improve agent configuration error reporting

Rationale

SNMP agent configuration possible errors are numerous and may be complex (dependent, conflicting options, etc)
Actually, agent configuration stops at first error. It could be better to have a full report of all errors when starting the agent.

Expected

Agent configuration is represented as an Ecto schema, so that we can leverage changeset mechanisms for validating and reporting errors.

The instrumentation functions should be snake_case by Elixir conventions but need to follow the MIB as camelCase

The Erlang SNMP allows to map the MIB objects to instrumentation functions through the xxx_MIB.funcs like this:
{myName, {ex1, my_name, []}}.

The MIB compilation step in elixir-snmp should map the camelCase object names to snake_case automatically.
When the instrumentation function names are left in camelCase as in the MIB, mix credo reports readability issues like this:

┃ [R] ↗ Function/macro/guard names should be written in snake_case.
┃ apps/snmp_agent/lib/snmp_agent/snmp/mib/strouter.ex:43:7 #(SnmpAgent.Mib.StRouter.inputsTable)

Does not support "AUGMENTS"?

I think the current library fails if using "AUGMENTS" in an mib? I wanted to implement IF-MIB in my app, so I created a stub something like:

defmodule SnmpAgent.Mib.If do
  use Snmp.Mib, name: "IF-MIB"
end

Then added IF-MIB and IANAifType-MIB into my local mibs directory. This fails with an error:

Generated sys_data app
==> snmp_agent
Compiling 10 files (.ex)

== Compilation error in file lib/snmp_agent/mib/if.ex ==
** (Protocol.UndefinedError) protocol Enumerable not implemented for {:augments, {:ifEntry, :undefined}} of type Tuple
    (elixir 1.14.5) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.14.5) lib/enum.ex:166: Enumerable.reduce/3
    (elixir 1.14.5) lib/enum.ex:4307: Enum.map/2
    (elixir_snmp 0.2.1) lib/snmp/mib/table_info.ex:66: Snmp.Mib.TableInfo.find_indices/1
    (elixir_snmp 0.2.1) lib/snmp/mib/table_info.ex:27: Snmp.Mib.TableInfo.new/2
    (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir_snmp 0.2.1) expanding macro: Snmp.Mib.__using__/1

If I replace the "AUGMENTS { ifEntry }" in IfXEntry, then it compiles (and gives me errors about missing definitions)

So I speculate that it's something to do with the thing being augmented being described in the same file? However, I'm not sure how to progress to resolve this? Any guidance?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.