diff options
Diffstat (limited to 'UniversalVesAdapter/src/main/resources')
5 files changed, 103 insertions, 115 deletions
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 @@ +<?xml version="1.0"?> +<smooks-resource-list + xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" + xmlns:json="http://www.milyn.org/xsd/smooks/json-1.1.xsd" + xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd"> + <json:reader rootName="vesevent" keyWhitspaceReplacement="-"> + <json:keyMap> + <json:key from="date&time" to="date-and-time" /> + </json:keyMap> + </json:reader> + + <jb:bean class="org.onap.dcaegen2.ves.domain.VesEvent" beanId="vesEvent" createOnElement="vesevent"> + <jb:wiring property="event" beanIdRef="event"/> + </jb:bean> + + <jb:bean class="org.onap.dcaegen2.ves.domain.Event" beanId="event" createOnElement="vesevent"> + <jb:wiring property="commonEventHeader" beanIdRef="commonEventHeader"/> + <jb:wiring property="faultFields" beanIdRef="faultFields"/> + <!--<jb:wiring property="measurementsForVfScalingFields" beanIdRef="measurementsForVfScalingFields"/> --> + </jb:bean> + <!--<jb:bean class="org.onap.dcaegen2.ves.domain.MeasurementsForVfScalingFields" beanId="measurementsForVfScalingFields" createOnElement="simple"> + <jb:wiring property="additionalMeasurements" beanIdRef="additionalMeasurements"/> + </jb:bean>--> + + <jb:bean class="org.onap.dcaegen2.ves.domain.CommonEventHeader" beanId="commonEventHeader" createOnElement="vesevent"> + <jb:expression property="version">"3.0"</jb:expression> + <jb:expression property="eventId">"XXXX"</jb:expression> + <jb:expression property="reportingEntityName">"VesAdapter"</jb:expression> + <jb:expression property="domain">"fault"</jb:expression> + <jb:expression property="eventName" execOnElement="vesevent" >commonEventHeader.domain+"_"+"_"+ faultFields.alarmCondition;</jb:expression> + <jb:value property="sequence" data="0" default="0" decoder="Long"/> + <jb:value property="lastEpochMicrosec" data="#/time-received" decoder="Double" /> + <jb:value property="startEpochMicrosec" data="#/time-received" decoder="Double"/> + <jb:expression property="priority">"Medium"</jb:expression> + <jb:expression property="sourceName">"VesAdapter"</jb:expression> + </jb:bean> + + <jb:bean class="org.onap.dcaegen2.ves.domain.FaultFields" beanId="faultFields" createOnElement="vesevent"> + <jb:value property="alarmCondition" data="#/trap-category" /> + <jb:expression property="eventSeverity">"MINOR"</jb:expression> + <jb:expression property="eventSourceType">"SNMP Agent"</jb:expression> + <jb:expression property="specificProblem">"SNMP Fault"</jb:expression> + <jb:value property="faultFieldsVersion" data="2.0" default="2.0" decoder="Double" /> + <jb:wiring property="alarmAdditionalInformation" beanIdRef="alarmAdditionalInformationroot"/> + <jb:expression property="vfStatus">"Active"</jb:expression> + + </jb:bean> + <jb:bean class="java.util.ArrayList" beanId="alarmAdditionalInformationroot" createOnElement="vesevent"> + <jb:wiring beanIdRef="alarmAdditionalInformation"/> + </jb:bean> + + <jb:bean class="org.onap.dcaegen2.ves.domain.AlarmAdditionalInformation" beanId="alarmAdditionalInformation" createOnElement="varbinds/element"> + <jb:value property="name" data="#/varbind_oid"/> + <jb:value property="value" data="#/varbind_value" /> + </jb:bean> + <!--<jb:bean class="java.util.ArrayList" beanId="additionalMeasurements" createOnElement="simple"> + <jb:wiring beanIdRef="additionalMeasurement"/> + </jb:bean> + + <jb:bean class="org.onap.dcaegen2.ves.domain.AdditionalMeasurement" beanId="additionalMeasurement" createOnElement="varbinds/element"> + <jb:value property="name" data="#/varbind_value" /> + </jb:bean> --> + +</smooks-resource-list>
\ No newline at end of file |