The TeamViewer Embedded Log Parser Connector easily extracts & integrates sensor data from your log files.
The Log Parser Connector is generic, in that, it can be used to parse any log. For the context of this article, it is assumed your Embedded sensor values are written to a log file which you would like to connect to the TeamViewer Embedded Agent.
The setup contains two basic steps. Follow the sections in this article:
- Download and install the Log Parser Connector
- Integrate the Log Parser Connector with the TeamViewer Embedded Agent
For more information about configuration and syntax see Configuration and Syntax of the TeamViewer Log Parser Connector.
What you will need
Make sure that you have prepared the following points:
📌Note: Python 2 is not supported.
Download and install the Log Parser Connector
1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
2. Download the Log Parser Connector. In the terminal type in the following command and press return.
3. Upon completion of the download, extract the contents of the connector. In the terminal type in the following commands and press return:
sudo mkdir -p /usr/local/teamviewer-iot-agent/monitoring/
tar -xzvf teamviewer_iot_log_parser-1.0.0.tar.gz -C /usr/local/teamviewer-iot-agent/monitoring/
4. Install the Log Parser Connector. In the terminal type in the following command and press return.
cd teamviewer_iot_log_parser-1.0.0 python3 setup.py install
5. Verify the installation was successful by identifying a log file to parse and using the following command to parse a string. In the terminal type in the following command and press return. Replace
justTextorRegex with the path of your log file and a string to search for, respectively.
teamviewer_iot_log_parser -f logFilePath --regex justTextOrRegex
Integrate the Log Parser Connector with the TeamViewer Embedded Agent
The TeamViewer Embedded Agent includes its own system monitoring configuration file. This configuration file will be extended to include the Log Parser configuration.
📌Note: Before editing files mentioned in this task create a backup. Use the backups in case of a corrupted system or data.
For each sensor you want to integrate, append its registration information to the configuration file. Reference the Log Parser Connector Template or the Examples and replace the placeholders with your sensor details.
1. To modify the configuration file open the file with nano:
2. Modify the configuration file as needed.
3. Save the file and exit nano.
4. Restart the Embedded Agent to reload the configuration file. In the terminal type in the following command and press return.
5. To log in to the Embedded Management Console, open https://iot.teamviewer.com/ and use your TeamViewer account credentials.
6. From the left menu select Dashboard.
7. Verify that the Sensors/Metrics added to the configuration file now appear on your Metrics tab.
8. Use a Widget to pin the metrics to your dashboard and ensure the data is being updated per the frequency specified in the config file.