Required equipment's


Telemetry


Telemetry is the automatic recording and transmission of data from remote or inaccessible sources to an IT system in a different location for monitoring and analysis.

Telemetry Components


Steps to build code 


Steps to flash image


Xconf server


Define Environments   

                 URL : http://35.155.171.121:9093/admin/ux/#/environment/all
                 Flow : Xconf-server -> Common -> Environments

                           

Define Models 

                            URL : http://35.155.171.121:9093/admin/ux/#/model/all
                            Flow : Xconf-server -> Common -> Models

                           

Define MAC List

                         URL : http://35.155.171.121:9093/admin/ux/#/namespacedlist/MAC_LIST
                         Flow : Xconf-server -> Common -> MAC Lists -> Select the Id -> Add your MAC                            

Configuring Telemetry on Xconf server


Log upload

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Flow

Xconf-server ->DCM -> Formulas -> Create

Name

<Unique name  for log upload >

Description

<Enter a short description>

Percentage

100

Priority

4

Build condition

estbMacAddress is <MAC-Address> 

               Sample 

              
              

          

Telemetry

Defining Telemetry profile

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Path

Xconf-server-> Telemetry->Permanent Profiles -> Create

                Sample :
               

               

Create Targeting rule 

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Path

Xconf-server-> Telemetry->Targeting rule -> Create

  1. Give the Unique rule name
  2. Select the rule. Here , used estbMacAddress as the rule
  3. Select the Bound profile (Telemetry Permanent Profile Name)

         Sample

    

Test Page

URL

http://35.155.171.121:9093/admin/ux/#/formulas/all

Path

Xconf-server-> Telemetry->Test Page

  1. To test whether the configured profile details are retrieved properly from xconf-server
  2. Give the rule specified in “Targeting Rule” section i.e., estbMacAddress here   

       Sample:

       

Configuring Telemetry on Raspberry pi


LOG_SERVER=35.155.171.121

DCM_LOG_SERVER=http://35.155.171.121/xconf/logupload.php

DCM_LOG_SERVER_URL=http://35.155.171.121:9092/loguploader/getSettings

DCM_SCP_SERVER=35.155.171.121

DCM_HTTP_SERVER_URL=http://35.155.171.121/xconf/telemetry_upload.php

DCM_LA_SERVER_URL=http://35.155.171.121/xconf/logupload.php

1.  CURL

Sample: 1  TFTP

root@RaspberryPi-Gateway:~# ifconfig erouter0
erouter0  Link encap:Ethernet  HWaddr B8:27:EB:22:16:36
          inet addr:192.168.30.125  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe22:1636/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18748 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3081 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2614475 (2.4 MiB)  TX bytes:590848 (577.0 KiB)

root@RaspberryPi-Gateway:~# curl -i 'http://35.155.171.121:9092/loguploader/getSettings?estbMacAddress=B8:27:EB:22:16:36'
HTTP/1.1 200 OK

Date: Fri, 31 Jan 2020 10:59:09 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(9.2.1.v20140609)

{"urn:settings:GroupName":"RDKB_telemetry","urn:settings:CheckOnReboot":true,"urn:settings:CheckSchedule:cron":"2 1 2 1 1","urn:settings:CheckSchedule:DurationMinutes":0,"urn:settings:LogUploadSettings:Message":null,"urn:settings:LogUploadSettings:Name":"RDKB_telemetry","urn:settings:LogUploadSettings:NumberOfDays":0,"urn:settings:LogUploadSettings:UploadRepositoryName":"RDKB_telemetry","urn:settings:LogUploadSettings:RepositoryURL":"tftp://35.155.171.121","urn:settings:LogUploadSettings:UploadOnReboot":true,"urn:settings:LogUploadSettings:UploadImmediately":false,"urn:settings:LogUploadSettings:upload":true,"urn:settings:LogUploadSettings:UploadSchedule:cron":"2 1 1 1 1","urn:settings:LogUploadSettings:UploadSchedule:levelone:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:leveltwo:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:levelthree:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:DurationMinutes":0,"urn:settings:VODSettings:Name":null,"urn:settings:VODSettings:LocationsURL":null,"urn:settings:VODSettings:SRMIPList":null,"urn:settings:TelemetryProfile":{"id":"72ac2ca9-b248-4a5e-b120-27ff37382564","telemetryProfile":[{"header":"Firewall","content":"starting firewall service","type":"FirewallDebug.txt","pollingFrequency":"1"}],"schedule":"3","expires":0,"telemetryProfile:name":"RDKB_tele","uploadRepository:URL":"35.155.171.121","uploadRepository:uploadProtocol":"TFTP"}}

