diff options
author | Gao Weitao <victor.gao@huawei.com> | 2019-02-27 01:28:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-02-27 01:28:41 +0000 |
commit | 35299e097671269087f1c737cf9b08a88baf447e (patch) | |
tree | 32786eb83aee8193e75cb4d23ff25683f4554b03 /veslibrary/ves_clibrary/readme.md | |
parent | 28b6e97d3929f94f91c4bf57f1d0273d8c8a73e0 (diff) | |
parent | 2273dead6fd4da2b3b88b22c64172ec4d889e633 (diff) |
Merge "VES5.4.1 EVEL Library enhancements" into beijing
Diffstat (limited to 'veslibrary/ves_clibrary/readme.md')
-rw-r--r-- | veslibrary/ves_clibrary/readme.md | 133 |
1 files changed, 124 insertions, 9 deletions
diff --git a/veslibrary/ves_clibrary/readme.md b/veslibrary/ves_clibrary/readme.md index 784fade..85ff942 100644 --- a/veslibrary/ves_clibrary/readme.md +++ b/veslibrary/ves_clibrary/readme.md @@ -1,6 +1,5 @@ # ECOMP Vendor Event Listener Library -“The content of this directory is currently under development and, at this stage, is not intended for demonstration and/or testing.” This project contains a C library that supports interfacing to AT&T's ECOMP Vendor Event Listener. For an overview of ECOMP, see the @@ -16,15 +15,131 @@ Current Maintainers: * Paul Potochniak (https://github.com/pp8491) * Gayathri Patrachari(https://github.com/gp2421) -# Installation +#The description about important directories are given here -For installation instructions, clone this repo and load the -[installation guide](./docs/source/evel/html/quickstart.html) in your web browser. + evel - This contains the code for VES library for VES5.4.1, sample agents -Full source-code documentation is included with the code and can be built from -the included Makefile. See the [readme file](./code/evel_library/readme.md). + VESreporting_vFW - This is the sample virtual firewall agent -# Use + VESreporting_vLB - This is the sample virtual load balancer agent + + evel/evel-library/code/evel_library - Code for VES library 'evel' + + evel/evel-library/code/VESreporting_HB - Sample json based heartbeat event generated periodically + + evel/evel-library/code/VESreporting_fault - Sample json based fault event based on low byte/packet count on interface. + + evel/evel-library/code/VESreporting_syslog - Sample json based syslog event based on pattern being logged into any file + + evel/evel-library/code/VESreporting_vFW - Sample json based Firewall application that generates measurement event periodically. + +# Info on evel Library +This library supports following events. The corresponding factory functions to generate that event is also mentioned against it +- Faults - ::evel_new_fault +- Heartbeat - ::evel_new_heartbeat +- Measurements - ::evel_new_measurement +- State Change - ::evel_new_state_change +- Syslog - ::evel_new_syslog +- Other - ::evel_new_other +- Mobile Flow - ::evel_new_mobile_flow +- Sipsingnaling - ::evel_new_signaling +- Threshold Crossing Alert - ::evel_new_threshold_cross +- Voice Quality - ::evel_new_voice_quality + +# Setting the environment +Install gcc, libcurl3-dev packages as below + + sudo apt-get install gcc + sudo apt-get install libcurl3-dev + +Clone the code from demo repository + +#Compile VES library + Go to evel/evel-library/bldjobs directory and run the below commands + make all ==> to create the VES library + make package ==> to create the VES package if needed + + FYI - 'make install' can also be given to make a package and install the package in another machine - see evel/evel-library/bldjobs/Makefile for more details + + After compilation VES libraries are generated and are available at below location + evel/evel-library/libs/x86_64 + +#Loading VES the library + Go to evel/evel-library/libs/x86_64 directory and run below commands + sudo cp libevel.so /usr/lib + sudo ldconfig + +#Compiling agent code + After successful compiling of VES library and loading the library, go to agent directory and run 'make all' +For json heartbeat agent + > cd evel/evel-library/VESreporting_HB + > make all + +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. + +But for agents in VESreporting_vFW5.0 and VESreporting_vLB5.0, special care to be taken as below + - Copy the contents of the directory into evel/evel-library/VESreporting directory + - run 'make all' to create an executable (alternatively, this agent gets compiled during compilation of evel library when VESreporting directory has the agent code. + +#Run the agent + - run the application using go-client.sh command in the agent directory as below + > sudo chmod +x go-client.sh + > sudo ./go-client.sh + +# Agent building guide + +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 evel/evel-library/code/evel_library/evel.h file. The public APIs to the library are defined in evel.h + +EVEL_ERR_CODES evel_initialize(const char * const fqdn, + int port, + const char * const bakup_fqdn, + int bakup_port, + const char * const path, + const char * const topic, + int ring_buf_size, + int secure, + const char * const cert_file_path, + const char * const key_file_path, + const char * const ca_info, + const char * const ca_file_path, + long verify_peer, + long verify_host, + const char * const username, + const char * const password, + const char * const bakup_username, + const char * const bakup_password, + const char * const source_ip, + const char * const bakup_source_ip, + EVEL_SOURCE_TYPES source_type, + const char * const role, + int verbosity + ) { + fprintf(stderr, "Failed to initialize the EVEL library!!!"); + exit(-1); + } + +After successful running of evel_initialize() API, call the APIs to generate the events. + +For fault event generation, below APIs would be called. For other events see the APIs listed in evel/evel-library/code/evel_library/evel.h + + EVENT_FAULT * fault = evel_new_fault("Fault_vFW-ATT-LinkdownError", + "fault0001", + "My alarm condition", + "It broke very badly", + EVEL_PRIORITY_NORMAL, + EVEL_SEVERITY_MAJOR, + EVEL_SOURCE_HOST, + EVEL_VF_STATUS_PREP_TERMINATE); + if (fault != NULL) + { + evel_fault_type_set(fault, "Bad things happen..."); + evel_fault_interface_set(fault, "My Interface Card"); + evel_fault_addl_info_add(fault, "name1", "value1"); + evel_fault_addl_info_add(fault, "name2", "value2"); + evel_rc = evel_post_event((EVENT_HEADER *)fault); + if (evel_rc != EVEL_SUCCESS) + { + EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string()); + } + } -Clone this repo and load the [user guide](./docs/source/evel/html/index.html) -in your web browser. |