Difference between revisions of "IETF 97 Hackathon ietf-alarms model implementation for yuma123 report"

From Yuma123 Wiki
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Description==
 
==Description==
'''ietf-alarms.yang''' is new standards track model proposal defined in draft-vallin-netmod-alarm-module-01. Lets implement the example the description text of the module has e.g. "...('link-alarm', 'GigabitEthernet0/25'),..."
+
[https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-alarms/ietf-alarms%402016-10-27.yang ietf-alarms.yang] is new standards track model proposal defined in draft-vallin-netmod-alarm-module-01. Lets implement the example the description text of the module has e.g. "...('link-alarm', 'GigabitEthernet0/25'),..."
   
   
 
The implementation is available at sourceforge and github yuma123 repositories.
 
The implementation is available at sourceforge and github yuma123 repositories.
  +
 
==Project goals==
 
==Project goals==
 
===General/Reusable standalone module and C library code===
 
===General/Reusable standalone module and C library code===
Line 17: Line 18:
 
==Usage==
 
==Usage==
 
===Starting the netconf server===
 
===Starting the netconf server===
/usr/sbin/netconfd --module=ietf-interfaces --module=interfaces-notifications --module=ietf-alarms@2016-10-27 --module=alarms-interfaces --superuser=vladimir
+
/usr/sbin/netconfd --module=ietf-interfaces --module=interfaces-notifications --module=ietf-alarms@2016-10-27 --module=interfaces-alarms --superuser=vladimir
   
 
===Device side: Simple 1 C function API===
 
===Device side: Simple 1 C function API===
Line 55: Line 56:
 
}
 
}
 
</nowiki>
 
</nowiki>
  +
  +
==Feedback==
  +
* Looking good.
  +
* Had to define link-down/link-up notifications. They are not standardized.

Latest revision as of 08:16, 13 November 2016

Description

ietf-alarms.yang is new standards track model proposal defined in draft-vallin-netmod-alarm-module-01. Lets implement the example the description text of the module has e.g. "...('link-alarm', 'GigabitEthernet0/25'),..."


The implementation is available at sourceforge and github yuma123 repositories.

Project goals

General/Reusable standalone module and C library code

  • ietf-alarms.c - implementation of ietf-alarms.yang. Handles list management container registrations etc.
  • alarmctrl.c,alarmctrl.h - device side alarm generation helper library (handles the registration of alarm entries). Simple 1 API function:

Usage example code

Usage

Starting the netconf server

/usr/sbin/netconfd --module=ietf-interfaces --module=interfaces-notifications --module=ietf-alarms@2016-10-27 --module=interfaces-alarms --superuser=vladimir

Device side: Simple 1 C function API

int alarmctrl_event(char* resource_str, char* alarm_type_id_str, char* alarm_type_qualifier_str, char* severity_str, char* alarm_text_str, int enable);

Example:

alarmctrl_event("/interfaces/interface[name=\'eth0\']", "link-alarm"/*alarm_type_id_str*/, ""/*alarm_type_qualifier_str*/, "major", "Probably someone disconnected something?!", down?1:0);

User side: yangcli

yangcli vladimir@localhost> xget /alarms
rpc-reply {
  data {
    alarms {
      alarm-list {
        number-of-alarms 2
        alarm /interfaces/interface[name='eth0'] alarms-if:link-alarm  {
          resource /interfaces/interface[name='eth0']
          alarm-type-id alarms-if:link-alarm
          alarm-type-qualifier 
          time-created 2016-11-13T05:04:11Z
          is-cleared false
          last-changed 2016-11-13T05:16:26Z
          perceived-severity major
        }
        alarm /interfaces/interface[name='eth1'] alarms-if:link-alarm  {
          resource /interfaces/interface[name='eth1']
          alarm-type-id alarms-if:link-alarm
          alarm-type-qualifier 
          time-created 2016-11-13T05:04:11Z
          is-cleared false
          last-changed 2016-11-13T05:16:26Z
          perceived-severity major
        }
      }
    }
  }
}

Feedback

  • Looking good.
  • Had to define link-down/link-up notifications. They are not standardized.