Merge "Update getting-started-guide."
[docs.git] / docs / developer-guide / cardinal_-opendaylight-monitoring-as-a-service.rst
1 .. _cardinal-dev-guide:
2
3 Cardinal: OpenDaylight Monitoring as a Service
4 ==============================================
5
6 Overview
7 --------
8
9 Cardinal (OpenDaylight Monitoring as a Service) enables OpenDaylight and
10 the underlying software defined network to be remotely monitored by
11 deployed Network Management Systems (NMS) or Analytics suite. In the
12 Boron release, Cardinal adds:
13
14 1. OpenDaylight MIB.
15
16 2. Enable ODL diagnostics/monitoring to be exposed across SNMP (v2c, v3)
17    and REST north-bound.
18
19 3. Extend ODL System health, Karaf parameter and feature info, ODL
20    plugin scalability and network parameters.
21
22 4. Support autonomous notifications (SNMP Traps).
23
24 Cardinal Architecture
25 ---------------------
26
27 The Cardinal architecture can be found at the below link:
28
29 https://wiki.opendaylight.org/images/8/89/Cardinal-ODL_Monitoring_as_a_Service_V2.pdf
30
31 Key APIs and Interfaces
32 -----------------------
33
34 There are 6 main APIs for requesting snmpget request of the Karaf info,
35 System info, Openflow devices and Netconf Devices. To expose these APIs,
36 it assumes that you already have the ``odl-cardinal`` and ``odl-restconf``
37 features installed. You can do that by entering the following at the Karaf console:
38
39 ::
40
41     feature:install odl-cardinal
42     feature:install odl-restconf-all
43     feature:install odl-l2switch-switch
44     feature:install odl-netconf-all
45     feature:install odl-netconf-connector-all
46     feature:install odl-netconf-mdsal
47     feature:install cardinal-features4
48     feature:install odl-cardinal-api
49     feature:install odl-cardinal-ui
50     feature:install odl-cardinal-rest
51
52 System Info APIs
53 ~~~~~~~~~~~~~~~~
54
55 Open the REST interface and using the basic authentication, execute REST
56 APIs for system info as:
57
58 ::
59
60     http://localhost:8181/restconf/operational/cardinal:CardinalSystemInfo/
61
62 You should get the response code of the same as 200 OK with the
63 following output as:
64
65 ::
66
67     {
68       "CardinalSystemInfo": {
69         "odlSystemMemUsage": " 9",
70         "odlSystemSysInfo": " OpenDaylight Node Information",
71         "odlSystemOdlUptime": " 00:29",
72         "odlSystemCpuUsage": " 271",
73         "odlSystemHostAddress": " Address of the Host should come up"
74       }
75     }
76
77 Karaf Info APIs
78 ~~~~~~~~~~~~~~~
79
80 Open the REST interface and using the basic authentication, execute REST
81 APIs for system info as:
82
83 ::
84
85     http://localhost:8181/restconf/operational/cardinal-karaf:CardinalKarafInfo/
86
87 You should get the response code of the same as 200 OK with the
88 following output as:
89
90 ::
91
92       {
93       "CardinalKarafInfo": {
94         "odlKarafBundleListActive1": " org.ops4j.pax.url.mvn_2.4.5 [1]",
95         "odlKarafBundleListActive2": " org.ops4j.pax.url.wrap_2.4.5 [2]",
96         "odlKarafBundleListActive3": " org.ops4j.pax.logging.pax-logging-api_1.8.4 [3]",
97         "odlKarafBundleListActive4": " org.ops4j.pax.logging.pax-logging-service_1.8.4 [4]",
98         "odlKarafBundleListActive5": " org.apache.karaf.service.guard_3.0.6 [5]",
99         "odlKarafBundleListActive6": " org.apache.felix.configadmin_1.8.4 [6]",
100         "odlKarafBundleListActive7": " org.apache.felix.fileinstall_3.5.2 [7]",
101         "odlKarafBundleListActive8": " org.objectweb.asm.all_5.0.3 [8]",
102         "odlKarafBundleListActive9": " org.apache.aries.util_1.1.1 [9]",
103         "odlKarafBundleListActive10": " org.apache.aries.proxy.api_1.0.1 [10]",
104         "odlKarafBundleListInstalled1": " org.ops4j.pax.url.mvn_2.4.5 [1]",
105         "odlKarafBundleListInstalled2": " org.ops4j.pax.url.wrap_2.4.5 [2]",
106         "odlKarafBundleListInstalled3": " org.ops4j.pax.logging.pax-logging-api_1.8.4 [3]",
107         "odlKarafBundleListInstalled4": " org.ops4j.pax.logging.pax-logging-service_1.8.4 [4]",
108         "odlKarafBundleListInstalled5": " org.apache.karaf.service.guard_3.0.6 [5]",
109         "odlKarafFeatureListInstalled1": " config",
110         "odlKarafFeatureListInstalled2": " region",
111         "odlKarafFeatureListInstalled3": " package",
112         "odlKarafFeatureListInstalled4": " http",
113         "odlKarafFeatureListInstalled5": " war",
114         "odlKarafFeatureListInstalled6": " kar",
115         "odlKarafFeatureListInstalled7": " ssh",
116         "odlKarafFeatureListInstalled8": " management",
117         "odlKarafFeatureListInstalled9": " odl-netty",
118         "odlKarafFeatureListInstalled10": " odl-lmax",
119         "odlKarafBundleListResolved1": " org.ops4j.pax.url.mvn_2.4.5 [1]",
120         "odlKarafBundleListResolved2": " org.ops4j.pax.url.wrap_2.4.5 [2]",
121         "odlKarafBundleListResolved3": " org.ops4j.pax.logging.pax-logging-api_1.8.4 [3]",
122         "odlKarafBundleListResolved4": " org.ops4j.pax.logging.pax-logging-service_1.8.4 [4]",
123         "odlKarafBundleListResolved5": " org.apache.karaf.service.guard_3.0.6 [5]",
124         "odlKarafFeatureListUnInstalled1": " aries-annotation",
125         "odlKarafFeatureListUnInstalled2": " wrapper",
126         "odlKarafFeatureListUnInstalled3": " service-wrapper",
127         "odlKarafFeatureListUnInstalled4": " obr",
128         "odlKarafFeatureListUnInstalled5": " http-whiteboard",
129         "odlKarafFeatureListUnInstalled6": " jetty",
130         "odlKarafFeatureListUnInstalled7": " webconsole",
131         "odlKarafFeatureListUnInstalled8": " scheduler",
132         "odlKarafFeatureListUnInstalled9": " eventadmin",
133         "odlKarafFeatureListUnInstalled10": " jasypt-encryption"
134       }
135     }
136
137 OpenFlowInfo Apis
138 ~~~~~~~~~~~~~~~~~
139
140 Open the REST interface and using the basic authentication, execute REST APIs for system info as:
141
142 http://localhost:8181/restconf/operational/cardinal-openflow:Devices
143
144 You should get the response code of the same as 200 OK with the following output as:
145
146 ::
147
148     {
149         "Devices": {
150             "openflow": [
151                 {
152                     "macAddress": "6a:80:ef:06:d3:46",
153                     "status": "Connected",
154                     "flowStats": " ",
155                     "interface": "s1",
156                     "manufacturer": "Nicira, Inc.",
157                     "nodeName": "openflow:1:LOCAL",
158                     "meterStats": " "
159                 },
160                 {
161                     "macAddress": "32:56:c7:41:5d:9a",
162                     "status": "Connected",
163                     "flowStats": " ",
164                     "interface": "s2-eth2",
165                     "manufacturer": "Nicira, Inc.",
166                     "nodeName": "openflow:2:2",
167                     "meterStats": " "
168                 },
169                 {
170                     "macAddress": "36:a8:3b:fe:e2:21",
171                     "status": "Connected",
172                     "flowStats": " ",
173                     "interface": "s3-eth1",
174                     "manufacturer": "Nicira, Inc.",
175                     "nodeName": "openflow:3:1",
176                     "meterStats": " "
177                 }
178             ]
179         }
180     }
181
182
183 Configuration for Netconf Devices:-
184
185 1. To configure or update a netconf-connector via topology you need to send following request to Restconf:
186
187 ::
188
189     Method: PUT
190     URI: http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device
191     Headers:
192     Accept: application/xml
193     Content-Type: application/xml
194
195 Payload:
196
197 .. code-block:: xml
198
199     <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
200       <node-id>new-netconf-device</node-id>
201       <host xmlns="urn:opendaylight:netconf-node-topology">127.0.0.1</host>
202       <port xmlns="urn:opendaylight:netconf-node-topology">17830</port>
203       <username xmlns="urn:opendaylight:netconf-node-topology">admin</username>
204       <password xmlns="urn:opendaylight:netconf-node-topology">admin</password>
205       <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
206       <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">0</keepalive-delay>
207     </node>
208
209 2. To delete a netconf connector issue a DELETE request to the following url:
210 URI:http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device
211
212 NetConf Info Apis
213 Open the REST interface and using the basic authentication, execute REST APIs for system info as:
214
215 http://localhost:8181/restconf/operational/cardinal-netconf:Devices
216
217 You should get the response code of the same as 200 OK with the following output as:
218
219 ::
220
221     {
222         "Devices": {
223             "netconf": [
224                 {
225                     "status": "connecting",
226                     "host": "127.0.0.1",
227                     "nodeId": "new-netconf-device1",
228                     "port": "17830"
229                 },
230                 {
231                     "status": "connecting",
232                     "host": "127.0.0.1",
233                     "nodeId": "new-netconf-device",
234                     "port": "17830"
235                 },
236                 {
237                     "status": "connecting",
238                     "host": "127.0.0.1",
239                     "nodeId": "controller-config",
240                     "port": "1830"
241                 }
242             ]
243         }
244     }