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

From Yuma123 Wiki
Jump to navigationJump to search
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Description==
 
==Description==
  +
[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 work on this project should help validate hands-on the latest state of the ietf-alarms model. Provide an opensource implementation and yield a report that can be taken into account in the further acceptance of the model.
 
  +
  +
  +
The implementation is available at sourceforge and github yuma123 repositories.
  +
 
==Project goals==
 
==Project goals==
  +
===General/Reusable standalone module and C library code===
* ietf-alarms.c - implementation of ietf-alarms.yang allowing:
 
  +
* [https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-alarms/ietf-alarms.c ietf-alarms.c] - implementation of ietf-alarms.yang. Handles list management container registrations etc.
** ...
 
  +
* [https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-alarms/alarmctrl.c alarmctrl.c],[https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-alarms/alarmctrl.h alarmctrl.h] - device side alarm generation helper library (handles the registration of alarm entries). Simple 1 API function:
* alarms-simulator.yang - test model to simulate generation of alarm events featuring:
 
  +
** ...
 
  +
===Usage example code===
* alarms-simulator.c - implementation of alarms-simulator.yang
 
  +
* [https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-interfaces/interfaces-alarms.yang interfaces-alarms.yang] (NEW) - model defining link-alarm
  +
* [https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-interfaces/interfaces-alarms.c interfaces-alarms.c] (NEW) - implementation of alarms-interfaces.yang based on interception of link-up and link-down
  +
* [https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-interfaces/interfaces-notifications.yang interfaces-notifications.yang] (NEW) - define link-up and link-down
  +
* [https://sourceforge.net/p/yuma123/git/ci/master/tree/example-modules/ietf-interfaces/ietf-interfaces.c ietf-interfaces.c] (MODIFIED) - implement support for link-up and link-down when the interfaces-notifications.yang is loaded
  +
  +
==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===
==Usecases==
 
  +
<nowiki>
The ietf-alarms and alarms-simulator loadable modules will allow going through different usage scenarios:
 
  +
yangcli vladimir@localhost> xget /alarms
/usr/sbin/netconfd --module=ietf-alarms --module=alarms-simulator
 
  +
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
  +
}
  +
}
  +
}
  +
}
  +
}
  +
</nowiki>
   
  +
==Feedback==
... yangcli will be used for interaction.
 
  +
* 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.