Sample: 2  HTTP

root@RaspberryPi-Gateway:~# curl -i 'http://35.155.171.121:9092/loguploader/getSettings?estbMacAddress=B8:27:EB:22:16:36'
HTTP/1.1 200 OK

Date: Fri, 31 Jan 2020 12:15:26 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(9.2.1.v20140609)

{"urn:settings:GroupName":"RDKB_telemetry","urn:settings:CheckOnReboot":true,"urn:settings:CheckSchedule:cron":"2 1 2 1 1","urn:settings:CheckSchedule:DurationMinutes":0,"urn:settings:LogUploadSettings:Message":null,"urn:settings:LogUploadSettings:Name":"RDKB_telemetry","urn:settings:LogUploadSettings:NumberOfDays":0,"urn:settings:LogUploadSettings:UploadRepositoryName":"RDKB_telemetry","urn:settings:LogUploadSettings:RepositoryURL":"http://35.155.171.121/xconf/logupload.php","urn:settings:LogUploadSettings:UploadOnReboot":true,"urn:settings:LogUploadSettings:UploadImmediately":false,"urn:settings:LogUploadSettings:upload":true,"urn:settings:LogUploadSettings:UploadSchedule:cron":"2 1 1 1 1","urn:settings:LogUploadSettings:UploadSchedule:levelone:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:leveltwo:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:levelthree:cron":null,"urn:settings:LogUploadSettings:UploadSchedule:DurationMinutes":0,"urn:settings:VODSettings:Name":null,"urn:settings:VODSettings:LocationsURL":null,"urn:settings:VODSettings:SRMIPList":null,"urn:settings:TelemetryProfile":{"id":"72ac2ca9-b248-4a5e-b120-27ff37382564","telemetryProfile":[{"header":"Firewall","content":"starting firewall service","type":"FirewallDebug.txt","pollingFrequency":"1"}],"schedule":"3","expires":0,"telemetryProfile:name":"RDKB_tele","uploadRepository:URL":"http://35.155.171.121/xconf/telemetry_upload.php","uploadRepository:uploadProtocol":"HTTP"}}


2. Configuration file

 3. Logs

4. Xconf-Server

           HTTP   
          

Configuring more entries to a profile


                1. WIFI_MAC_2 with the profile name as “Wifihealth_1” and polling frequency as 1
                2. WIFI_BYTESSENTCLIENTS with the profile name as “Wifihealth_2” and polling frequency as 1

Observations :

Currently pushing the script from xconf to the target device is not possible due to the security issue , as it may lead to downloading the licensed file to the vulnerable device. The pushing may also lead to removal of file from rootfs , so this is not advised to do for now. Whereas , we can initiate the download from device through tftp/curl command either from the script or from console.

 Target type is provided to handle dynamic parameters change . We have 4 target types .

         1.  # 0 if as part of normal execution

         2.  # 1 if initiated due to an XCONF update

        3.  # 2 if forced execution before log upload

        4.  # 3 if modify the cron schedule 

During boot-up or service start , target type update will be initiated .

On each initiation , Whenever it finds the markers in the log files , it provides the search results with marker details , when it doesn't find , it just provides the basic RDKB profile details(without markers). It all depends on the markers availability in the log files.

Currently Type 1 and 2 are supported .

On having the Schedule type in DCM either as "ActNow" or "CronExpression" , with the expression in schedule under telemetry profile . JSON messages are seen with generic RDKB profile details on every 5 min / 10 mins (Expression : /5 * * * *  or */10 * * * * ) . Once in a day uploads JSON with markers to the server .

This is seen due to the schedule expression . As a workaround , we can give the schedule in numbers (Example : 2 / 5 / 10)

The ticket is in place to implement the cron expression support in RPi. Once it is in place , the empty JSON messages will not be seen .