The TSDRKey format indicates the NodeID(NID), DataCategory(DC), and RecordKey(RK) of the monitored objects.
For example, the following is a valid tsdrkey:
[NID=openflow:1][DC=NETFLOW][RK]
The query will return only the first 1000 records that match the query criteria.
from=<time_in_seconds>
until=<time_in_seconds>
The following is an example curl command for querying log type of data
from TSDR data store:
curl -G -v -H “Accept: application/json” -H “Content-Type:
application/json” “http://localhost:8181/tsdr/logs/query”
–data-urlencode “tsdrkey=[NID=][DC=NETFLOW][RK=]” –data-urlencode
“from=0” –data-urlencode “until=240000000000”|more
Grafana integration with TSDR
TSDR provides northbound integration with Grafana time series data
visualization tool. All the metric type of data stored in TSDR data
store can be visualized using Grafana.
For the detailed instruction about how to install and configure Grafana
to work with TSDR, please refer to the following link:
https://wiki.opendaylight.org/view/Grafana_Integration_with_TSDR_Step-by-Step
Configuring TSDR Data Collectors
SNMP Data Collector Device Credential Configuration (experimental)
After installing SNMP Data Collector, a configuration file under etc/
directory of ODL distribution is generated: etc/tsdr.snmp.cfg is
created.
The following is a sample tsdr.snmp.cfg file:
credentials=[192.168.0.2,public],[192.168.0.3,public]
The above credentials indicate that TSDR SNMP Collector is going to
connect to two devices. The IPAddress and Read community string of these
two devices are (192.168.0.2, public), and (192.168.0.3) respectively.
The user can make changes to this configuration file any time during
runtime. The configuration will be picked up by TSDR in the next cycle
of data collection.
Polling interval configuration for SNMP Collector and OpenFlow Stats Collector
The default polling interval of SNMP Collector and OpenFlow Stats
Collector is 30 seconds and 15 seconds respectively. The user can change
the polling interval through restconf APIs at any time. The new polling
interval will be picked up by TSDR in the next collection cycle.
Retrieve Polling Interval API for SNMP Collector
http://localhost:8181/restconf/config/tsdr-snmp-data-collector:TSDRSnmpDataCollectorConfig
Verb: GET
Update Polling Interval API for SNMP Collector
http://localhost:8181/restconf/operations/tsdr-snmp-data-collector:setPollingInterval
Verb: POST
Content Type: application/json
Input Payload:
"input": {
"interval": "15000"
http://localhost:8181/restconf/config/tsdr-openflow-statistics-collector:TSDROSCConfig
Verb: GET
Update Polling Interval API for OpenFlowStats Collector
http://localhost:8181/restconf/operations/tsdr-openflow-statistics-collector:setPollingInterval
Verb: POST
Content Type: application/json
Input Payload:
"input": {
"interval": "15000"
Purging Service configuration
After the data stores are installed from Karaf console, the purging
service will be installed as well. A configuration file called
tsdr.data.purge.cfg will be generated under etc/ directory of ODL
distribution.
The following is the sample default content of the tsdr.data.purge.cfg
file:
host=127.0.0.1 data_purge_enabled=true data_purge_time=23:59:59
data_purge_interval_in_minutes=1440 retention_time_in_hours=168
The host indicates the IPAddress of the data store. In the case when the
data store is together with ODL controller, 127.0.0.1 should be the
right value for the host IP. The other attributes are self-explained.
The user can change those attributes at any time. The configuration
change will be picked up right away by TSDR Purging service at runtime.
How to use TSDR to collect, store, and view OpenFlow Interface Statistics
Overview
This tutorial describes an example of using TSDR to collect, store, and
view one type of time series data in OpenDaylight environment.
Prerequisites
You would need to have the following as prerequisits:
One or multiple OpenFlow enabled switches. Alternatively, you can use
mininet to simulate such a switch.
Successfully installed OpenDaylight Controller.
Successfully installed HBase Data Store following TSDR HBase Data
Store Installation Guide.
Connect the OpenFlow enabled switch(es) to OpenDaylight Controller.
Target Environment
HBase data store is only supported in Linux operation system.
Instructions
Start OpenDaylight.
Connect OpenFlow enabled switch(es) to the controller.
If using mininet, run the following commands from mininet command
line:
mn –topo single,3 –controller
remote,ip=172.17.252.210,port=6653 –switch
ovsk,protocols=OpenFlow13
Install OpenFlow Statistics Collector from Karaf:
feature:install odl-tsdr-openflow-statistics-collector
run the following command from Karaf console:
tsdr:list PORTSTATS
You should be able to see the interface statistics of the switch(es)
from the HBase Data Store. If there are too many rows, you can use
“tsdr:list InterfaceStats|more” to view it page by page.
By tabbing after “tsdr:list”, you will see all the supported data
categories. For example, “tsdr:list FlowStats” will output the Flow
statistics data collected from the switch(es).
Troubleshooting
Karaf logs
All TSDR features and components write logging information including
information messages, warnings, errors and debug messages into
karaf.log.
HBase and Cassandra logs
For HBase and Cassandra data stores, the database level logs are written
into HBase log and Cassandra logs.
HBase log
HBase log is under <HBase-installation-directory>/logs/.
Cassandra log
Cassandra log is under {cassandra.logdir}/system.log. The default
{cassandra.logdir} is /var/log/cassandra/.
Security
TSDR gets the data from a variety of sources, which can be secured in
different ways.
OpenFlow Security
The OpenFlow data can be configured with Transport Layer Security
(TLS) since the OpenFlow Plugin that TSDR depends on provides this
security support.
NetFlow Security
NetFlow, which cannot be configured with security so we recommend
making sure it flows only over a secured management network.
Syslog Security
Syslog, which cannot be configured with security so we recommend
making sure it flows only over a secured management network.
SNMP Security
The SNMP version3 has security support. However, since ODL SNMP
Plugin that TSDR depends on does not support version 3, we (TSDR)
will not have security support at this moment.
sFlow Security
The sflow has security support.
Support multiple data stores simultaneously at runtime
TSDR supports running multiple data stores simultaneously at runtim. For
example, it is possible to configure TSDR to push log type of data into
Cassandra data store, while pushing metrics type of data into HBase.
When you install one TSDR data store from karaf console, such as using
feature:install odl-tsdr-hsqldb, a properties file will be generated
under <Karaf-distribution-directory>/etc/. For example, when you install
hsqldb, a file called tsdr-persistence-hsqldb.properties is generated
under that directory.
By default, all the types of data are supported in the data store. For
example, the default content of tsdr-persistence-hsqldb.properties is as
follows:
metric-persistency=true
log-persistency=true
binary-persistency=true
When the user would like to use different data stores to support
different types of data, he/she could enable or disable a particular
type of data persistence in the data stores by configuring the
properties file accordingly.
For example, if the user would like to store the log type of data in
HBase, and store the metric and binary type of data in Cassandra, he/she
needs to install both hbase and cassandra data stores from Karaf
console. Then the user needs to modify the properties file under
<Karaf-distribution-directory>/etc as follows:
tsdr-persistence-hbase.properties
metric-persistency=false
log-persistency=true
binary-persistency=true
tsdr-persistence-cassandra.properties
metric-psersistency=true
log-persistency=false
binary-persistency=false