Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
app-notes:status-sdk-influxdb [2023/10/31 14:43] – [Configuration] dodenhoeftapp-notes:status-sdk-influxdb [2024/01/29 13:01] (current) – [status2influx script] dodenhoeft
Line 1: Line 1:
-====== Status via SDK to InfluxDB ======+====== Status to InfluxDB ======
  
 This Wiki Page describes how to use our SDK functionality to monitor current status value into external Database(influxdb). It allows you to get more connectivtiy into you network infrastructor. This can be used for all netmodule routers. This Wiki Page describes how to use our SDK functionality to monitor current status value into external Database(influxdb). It allows you to get more connectivtiy into you network infrastructor. This can be used for all netmodule routers.
Line 10: Line 10:
   * NetModule Wireless Router with any WAN connection   * NetModule Wireless Router with any WAN connection
   * NRSW [[http://share.netmodule.com/public/system-software/4.8/4.8.0.101/|4.8.0.101]] or newer   * NRSW [[http://share.netmodule.com/public/system-software/4.8/4.8.0.101/|4.8.0.101]] or newer
 +  * Not available for legacy products NB1600, NB2700, NB3700, NB3710
  
 ===== Concept ===== ===== Concept =====
 +{{:app-notes:concept_td.png?800|}}
  
-There are a few concepts to write data to the external influxdb. For this usecase we are using HTTP request to the REST-API and the line protocol by influxdb. The data value get attached on the HEADER of the HTTP request and will get protected with TLS/SSL certificate.+Netmodule routers provide several service status values via cli. We are going to send those informations to the external influxdb. For this usecase we want to use the REST-API and the line protocol by influxdb. Our SDK functionality has different kind of netmodule specific functions to do HTTP request. The status value can attached to the HEADER of the HTTP request and going to get send via TLS/SSL connection to the database. 
 + 
 +===== SDK scripting ===== 
 +All information about SDK can be found [[sdk:sdk|here]]
  
 ===== InfluxDB ===== ===== InfluxDB =====
Line 41: Line 46:
 ==== Netmodule router ==== ==== Netmodule router ====
 === 1. Allow https connections === === 1. Allow https connections ===
-Netmodule routers do not allow https connections by default. Therefor you need to upload the Root CA R3 chain from the influxdb SSL Certificate. You can easily download the cert chain with the following steps:+To send the data via TLS/SSL we need to add the domian certifcate to the netmodule router. Therefor you need to upload the Root CA R3 chain from the influxdb SSL Certificate. You can easily download the cert chain with the following steps:
  
 {{:app-notes:cert-influx.gif?1000|}} {{:app-notes:cert-influx.gif?1000|}}
Line 60: Line 65:
  
 ==== status2influx script ==== ==== status2influx script ====
- 
 <code c status2influx.are> <code c status2influx.are>
 */ DESC: This script is sendinf the current cli WWAN infos to a external InfluxDB */ DESC: This script is sendinf the current cli WWAN infos to a external InfluxDB
 *  created by [TD] 24.9.2023 *  created by [TD] 24.9.2023
-*Copyright (C) 2013-2022) NetModule AG, Switzerland+ Copyright (C) (2013-2024) NetModule AG, Switzerland 
 +*/
  
 url = "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/write?org=01ad2d78e27c0e0d&bucket=netmodule&precision=ns"; url = "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/write?org=01ad2d78e27c0e0d&bucket=netmodule&precision=ns";
Line 79: Line 84:
  
  
-//define header with text/plain WORKS+//define header with valid influx API Token
 header = "Authorization: Token XansFOeVPLFvPkfGiboGW7RvXwaio1WmjodVklcbtOJPumgqH5KGhIQyHQuMlflL72bWk27liAybzE2EhA3ksQ=="; header = "Authorization: Token XansFOeVPLFvPkfGiboGW7RvXwaio1WmjodVklcbtOJPumgqH5KGhIQyHQuMlflL72bWk27liAybzE2EhA3ksQ==";