clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
215 stars 72 forks source link

new feature request: SNMP support #317

Closed dima1308 closed 2 years ago

dima1308 commented 2 years ago

Hi @olofhagsand May I ask you to add SNMP support to the CLIXON? It is a complex feature that requires deep knowledge of the CLIXON internals.

To do that, the possible option is to create an additional front-end (like clixon_cli or clixon_restconf). This front-end can use the net-snmp library. It is possible to convert standard MIBs to yang using smidump utility (I tried to do that, and I saw that the conversion works well when using the smidump utility ver 0.5.0, the older version does not work well). I saw that converted from SNMP MIB yang file includes the smiv2:oid extension that can allow mapping between original MIB and auto-generated yang files. Please see below.

  container SNMPv2-MIB {
    config false;

    container system {
      smiv2:oid "1.3.6.1.2.1.1";

      leaf sysDescr {
        type snmpv2-tc:DisplayString {
          length "0..255";
        }
        description
         "A textual description of the entity.  This value should
          include the full name and version identification of
          the system's hardware type, software operating-system,
          and networking software.";
        smiv2:max-access "read-only";
        smiv2:oid "1.3.6.1.2.1.1.1";
      }

What do you think about that?

olofhagsand commented 2 years ago

Is that traps as well or only for reading data?

dima1308 commented 2 years ago

In general, we need the ability to read and write data using both: SNMPv2 and v3. Also, we need SNMP traps. If it is possible to do an infrastructure that will allow read/write data using SNMPv2, it will be great. Later, once the initial infrastructure will be implemented, our SW team will be able to work on adding more functionality like SNMPv3 support or traps.

olofhagsand commented 2 years ago

It could be useful as an eco-system around Clixon. But it is not on my current roadmap. If not sponsored I focus on features that are core netconf/yang. I could assist someone else trying it out.

dima1308 commented 2 years ago

If not sponsored

is it an option to sponsor this activity? Maybe we can discuss it separately?

olofhagsand commented 2 years ago

Experimentral development of this issue is here: https://github.com/clicon/clixon/tree/snmp

olofhagsand commented 2 years ago

SNMP branch is now merged and will appear in Clixon 5.8

olofhagsand commented 2 years ago

Closing this since a general support appears in 5.8. Please submit specific issues for any sub-issues that may appear.