From 572693a58c108d6174ed6e138e989cd2f1a6b1b0 Mon Sep 17 00:00:00 2001 From: amshegokar Date: Wed, 26 Sep 2018 12:17:33 +0530 Subject: Config from Docker ENV parameters Taking Adapter Config from Docker ENV parameters if CONSUL_HOST flag is present Change-Id: Id097e433112fbdcc0d403ca3f87abee123e76693 Issue-ID: DCAEGEN2-335 Signed-off-by: amshegokar --- .../src/main/resources/DMaapMR.properties | 64 +++++++++++----------- .../src/main/resources/MapperConfig.json | 16 ------ .../src/main/resources/MapperConfigFullFormat.json | 56 ------------------- .../src/main/resources/application.properties | 18 +++--- .../src/main/resources/defaultSnmpMappingFile.xml | 64 ++++++++++++++++++++++ 5 files changed, 103 insertions(+), 115 deletions(-) delete mode 100644 UniversalVesAdapter/src/main/resources/MapperConfig.json delete mode 100644 UniversalVesAdapter/src/main/resources/MapperConfigFullFormat.json create mode 100644 UniversalVesAdapter/src/main/resources/defaultSnmpMappingFile.xml (limited to 'UniversalVesAdapter/src/main/resources') diff --git a/UniversalVesAdapter/src/main/resources/DMaapMR.properties b/UniversalVesAdapter/src/main/resources/DMaapMR.properties index ae96248..dfb8167 100644 --- a/UniversalVesAdapter/src/main/resources/DMaapMR.properties +++ b/UniversalVesAdapter/src/main/resources/DMaapMR.properties @@ -1,45 +1,45 @@ - # DMaaP Config Constants - # - #default hostname + # ///////////////// DMaaP Config Constants - mr.hostname=10.53.172.156 - # default port number + #default hostname + mr.dmaaphost=10.53.172.156 + # default port number mr.DEFAULT_PORT_NUMBER=3904 - # default to no username + # defaults to no username mr.DEFAULT_USER_NAME=null # defaults to no userPassword mr.DEFAULT_USER_PASSWORD=null - #defaults to using https protocol + #d efaults to using https protocol mr.DEFAULT_PROTOCOL=http - #defaults to json content type + # defaults to json content type mr.DEFAULT_CONTENT_TYPE=application/json mr.DMAAP_URI_PATH_PREFIX=/events/ mr.DMAAP_DEFAULT_CONSUMER_ID=con2 mr.DMAAP_GROUP_PREFIX=grp2 - # // ================== DMaaP MR Constants ============================== // +#DMaaP MR subscriber thread's polling interval in milli second +mr.POLLING_INTERVAL=10000 - # ///////////////// Publisher Constants - #Dmaap Publisher Topic - mr.publisher.topic=unauthenticated.SEC_FAULT_OUTPUT - #mr.publisher.topic=TEST-TOPIC1 - #mr.publisher.topic=unauthenticated.SEC_MEASUREMENT_OUTPUT - #disable batching by default - mr.publisher.DEFAULT_PUBLISHER_MAX_BATCH_SIZE=1 - # default recovery messages size - mr.publisher.DEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE=100000 - #number of retries when flushing messages - mr.publisher.PUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE=5 - #delay in retrying for flushing messages - mr.publisher.PUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE=5000 - #////////////////// Subscriber Constants - #Dmaap Subcriber Topic - #mr.subscriber.topic=ONAP-COLLECTOR-SNMPTRAP - mr.subscriber.topic=ONAP-COLLECTOR-SNMPTRAP - #mr.subscriber.topic=TEST-TOPIC2 - mr.subcriber.DEFAULT_SUBSCRIBER_TIMEOUT_MS=-1 - mr.subcriber.DEFAULT_SUBSCRIBER_MESSAGE_LIMIT=-1 - mr.subcriber.DEFAULT_SUBSCRIBER_GROUP_PREFIX=grp2 - mr.subcriber.SUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME=timeout - mr.subcriber.SUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME=limit \ No newline at end of file +# ///////////////// Publisher Constants + +#Dmaap Publisher Topic +mr.publisher.topic=unauthenticated.SEC_FAULT_OUTPUT +#disable batching by default +mr.publisher.DEFAULT_PUBLISHER_MAX_BATCH_SIZE=1 +# default recovery messages size +mr.publisher.DEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE=100000 +#number of retries when flushing messages +mr.publisher.PUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE=5 +#delay in retrying for flushing messages +mr.publisher.PUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE=5000 + + +#////////////////// Subscriber Constants + +#Dmaap Subcriber Topic +mr.subscriber.topic=ONAP-COLLECTOR-SNMPTRAP +mr.subcriber.DEFAULT_SUBSCRIBER_TIMEOUT_MS=-1 +mr.subcriber.DEFAULT_SUBSCRIBER_MESSAGE_LIMIT=-1 +mr.subcriber.DEFAULT_SUBSCRIBER_GROUP_PREFIX=grp2 +mr.subcriber.SUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME=timeout +mr.subcriber.SUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME=limit \ No newline at end of file diff --git a/UniversalVesAdapter/src/main/resources/MapperConfig.json b/UniversalVesAdapter/src/main/resources/MapperConfig.json deleted file mode 100644 index e39c822..0000000 --- a/UniversalVesAdapter/src/main/resources/MapperConfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "entries" : [ - { - "priority" : 1, - "evaluation" : { - "operand" : "EQUALS", - "field" : "notify OID", - "value" : ".1.3.6.1.4.1.74.2.46.12.1.1", - "datatype" : "string", - "lhs" : null, - "rhs" : null - }, - "result" : "snmp" - } - ] -} \ No newline at end of file diff --git a/UniversalVesAdapter/src/main/resources/MapperConfigFullFormat.json b/UniversalVesAdapter/src/main/resources/MapperConfigFullFormat.json deleted file mode 100644 index 059dc2e..0000000 --- a/UniversalVesAdapter/src/main/resources/MapperConfigFullFormat.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries" : [ - { - "priority" : 1, - "evaluation" : { - "operand" : "EQUALS", - "field" : "notify OID", - "value" : ".1.3.6.1.4.1.74.2.46.12.1.1", - "datatype" : "string", - "lhs" : null, - "rhs" : null - }, - "result" : "snmpTrapToVes.xml" - }, - { - "priority" : 2, - "evaluation" : { - "operand" : "AND", - "field" : null, - "value" : null, - "datatype" : null, - "lhs" : { - "operand" : "OR", - "field" : null, - "value" : null, - "datatype" : null, - "lhs" : { - "operand" : "EQUALS", - "field" : "domain", - "value" : "snmp-heartbeat", - "datatype" : "string", - "lhs" : null, - "rhs" : null - }, - "rhs" : { - "operand" : "EQUALS", - "field" : "domain", - "value" : "snmp-fault", - "datatype" : "string", - "lhs" : null, - "rhs" : null - } - }, - "rhs" : { - "operand" : "EQUALS", - "field" : "trap version", - "value" : "1.2", - "datatype" : "float", - "lhs" : null, - "rhs" : null - } - }, - "result" : "smooks.config" - } - ] -} \ No newline at end of file diff --git a/UniversalVesAdapter/src/main/resources/application.properties b/UniversalVesAdapter/src/main/resources/application.properties index c940da4..abbfab7 100644 --- a/UniversalVesAdapter/src/main/resources/application.properties +++ b/UniversalVesAdapter/src/main/resources/application.properties @@ -1,18 +1,14 @@ server.port=8085 - logging.level.org.springframework.web=ERROR -defaultMappingFileName=defaultSnmpMappingFile -universal.configFiles=snmp:snmpTrapToVes.xml,default:defaultConfig.xml - -mapperConfig.file=../UniversalVesAdapter/src/main/resources/MapperConfig.json dmaap.mr_props=DMaapMR.properties -#DEV Machine DB Details -#spring.datasource.url=jdbc:postgresql://10.49.16.19:5432/dummy -#spring.datasource.username=postgres -#spring.datasource.password=root - #Lab Details spring.datasource.url=jdbc:postgresql://10.53.172.129:5432/dummy spring.datasource.username=ngpuser -spring.datasource.password=root \ No newline at end of file +spring.datasource.password=root + +#MappingFileDetails +defaultMappingFilelocation=defaultSnmpMappingFile.xml +defaultEnterpriseId=default + +MappingFileTableName=mapping_file \ No newline at end of file diff --git a/UniversalVesAdapter/src/main/resources/defaultSnmpMappingFile.xml b/UniversalVesAdapter/src/main/resources/defaultSnmpMappingFile.xml new file mode 100644 index 0000000..d36f854 --- /dev/null +++ b/UniversalVesAdapter/src/main/resources/defaultSnmpMappingFile.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + "3.0" + "XXXX" + "VesAdapter" + "fault" + commonEventHeader.domain+"_"+"_"+ faultFields.alarmCondition; + + + + "Medium" + "VesAdapter" + + + + + "MINOR" + "SNMP Agent" + "SNMP Fault" + + + "Active" + + + + + + + + + + + + + \ No newline at end of file -- cgit 1.2.3-korg