From e987dff7d71bf2255646df58bf22fa603f8d3935 Mon Sep 17 00:00:00 2001 From: PrakashH Date: Tue, 29 Jan 2019 20:41:28 +0000 Subject: VES 7.1 C Lib/Agent Enhancements HB-Fault-Measurement-Syslog-2Collector enhancement Issue-ID: VNFSDK-364 Change-Id: Iba5dc8b0493431a23de4fb8e24b6fc3a6661c4e4 Signed-off-by: PrakashH --- .../ves_clibrary/VESreporting_vFW/go-client.sh | 8 ++++++- .../VESreporting_vFW/vpp_measurement_reporter.c | 26 +++++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'veslibrary/ves_clibrary/VESreporting_vFW') diff --git a/veslibrary/ves_clibrary/VESreporting_vFW/go-client.sh b/veslibrary/ves_clibrary/VESreporting_vFW/go-client.sh index b2b3a08..0aaed85 100755 --- a/veslibrary/ves_clibrary/VESreporting_vFW/go-client.sh +++ b/veslibrary/ves_clibrary/VESreporting_vFW/go-client.sh @@ -1,6 +1,12 @@ #!/bin/bash - export LD_LIBRARY_PATH="/opt/VES/evel/evel-library/libs/x86_64/" + +#Usage for 2 collectors: +#./vpp_measurement_reporter | | +# Usage for a collector: +#./vpp_measurement_reporter | + DCAE_COLLECTOR_IP=$(cat /opt/config/dcae_collector_ip.txt) DCAE_COLLECTOR_PORT=$(cat /opt/config/dcae_collector_port.txt) ./vpp_measurement_reporter $DCAE_COLLECTOR_IP $DCAE_COLLECTOR_PORT + diff --git a/veslibrary/ves_clibrary/VESreporting_vFW/vpp_measurement_reporter.c b/veslibrary/ves_clibrary/VESreporting_vFW/vpp_measurement_reporter.c index 42f9793..0b1719e 100644 --- a/veslibrary/ves_clibrary/VESreporting_vFW/vpp_measurement_reporter.c +++ b/veslibrary/ves_clibrary/VESreporting_vFW/vpp_measurement_reporter.c @@ -15,6 +15,7 @@ * ****************************************************************************/ + #include #include #include @@ -603,15 +604,25 @@ int main(int argc, char** argv) { char* fqdn = argv[1]; int port = atoi(argv[2]); + char* fqdn2 = NULL; + int port2 = 0; int i=0; int rc; pthread_attr_t attr; pthread_t hb_thread; pthread_t meas_thread; pthread_t flt_thread; + + if(argc == 5) + { + fqdn2 = argv[3]; + port2 = atoi(argv[4]); + } - if (argc != 3) + if (!((argc == 3) || (argc == 5))) { + fprintf(stderr, "Usage: %s | | \n", argv[0]); + fprintf(stderr, "OR\n"); fprintf(stderr, "Usage: %s | \n", argv[0]); exit(-1); } @@ -621,23 +632,22 @@ int main(int argc, char** argv) /**************************************************************************/ if(evel_initialize(fqdn, /* FQDN */ port, /* Port */ - NULL, /* Backup FQDN */ - 0, /* Backup port */ + fqdn2, /* Backup FQDN */ + port2, /* Backup port */ NULL, /* optional path */ NULL, /* optional topic */ 100, /* Ring Buffer size */ 0, /* HTTPS? */ - 0, /* active mode? */ NULL, /* cert file */ NULL, /* key file */ NULL, /* ca info */ NULL, /* ca file */ 0, /* verify peer */ 0, /* verify host */ - "will", /* Username */ - "pill", /* Password */ - "", /* Username2 */ - "", /* Password2 */ + "sample1", /* Username */ + "sample1", /* Password */ + "sample1", /* Username2 */ + "sample1", /* Password2 */ NULL, /* Source ip */ NULL, /* Source ip2 */ EVEL_SOURCE_VIRTUAL_MACHINE, /* Source type */ -- cgit 1.2.3-korg