Rich Bennett | 9847631 | 2018-08-25 10:43:15 -0400 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. http://creativecommons.org/licenses/by/4.0 |
| 3 | |
| 4 | Configuration |
| 5 | ============= |
| 6 | |
| 7 | **SNMPTRAP** configuration is controlled via a single JSON 'transaction'. |
| 8 | This transaction can be: |
| 9 | |
| 10 | - a reply from config binding services |
| 11 | |
| 12 | - a locally hosted JSON file |
| 13 | |
| 14 | The format of this message is described in the SNMPTRAP package, under: |
| 15 | |
| 16 | ``<base install dir>/spec/snmptrap-collector-component-spec.json`` |
| 17 | |
| 18 | There should also be a template JSON file with example/default values found at: |
| 19 | |
| 20 | ``<base install dir>/etc/snmptrapd.json`` |
| 21 | |
| 22 | If you are going to use a local file, the env variable below must be defined before SNMPTRAP runs. There is a default value set in the SNMPTRAP startup script (bin/snmptrapd.sh): |
| 23 | |
| 24 | ``export CBS_SIM_JSON=../etc/snmptrapd.json`` |
| 25 | |
| 26 | In either scenario, the format of the config message/transaction is the same. An example is described below. |
| 27 | |
| 28 | JSON CONFIG |
| 29 | ^^^^^^^^^^^ |
| 30 | |
| 31 | The format of the JSON configuration that drives all behavior of SNMPTRAP is probably best described using an example. One can be found below: |
| 32 | |
| 33 | .. code-block:: json |
| 34 | |
| 35 | { |
| 36 | "snmptrapd": { |
| 37 | "version": "1.3.0", |
| 38 | "title": "ONAP SNMP Trap Receiver" |
| 39 | }, |
| 40 | "protocols": { |
| 41 | "transport": "udp", |
| 42 | "ipv4_interface": "0.0.0.0", |
| 43 | "ipv4_port": 6162, |
| 44 | "ipv6_interface": "::1", |
| 45 | "ipv6_port": 6162 |
| 46 | }, |
| 47 | "cache": { |
| 48 | "dns_cache_ttl_seconds": 60 |
| 49 | }, |
| 50 | "publisher": { |
| 51 | "http_timeout_milliseconds": 1500, |
| 52 | "http_retries": 3, |
| 53 | "http_milliseconds_between_retries": 750, |
| 54 | "http_primary_publisher": "true", |
| 55 | "http_peer_publisher": "unavailable", |
| 56 | "max_traps_between_publishes": 10, |
| 57 | "max_milliseconds_between_publishes": 10000 |
| 58 | }, |
| 59 | "streams_publishes": { |
| 60 | "sec_fault_unsecure": { |
| 61 | "type": "message_router", |
| 62 | "aaf_password": null, |
| 63 | "dmaap_info": { |
| 64 | "location": "mtl5", |
| 65 | "client_id": null, |
| 66 | "client_role": null, |
| 67 | "topic_url": "http://localhost:3904/events/ONAP-COLLECTOR-SNMPTRAP" |
| 68 | }, |
| 69 | "aaf_username": null |
| 70 | } |
| 71 | }, |
| 72 | "files": { |
| 73 | "runtime_base_dir": "/opt/app/snmptrap", |
| 74 | "log_dir": "logs", |
| 75 | "data_dir": "data", |
| 76 | "pid_dir": "tmp", |
| 77 | "arriving_traps_log": "snmptrapd_arriving_traps.log", |
| 78 | "snmptrapd_diag": "snmptrapd_prog_diag.log", |
| 79 | "traps_stats_log": "snmptrapd_stats.csv", |
| 80 | "perm_status_file": "snmptrapd_status.log", |
| 81 | "eelf_base_dir": "/opt/app/snmptrap/logs", |
| 82 | "eelf_error": "error.log", |
| 83 | "eelf_debug": "debug.log", |
| 84 | "eelf_audit": "audit.log", |
| 85 | "eelf_metrics": "metrics.log", |
| 86 | "roll_frequency": "hour", |
| 87 | "minimum_severity_to_log": 2 |
| 88 | }, |
| 89 | "trap_config": { |
| 90 | "sw_interval_in_seconds": 60, |
| 91 | "notify_oids": { |
| 92 | ".1.3.6.1.4.1.9.0.1": { |
| 93 | "sw_high_water_in_interval": 102, |
| 94 | "sw_low_water_in_interval": 7, |
| 95 | "category": "logonly" |
| 96 | }, |
| 97 | ".1.3.6.1.4.1.9.0.2": { |
| 98 | "sw_high_water_in_interval": 101, |
| 99 | "sw_low_water_in_interval": 7, |
| 100 | "category": "logonly" |
| 101 | }, |
| 102 | ".1.3.6.1.4.1.9.0.3": { |
| 103 | "sw_high_water_in_interval": 102, |
| 104 | "sw_low_water_in_interval": 7, |
| 105 | "category": "logonly" |
| 106 | }, |
| 107 | ".1.3.6.1.4.1.9.0.4": { |
| 108 | "sw_high_water_in_interval": 10, |
| 109 | "sw_low_water_in_interval": 3, |
| 110 | "category": "logonly" |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |