summaryrefslogtreecommitdiffstats
path: root/veslibrary/ves_clibrary/VESreporting_vFW
diff options
context:
space:
mode:
authorGao Weitao <victor.gao@huawei.com>2019-02-27 01:28:52 +0000
committerGerrit Code Review <gerrit@onap.org>2019-02-27 01:28:52 +0000
commit2a76952ed2c30c0a8f7c8c6dafdad74ecd416b08 (patch)
tree2eb52692a0bbacc506a7dcbba8332db4de6ab31c /veslibrary/ves_clibrary/VESreporting_vFW
parent67b5a83f516438d5f6346cf6da655a9b2e18a2aa (diff)
parente987dff7d71bf2255646df58bf22fa603f8d3935 (diff)
Merge "VES 7.1 C Lib/Agent Enhancements"
Diffstat (limited to 'veslibrary/ves_clibrary/VESreporting_vFW')
-rwxr-xr-xveslibrary/ves_clibrary/VESreporting_vFW/go-client.sh8
-rw-r--r--veslibrary/ves_clibrary/VESreporting_vFW/vpp_measurement_reporter.c26
2 files changed, 25 insertions, 9 deletions
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 <FQDN>|<IP address> <port> <FQDN>|<IP address> <port>
+# Usage for a collector:
+#./vpp_measurement_reporter <FQDN>|<IP address> <port>
+
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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -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 <FQDN>|<IP address> <port> <FQDN>|<IP address> <port> \n", argv[0]);
+ fprintf(stderr, "OR\n");
fprintf(stderr, "Usage: %s <FQDN>|<IP address> <port> \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 */