Server Monitoring Client
Track system metrics from Thinger.io Platform
The Linux Monitoring Client is a software module based on the Thinger.io Linux Client that keeps track of different system metrics, and publishes them to the Thinger.io Platform in order to keep track of a server or an embedded Linux device or a fleet of them.
The client tracks different metrics for System Information as well as for six different types of resources: general system information, CPU, system memory, network interfaces, filesystem mount points, and I/O drives.
Apart from uploading the resource information to Thinger.io Platform, the resources can be queried directly to the client or from the local server running the client at http://localhost:7890/monitor
There is some system information that can be relevant from a server administration standpoint.
Currently, the metrics the client is retrieving are:
- OS version
- Quantity of normal and security updates (Ubuntu server)
- If a reboot is required to apply updates (Ubuntu server)
To evaluate the performance of the CPU, the following metrics are tracked:
- Number of cores
- CPU usage
- CPU load for 1m, 5m and 15m
As having reliable information about the system memory used is vital for capacity planning and maintaining the integrity of your servers, the following metrics are collected:
- Total, used and available memory capacity
- Memory usage
- Total, used and available swap memory capacity
- Swap memory usage
For each network interface the following is tracked:
- Internal/Private IP
- Incoming and Outgoing network speed
- Incoming and Outgoing total network transfer
It will also retrieve the public IP of the server.
Each filesystem corresponds to one partition of a drive, from which it will track:
- Capacity free
- Capacity used
- Capacity usage (percentage)
To provide insight on how a server is performing, the following I/O drive metrics are monitored:
- Input and Output operation speed
- Disk usage
The basic device configuration is tracked over a JSON file located in the server. Additional configurations are tracked trough the device properties to allow live configuration changes through the Thinger.io Platform.
The configuration will be auto created on first launch when it is auto provisioned.
The file structure is as follows:
If launched with root, the default path for the configuration file is: /etc/thinger_io/monitor/app.json
If launched with non-root, the default path for the configuration file is: /home/<user>/.config/thinger_io
As mentioned before, the configuration for the resources will be in the device properties.
It contains five sections:
- defaults: boolean value indicating whether the name of the first element of each resource will have a default name instead of the resource name. Useful when tracking different devices with one dashboard.
- interfaces: JSON array with the name of the network interfaces to track.
- filesystems: JSON array with the mount point of the partitions to track.
- drives: JSON array with the Linux devices to track.
- server: Object containing the host IP to listen in and port to launch the local server.
Here is an example
This module has the feature to auto provision the device in the Thinger.io Platform, but also allows to input a configuration if it's already provisioned.
It is also capable of creating a system service so the monitor is always running regarding if the server has been rebooted.
./install_thinger_monitor.sh -t '<create_device token>'
For update and reboot abilities it needs to be run with root user
If the device is already provisioned, we will need to set the user id, device id and credentials in the configuration file and launch the software as:
./thinger_monitor [-c <config file path>]
If the operating system is not Ubuntu or OpenSSL is installed in a different folder than default, it is neccesary to indicate the certificates directory by declaring the variable SSL_CERT_DIR before calling the installer or the binary: