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