1 # ECOMP Vendor Event Listener Library
4 This project contains a C library that supports interfacing to AT&T's ECOMP
5 Vendor Event Listener. For an overview of ECOMP, see the
6 [ECOMP White Paper](http://att.com/ECOMP).
8 Developed in 2016 for AT&T by:
9 * Alok Gupta (https://github.com/ag1367)
10 * Paul Potochniak (https://github.com/pp8491)
11 * Gayathri Patrachari(https://github.com/gp2421)
14 * Alok Gupta (https://github.com/ag1367)
15 * Paul Potochniak (https://github.com/pp8491)
16 * Gayathri Patrachari(https://github.com/gp2421)
18 #The description about important directories are given here
20 VES5.0 - This contains the code for VES library for VES5.4.1, sample agents
22 VESreporting_vFW5.0 - This is the sample virtual firewall agent
24 VESreporting_vLB5.0 - This is the sample virtual load balancer agent
26 VES5.0/evel/evel-library/code/evel_library - Code for VES library 'evel'
28 VES5.0/evel/evel-library/code/VESreporting_HB - Sample json based heartbeat event generated periodically
30 VES5.0/evel/evel-library/code/VESreporting_fault - Sample json based fault event based on low byte/packet count on interface.
32 VES5.0/evel/evel-library/code/VESreporting_syslog - Sample json based syslog event based on pattern being logged into any file
34 VES5.0/evel/evel-library/code/VESreporting_vFW - Sample json based Firewall application that generates measurement event periodically.
36 # Info on evel Library
37 This library supports following events. The corresponding factory functions to generate that event is also mentioned against it
38 - Faults - ::evel_new_fault
39 - Heartbeat - ::evel_new_heartbeat
40 - Measurements - ::evel_new_measurement
41 - State Change - ::evel_new_state_change
42 - Syslog - ::evel_new_syslog
43 - Other - ::evel_new_other
44 - Mobile Flow - ::evel_new_mobile_flow
45 - Sipsingnaling - ::evel_new_signaling
46 - Threshold Crossing Alert - ::evel_new_threshold_cross
47 - Voice Quality - ::evel_new_voice_quality
49 # Setting the environment
50 Install gcc, libcurl3-dev packages as below
52 sudo apt-get install gcc
53 sudo apt-get install libcurl3-dev
55 Clone the code from demo repository
58 Go to /demo/vnfs/VES5.0/evel/evel-library/bldjobs directory and run the below commands
59 make all ==> to create the VES library
60 make package ==> to create the VES package if needed
62 FYI - 'make install' can also be given to make a package and install the package in another machine - see /demo/vnfs/VES5.0/evel/evel-library/bldjobs/Makefile for more details
64 After compilation VES libraries are generated and are available at below location
65 /demo/vnfs/VES5.0/evel/evel-library/libs/x86_64
67 #Loading VES the library
68 Go to /demo/vnfs/VES5.0/evel/evel-library/libs/x86_64 directory and run below commands
69 sudo cp libevel.so /usr/lib
73 After successful compiling of VES library and loading the library, go to agent directory and run 'make all'
74 For json heartbeat agent
75 > cd /demo/vnfs/VES5.0/evel/evel-library/VESreporting_HB
78 For all other jason based agents (VESreporting_fault, VESreporting_syslog and VESreporting_vFW) also, the compilation to be carried out in the same manner as mentioned above.
80 But for agents in VESreporting_vFW5.0 and VESreporting_vLB5.0, special care to be taken as below
81 - Copy the contents of the directory into ~/demo/vnfs/VES5.0/evel/evel-library/VESreporting directory
82 - run 'make all' to create an executable (alternatively, this agent gets compiled during compilation of evel library when VESreporting directory has the agent code.
85 - run the application using go-client.sh command in the agent directory as below
86 > sudo chmod +x go-client.sh
89 # Agent building guide
91 Each application that wants to send events would call evel_initialize() function to initialize the parameter with evel library. For more details about the parameters passed, see the VES5.0/evel/evel-library/code/evel_library/evel.h file. The public APIs to the library are defined in evel.h
93 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
95 const char * const bakup_fqdn,
97 const char * const path,
98 const char * const topic,
101 const char * const cert_file_path,
102 const char * const key_file_path,
103 const char * const ca_info,
104 const char * const ca_file_path,
107 const char * const username,
108 const char * const password,
109 const char * const bakup_username,
110 const char * const bakup_password,
111 const char * const source_ip,
112 const char * const bakup_source_ip,
113 EVEL_SOURCE_TYPES source_type,
114 const char * const role,
117 fprintf(stderr, "Failed to initialize the EVEL library!!!");
121 After successful running of evel_initialize() API, call the APIs to generate the events.
123 For fault event generation, below APIs would be called. For other events see the APIs listed in VES5.0/evel/evel-library/code/evel_library/evel.h
125 EVENT_FAULT * fault = evel_new_fault("Fault_vFW-ATT-LinkdownError",
127 "My alarm condition",
128 "It broke very badly",
129 EVEL_PRIORITY_NORMAL,
132 EVEL_VF_STATUS_PREP_TERMINATE);
135 evel_fault_type_set(fault, "Bad things happen...");
136 evel_fault_interface_set(fault, "My Interface Card");
137 evel_fault_addl_info_add(fault, "name1", "value1");
138 evel_fault_addl_info_add(fault, "name2", "value2");
139 evel_rc = evel_post_event((EVENT_HEADER *)fault);
140 if (evel_rc != EVEL_SUCCESS)
142 EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());