4 The mediator server is the physical device on which multiple instances of the [mediators](mediator/README.md) are running. Additionally a small webserver provides an API to control and create the mediators via HTTP-API. These mediators are translating the requests and responses between the SDN-Controller(netconf) and the device(snmp). Because of the restricted snmp protocol (port 162 only) we have to implement a prerouting automatism that forwards the alarms sent by the devices to another local port so that each mediator only gets the alarms of its device.
11 /etc/mediatorserver.conf
15 #global config file for mediatorserver
24 #Port range for Netconf
36 #Log (ERROR | WARN | DEBUG | INFO | TRACE )
38 logfile=/var/log/mediatorserver.log
40 #=====================================
41 #global MediatorConfig
43 #set LogLevel (ERROR | WARN | DEBUG | INFO | TRACE )
44 MediatorLogLevel=DEBUG
46 #set ping timeout in milliseconds
47 MediatorDevicePingTimeout=2000
49 #set latency for snmp requests
50 MediatorSnmpLatency=2000
52 #set java memory for mediator instance
53 MediatorMemory="-Xmx256m -Xms128m"
59 http://<host>:<port>/api/?task=<task>
62 | Task | additional Parameters | Description | Response (Success) |
63 | ---- | --------------------- | ----------- | ------------------ |
64 | create | config=<config-object> | create new mediator instance | {"code":1,"data":"<string>"}|
65 | delete | name=<name> | delete mediator instance | \{"code":1,"data":<string>"} |
66 | start | name=<name> | start mediator instance | \{"code":1,"data":"<string>"} |
67 | stop | name=<name> | stop mediator instance | \{"code":1,"data":"<string>"} |
68 | getconfig | name=<name>(optional) | Get current Config for all instances / named mediator instance | \{"code":1,"data":[<config-objects>]}|
69 | getlog | name=<name>(optional) | Get LogEntries for all instances / named mediator instance | \{"code":1,"data":[]} |
70 | clearlock | name=<name> | Clear Mediator Lock File | \{"code":1,"data":"<string>"} |
71 | getnemodels | - | get all Network Element Template Filenames | \{"code":1,"data":[<string-array>]} |
72 | getncports | limit=<limit>(optional) | get next free ports for Netconf Connections | \{"code":1,"data":[<int-array>]} |
73 | getsnmpports | limit=<limit>(optional) | get next free ports for SNMP Traps | \{"code":1,"data":[<int-array>]} |
74 | version | - | get version info of server and mediator | \{"code":1,"data":\{"server":"0.1.0","mediator":"0.1.1"\}\}|
75 | repair | - | try to fix corrupted configs | \{"code":1,"data":[<config-status-objects>]}|
77 HTTP-Response is always a json-formatted String with 2 Elements:
79 * code ... 1:success 0:failure
80 * data ... if code==0: <string> else <string | object>
93 NeModel:<XML Filename>,
107 IsNetconfConnected:<boolean>,
108 IsNeConnected:<boolean>
125 All functionality which is not automated can be executed by the control script
130 | parameter | description |
131 | ------------- | ------------------------------------------------ |
132 |checkout | get latest code from git repo |
133 |cpsrc | copy binary files from source |
134 |cpxml | copy xml files from source |
135 |build | build sources |
136 |make | build sources and install bins and ressources |
137 |start | start server |
138 |stop | stop server |
139 |stopall | stop all mediators, then the server |
140 |startmed [med] | start mediator with name [med] |
141 |stopmed [med] | stop mediator with name [med] |
142 |status | print status |
143 |repair | repair config files if corrupted |