509fc180733f0f3220bfe11945d2fb7b0ce54886
[demo.git] / vnfs / VES5.0 / evel / evel-library / code / VESreporting_vAFX / README.md
1 PROJECT DESCRIPTION
2
3 The AFX agent is for AT&T internal use only.
4
5 The AFX VES Agent collects and reports telemetry data from vAFX platform to VES Collector.
6
7 This is a multi-threaded application consists of Event Handler thread, Heartbeat thread, link monitor thread, Service Monitor thread, Scaling Measurement thread and BGP (Border Gateway Protocol) Monitoring thread.
8
9 It uses VES Library 5.4.1 version for invoking REST API to send messages to VES Open DCAE collector. Event handler thread is part of VES-Library that invokes CURL REST API calls and sends data to VES Collector over http(s). Event handler monitors data from multiple threads and sends the data once it is available.
10
11
12 Afxagent does following initializations
13
14 Uses the VES library API  evel_initialize() to initialize the VES library with information such as collector IP, port number, username, password etc
15 Reads the afxmodules.conf file for thread listings and compares with internal list of threads
16 Creates the threads based on afxmodules.conf thread listings.
17
18 The contents of afxmodules.conf would be as below. If any of events not required, then you can remove it, so that only the required threads and the corresponding events are generated.
19
20 HeartBeat
21 LinkMonitor
22 ServiceMonitor
23 ScalingMeasurements
24 SyslogBgp
25
26 The explanation for each entry in afxmodules.conf is given below
27
28 HeartBeat :: This generates periodic heartbeat event
29
30 LinkMonitor :: This thread monitors the status of vNICs using ethtool interface. The list of vNICs that need to be monitored are configured in “afxintf.conf” file. When the status of vNICs change by either Ethernet cable pulled out or Ethernet interface going up and down the changed status is reported.
31
32 ServiceMonitor :: This thread monitors the state of the afx@input* and afx@output* services by running “/bin/systemctl status afx@input*” or “/bin/systemctl status afx@output*” command. If there is a change in status from “active” to “Inactive” then Major severity fault is raised. If the change in status is from “inactive” to “active”, then Normal severity fault is raised. If both services status is inactive, then critical severity fault is raised.
33
34 ScalingMeasurements :: This thread reports CPU load, memory usage and vNIC data in Scaling measurement messages periodically.
35
36 SyslogBgp :: BGP monitoring thread forwards syslog messages in platform along with changes to BGP peer connections. At startup the thread reads “afxfilter.txt” file for the list of Tags including “exabgp”. The Thread forwards only those messages containing the tags in Syslog event to Collector. The thread also monitors BGP messages for connection to peer routers. A Fault event is reported when new connections are made or when existing connections are shut down.
37
38 Compiling
39 =========
40 Compile the code as below
41
42 Please note that VES library is compiled already and loaded
43 go to /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX directory
44 run the command 'make all'
45
46 Make a zip file containing below files
47 /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX/afx_ves_reporter
48 /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX/install
49 /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX/vescred
50 /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX/run
51 /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX/afxmodules.conf
52 /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX/afxintf.conf
53 /demo/vnfs/VES5.0/evel/evel-library/code/VESreporting_vAFX/afxfilter.txt
54 libevel.so or libevel.a (or both) from /demo/vnfs/VES5.0/evel/evel-library/libs/x86_64
55
56
57 Running AFXAGENT
58 ================
59
60 Install below packages in the machine where the afxagent is intend to run
61  
62  sudo apt-get install exabgp
63  sudo apt-get install ethtool
64  sudo apt-get install libcurl3-dev
65
66 [1] Getting started.
67 - FTP or SCP the zipped file created above and unzip into machine where afxagent is suppose to run
68
69 [2] Setting up the dynamic linked library of VES
70 - Take the backup of existing /usr/lib/libevel.so file using the below command.
71         cp /usr/lib/libevel.so /usr/lib/libevel.so_bakup
72 - Go to unziped  directory where libevel.so file is there and run all these commands from there.
73         sudo cp libevel.so /usr/lib 
74         sudo ldconfig
75 [3] Updating the interface info in afxintf.conf file 
76 - Run the "ifconfig" command and list the interfaces in afxintf.conf one below the other. For e.g, if the "ifconfig" shows 2 interfaces "lo" and "ens2", then you should have only below contents in afxintf.conf file. If you have more interfaces, you need to list those interfaces along with other keyword incremented (e.g next one would be, <interface name> DNS3_ RSLOTPORT_VLAN_CLASSTYPE) accordingly.
77
78 lo   DNS1_RSLOTPORT_VLAN_CLASSTYPE
79 ens2   DNS2_RSLOTPORT_VLAN_CLASSTYPE
80
81 [4] Collector information update
82 - Get the collector IP address, port number, collector login / password
83 - Update the "vescred.conf" file with collector login and password. If the login/passwd is Sample1 / Passwd1, then "vescred.conf" file should look as below.
84 Sample1
85 Passwd1
86
87 -Update the file "run" in the below format
88 ./afx_ves_reporter <collector IP address> <collector port number> <credential file vescred.conf> <https/http=1/0> <debug=1/0>
89
90 If collector URL is given as below https://zldcmtn23bdce2coll01.ed926b.mtn23b.tci.att.com:8443/eventListener/v5,  
91
92 then your run file would look like below
93
94 unset http_proxy
95 unset https_proxy 
96 ./afx_ves_reporter zldcmtn23bdce2coll01.ed926b.mtn23b.tci.att.com 8443 ./vescred.conf 1 1
97
98 [5] Install HTTPS certificates. See the onap documentation
99
100 [6] Running of afxagent
101 - Once the run is file is updated, now we have to run the VES agent using below command.
102         sudo ./run
103
104 [7] Stopping of afxagent
105 - You can do CTRL C to stop if are seeing the terminal where afxagent is running. Otherwise, get the process ID and kill it as below
106         ps -aef | grep run
107         Kill <run process id>
108
109 [8] Sample events
110 Event samples are given in sample_afxagent_events.txt file