From 91e472c8640d9d6364c311474b15e9c9a95a0e9f Mon Sep 17 00:00:00 2001 From: Pooja03 Date: Fri, 2 Nov 2018 20:20:57 +0530 Subject: Adding Documentation of Mapper Adding documentation of Mapper on readthedocs Change-Id: I80ec21296ec42ef21552a9e93839ca5209a27a58 Issue-ID: DCAEGEN2-936 Signed-off-by: Pooja03 --- docs/sections/services/mapper/MappingFile.rst | 84 ++++++++++++ .../services/mapper/SampleSnmpTrapConversion.rst | 150 +++++++++++++++++++++ docs/sections/services/mapper/delivery.rst | 17 +++ docs/sections/services/mapper/flow.PNG | Bin 0 -> 35180 bytes docs/sections/services/mapper/flow.rst | 17 +++ docs/sections/services/mapper/index.rst | 30 +++++ docs/sections/services/mapper/installation.rst | 48 +++++++ 7 files changed, 346 insertions(+) create mode 100644 docs/sections/services/mapper/MappingFile.rst create mode 100644 docs/sections/services/mapper/SampleSnmpTrapConversion.rst create mode 100644 docs/sections/services/mapper/delivery.rst create mode 100644 docs/sections/services/mapper/flow.PNG create mode 100644 docs/sections/services/mapper/flow.rst create mode 100644 docs/sections/services/mapper/index.rst create mode 100644 docs/sections/services/mapper/installation.rst (limited to 'docs/sections/services/mapper') diff --git a/docs/sections/services/mapper/MappingFile.rst b/docs/sections/services/mapper/MappingFile.rst new file mode 100644 index 00000000..e99ba5a9 --- /dev/null +++ b/docs/sections/services/mapper/MappingFile.rst @@ -0,0 +1,84 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Tech Mahindra Ltd. + +Mapping File +============ + +Mapping file is needed by Universal VES Adapter to convert the telemetry data into the VES format. +The Adapter uses Smooks Framework to do the data format conversion by using the mapping files. +Currently it requires to write the mapping file manually and upload it using the SnmpMapper application. The file gets stored into the postgres database. The pgInventory instance is used for this. + +| To know more about smooks framework check the following link: +| http://www.smooks.org/guide + +Following is the default snmp mapping file which is used when no mapping file is found while processing event from SNMP Trap Collector. + +.. code-block:: xml + + + + + + + + + + + + + + + + + + + + + + "3.0" + "XXXX" + "VesAdapter" + "fault" + commonEventHeader.domain+"_"+"_"+ faultFields.alarmCondition; + + + + "Medium" + "VesAdapter" + + + + + "MINOR" + "SNMP Agent" + "SNMP Fault" + + + "Active" + + + + + + + + + + + + + + + diff --git a/docs/sections/services/mapper/SampleSnmpTrapConversion.rst b/docs/sections/services/mapper/SampleSnmpTrapConversion.rst new file mode 100644 index 00000000..71f5718b --- /dev/null +++ b/docs/sections/services/mapper/SampleSnmpTrapConversion.rst @@ -0,0 +1,150 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Tech Mahindra Ltd. + +Sample Snmp trap Conversion: +=========================== + +Following is the **Sample SNMP Trap** that will be received by the Universal VES Adapter from the Snmp Trap Collector : + +.. code-block:: json + + { + "cambria.partition":"10.53.172.132", + "trap category":"ONAP-COLLECTOR-SNMPTRAP", + "community len":0, + "protocol version":"v2c", + "varbinds":[ + { + "varbind_value":"CLEARED and CRITICAL severities have the same name", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.2.0", + "varbind_type":"OctetString" + }, + { + "varbind_value":"1.3", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.3.0", + "varbind_type":"ObjectIdentifier" + }, + { + "varbind_value":"1.3", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.4.0", + "varbind_type":"ObjectIdentifier" + }, + { + "varbind_value":"CLEARED", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.5.0", + "varbind_type":"OctetString" + }, + { + "varbind_value":"Queue manager: Process failure cleared", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.6.0", + "varbind_type":"OctetString" + }, + { + "varbind_value":"The queue manager process has been restored to normal operation", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.7.0", + "varbind_type":"OctetString" + }, + { + "varbind_value":"The queue manager process has been restored to normal operation. The previously issued alarm has been cleared", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.8.0", + "varbind_type":"OctetString" + }, + { + "varbind_value":"Changes to shared config will be synchronized across the cluster", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.9.0", + "varbind_type":"OctetString" + }, + { + "varbind_value":"No action", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.10.0", + "varbind_type":"OctetString" + }, + { + "varbind_value":"sprout-1.example.com", + "varbind_oid":"1.3.6.1.4.1.19444.12.2.0.12.0", + "varbind_type":"OctetString" + } + ], + "notify OID":"1.3.6.1.6.3.1.1.5.3", + "community":"", + "uuid":"1fad4802-a6d0-11e8-a349-0242ac110002", + "epoch_serno":15350273450000, + "agent name":"10.53.172.132", + "sysUptime":"0", + "time received":1.535027345042007E9, + "agent address":"10.53.172.132", + "notify OID len":10 + } + + +Following is the converted VES Format of the above SNMP Sample Trap by using the default SNMP Trap Mapping File: + +.. code-block:: json + + { + "event":{ + "commonEventHeader":{ + "startEpochMicrosec":1.5350269902625413E9, + "eventId":"XXXX", + "sequence":0, + "domain":"fault", + "lastEpochMicrosec":1.5350269902625413E9, + "eventName":"fault__ONAP-COLLECTOR-SNMPTRAP", + "sourceName":"10.53.172.132", + "priority":"Medium", + "version":3, + "reportingEntityName":"VesAdapter" + }, + "faultFields":{ + "eventSeverity":"MINOR", + "alarmCondition":"ONAP-COLLECTOR-SNMPTRAP", + "faultFieldsVersion":2, + "specificProblem":"SNMP Fault", + "alarmAdditionalInformation":[ + { + "name":"1.3.6.1.4.1.19444.12.2.0.2.0", + "value":"CLEARED and CRITICAL severities have the same name" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.3.0", + "value":"1.3" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.4.0", + "value":"1.3" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.5.0", + "value":"CLEARED" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.6.0", + "value":"Queue manager: Process failure cleared" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.7.0", + "value":"The queue manager process has been restored to normal operation" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.8.0", + "value":"The queue manager process has been restored to normal operation. The previously issued alarm has been cleared" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.9.0", + "value":"Changes to shared config will be synchronized across the cluster" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.10.0", + "value":"No action" + }, + { + "name":"1.3.6.1.4.1.19444.12.2.0.12.0", + "value":"sprout-1.example.com" + } + ], + "eventSourceType":"SNMP Agent", + "vfStatus":"Active" + } + } + } \ No newline at end of file diff --git a/docs/sections/services/mapper/delivery.rst b/docs/sections/services/mapper/delivery.rst new file mode 100644 index 00000000..10968b7e --- /dev/null +++ b/docs/sections/services/mapper/delivery.rst @@ -0,0 +1,17 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Tech Mahindra Ltd. + +Delivery +======== +Mapper is delivered with **2 Docker container** having spring boot microservices, **UniversalVesAdapter** and **SnmMapper**. UniversalVesAdapter converts SNMP trap JSON to VES and snmpmapper is just helper application for uploading the mapping file to DB. + +| In current release, the installation of mapper service is not integrated with DCAE's installation process and needs to be done manually. + +Docker Containers +--------------- +Docker images can be pulled from ONAP Nexus repository with below commands: + +| docker pull nexus3.onap.org:10003/snapshots/onap/org.onap.dcaegen2.services.mapper.vesadapter.universalvesadaptor:latest + +| docker pull nexus3.onap.org:10003/snapshots/onap/org.onap.dcaegen2.services.mapper.vesadapter.snmpmapper:latest diff --git a/docs/sections/services/mapper/flow.PNG b/docs/sections/services/mapper/flow.PNG new file mode 100644 index 00000000..614d5d5f Binary files /dev/null and b/docs/sections/services/mapper/flow.PNG differ diff --git a/docs/sections/services/mapper/flow.rst b/docs/sections/services/mapper/flow.rst new file mode 100644 index 00000000..cff2485e --- /dev/null +++ b/docs/sections/services/mapper/flow.rst @@ -0,0 +1,17 @@ +============ +Flow +============ +.. [#] VNF submits SNMP traps to the SNMP trap collecto. +.. [#] Collector converts the trap into JSON format and publishes it on DMaaP topic **ONAP-COLLECTOR-SNMPTRAP** +.. [#] The Universal VES Adapter(UVA) microservice has subscribed to this DMaaP topic. +.. [#] On receiving an event from DMaaP, the adapter uses the corresponding mapping file from repository and converts received event into the VES event. It uses the enterprise ID from the received event to find the required mapping file. +.. [#] Those SNMP Traps for which no mapping file is identified, a default mapping file is used with generic mappings to create the VES object. +.. [#] The VES formatted Event will be then published on DMaaP topic **unauthenticated.SEC_FAULT_OUTPUT**. + + +.. image:: ./flow.png + :height: 100px + :width: 200 px + :scale: 50 % + :alt: alternate text + :align: left \ No newline at end of file diff --git a/docs/sections/services/mapper/index.rst b/docs/sections/services/mapper/index.rst new file mode 100644 index 00000000..81122932 --- /dev/null +++ b/docs/sections/services/mapper/index.rst @@ -0,0 +1,30 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Tech Mahindra Ltd. + + +Mapper +===================== + +| **Problem:** Different VNF vendors generate event and telemetry data in different formats. Out of the box, all VNF vendors may not support VES format. +| **Solution**: A generic adapter which can convert different formats of event and telemetry data to VES format can be of use here. +| *Note*: Currently support snmp trap telemetry data + +There are 2 micro services in the mapper functionality. + +**Universal VES Adapter** - It converts the telemetry data into the required ves format and publishes to the dmaap for further action to be taken. + *Note*: Currently it supports conversion of snmp traps generated by SNMP TRAP Collector. With some work, it can support other collectors as well. + + +**SnmpMapper** - It provides web UI to upload mapping files which are then stored into the postgres database. VES adapter refers to these mapping files at the time of converting the events into VES events. + + + +.. toctree:: + :maxdepth: 1 + + ./flow.rst + ./delivery.rst + ./installation.rst + ./MappingFile.rst + ./SampleSnmpTrapConversion diff --git a/docs/sections/services/mapper/installation.rst b/docs/sections/services/mapper/installation.rst new file mode 100644 index 00000000..1d05ebb8 --- /dev/null +++ b/docs/sections/services/mapper/installation.rst @@ -0,0 +1,48 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Tech Mahindra Ltd. + + +Installation +============ +Currently both Universal VES Adapter and SnmpMapper are not integrated with CONFIG_BINDING_SERVICE to get their configuration. All the required configuration needs to be passed as docker environment parameters. + +| **Universal Ves Adapter** + + To run Universal Ves Adapter container on standalone mode, following docker environment parameters are required. + + +- DMAAPHOST - Should contain an address to DMaaP, so that event publishing can work +- MR_PORT - DMaaP Exposed Port +- URL_JDBC - JDBC URL where postgres db is installed +- JDBC_USERNAME - Username for postgres DB user +- JDBC_PASSWORD - Password for postgres DB user +- CONSUL_HOST - a host address where Consul service lies +- CONFIG_BINDING_SERVICE - name of CBS as it is registered in Consul +- HOSTNAME - name of Universal Ves Adapter application as it is registered in CBS catalog + +Sample docker run command could be - + + ``docker run -d -p 8085:8085/tcp -e URL_JDBC=jdbc:postgresql://10.53.172.138:5432/postgres -e JDBC_USERNAME=postgres -e JDBC_PASSWORD=root -e DMAAPHOST=10.53.172.156 -e CONSUL_HOST=10.53.172.109 -e HOSTNAME=static-dcaegen2-services-mua -e MR_DEFAULT_PORT_NUMBER=3904 -e CONFIG_BINDING_SERVICE=config_binding_service nexus3.onap.org:10003/onap/org.onap.dcaegen2.services.mapper.vesadapter.universalvesadaptor:latest`` + +Note: you should have a postgresql and DMaap instance running in your system and provide their credentials and hostname to run in standalone mode. + + + + +| **SnmpMapper** + +- To run SnmpMapper container on standalone mode, following docker environment parameters are required. + +- DMAAPHOST-should contain an address to DMaaP, this will be used in future reference +- MR_PORT - DMaaP Exposed Port +- URL_JDBC- JDBC URL where postgres db is installed +- JDBC_USERNAME- Username for postgres DB user +- JDBC_PASSWORD-Password for postgres DB user +- CONSUL_HOST - a host address where Consul service lies +- CONFIG_BINDING_SERVICE - name of CBS as it is registered in Consul +- HOSTNAME - name of Universal Ves Adapter application as it is registered in CBS catalog + +Sample docker run command could be - + + ``docker run -d -p 8084:8080/tcp -e URL_JDBC=jdbc:postgresql://10.53.172.138:5432/postgres -e JDBC_USERNAME=postgres -e JDBC_PASSWORD=root -e DMAAPHOST=10.53.172.156 -e CONSUL_HOST=10.53.172.109 -e HOSTNAME=static-dcaegen2-services-msnmp -e MR_DEFAULT_PORT_NUMBER=3904 -e CONFIG_BINDING_SERVICE=config_binding_service nexus3.onap.org:10003/onap/org.onap.dcaegen2.services.mapper.snmpmapper:latest`` -- cgit 1.2.3-korg