{% extends "base.html.twig" %} {% block title %}Device agents{% endblock %} {% block body %}

Device agents


Getting the correct device agent

To connect a device to the DWARFG_LONG server, you need to install an agent on the device. There are a few ways how to install an agent on a device:

  • Install agent on one device manually using device's web-interface.
  • Install agent on one device manually using device's command line.
  • Install (multiple) agents on multiple devices of any type in automated fasion using automated install from server command line or a dedicated Linux machine/VM command line. See below on more details.

For manual installation, you will need to download the correct agent. DWARFG_LONG version 1.0 supports following device types:

  • Advantech cellular routers - a full featured device agent with automatic start, integration into device web interface and widest feature range.
  • Teltonika cellular routers - device agent with automatic start, providing monitoring and alerting functionality. No integration in device web pages. Installation is via command line (both as system package and from tar.gz archive).
  • OpenWRT devices - device agent with automatic start, providing monitoring and alerting functionality. No integration in device web pages. All installation methods supported.
  • Generic Linux-based devices - device agent with automatic start (both Systemd and SysV Init supported), providing most functionality including Webtunnels (if device runs local web pages). Installation is via command line.

You absolutely need to install the correct agent type on a device.

Also, you cannot use agent archive package downloaded from one server to connect a device to another server because the package does contains Server ID, that is generated during the DWARFG_LONG server deployment.

In case you managed to install incorrect agent type by mistake, you need to first stop all the agent processes and manually wipe the /opt/aDWARFG_SHORT directory before attempting reinstallation of the correct agent package. Depending on the stage of installation, you may have the uninstall.sh script generated to use, or ability to run package manager tool (umupdate for Advantech routers or opkg for Teltonika/OpenWRT). Once done, check there are no running processes and manually wipe the agent directory if still present after uninstallation attempt prior any reinstallation attempt. If you are unsure that all agent processes are stopped, simply restart the device before manually wiping the /opt/aDWARFG_SHORT directory. Alternatively, you may run the auto-deployment tool as that will automatically take care of uninstallation for you.

Automated Agent Installation

If you need to install agent on many devices, you should consider using the AAD tool.

  • To use the tool from a Linux box, download it from Donwload Agents -> View All Downloads from the top menu.
  • To use the tool from the server commandline, login to the server commandline, change directory to your Dwarfguar deployment (/opt/DWARFG_SHORT_<domain>) and execute push_agent.py.
  • Tool options are described online or presented in a video

Agent installation details

  • Advantech cellular router agent - is distributed in the form of package, that installs like any other RouterApp / User Module - simply select the web UI menu User Modules, click on Select File, locate the package downloaded from DWARFG_LONG and confirm via Add or Update
  • Linux agent - distributed as a self-contained script with README file. Unpack the archive and run the script (agent) from command line. All required directories and system startup installation will be performed by the agent itself.
  • Teltonika agent - distributed in the form of IPK package (native RutOS package). As the agent is a 3rd-party package (not provided by Teltonika company), the web-based installation is not allowed. You need to copy the IPK package via ssh/scp/rsync and use the opkg command line tool to install the agent. The agent requires curl that is not installed on RutOS by default, but will be installed as a dependency during agent installation. You may also opt to install the agent from the archive (as opposed to an IPK package). This way, you would need to install the curl manually (be it in the form of package or from the sources). For WebTunnel to work on Teltonika device, you also need to install a fully-featured ssh client. The RutOS default ssh client (Dropbear) is not able to establish tunnel properly.
  • OpenWRT agent - distributed in the form of IPK package (native OpenWRT package). You can install the package via router web interface or using command line tool opkg. The agent requires curl that is not installed on OpenWRT OS by default, but will be installed as a dependency during agent installation. You may also opt to install the agent from the archive (as opposed to an IPK package). This way, you would need to install the curl manually (be it in the form of package or from the sources). For WebTunnel to work on OpenWRT device, you also need to install a fully-featured ssh client. The OpenWRT default ssh client (Dropbear) is not able to establish tunnel properly.

Using agent

Once installed, agent automatically registers at the defined server and starts sending the required data and generally performing it's job.

In general, there are only few use cases for accessing the agent on a device directly. Some useful information is exposed via local web interface (if provided by the agent in question) and also some actions can be executed directly via the interface for convenience. For device agents that do not have the local web interface, local inspection/configuration is still possible. The following files under the /opt/aDWARFG_SHORT can be viewed or edited on the device, but please note that breaking the file may render the agent non-functional:

  • global_log.txt ... contains all global logging messages from all agents run.
  • server.ini ... contains server address. Do not change manually unless you moved the server to another URL.
  • settings.ini ... contains agent settings. Some of these are updated from server based on which agent profile is assigned to the device. You can see device DevID inside g_devid variable (never change this!) and if your server's certificate has changed, you can set the g_security=1 to allow certificate refresh on agent. Setting g_security=0 will disable the certificate check (but the communication will stay encrypted via HTTPS).

{% endblock body %}