All Projects → wlanslovenija → nodewatcher-agent

wlanslovenija / nodewatcher-agent

Licence: Unknown, AGPL-3.0 licenses found Licenses found Unknown LICENSE AGPL-3.0 COPYING
A monitoring agent that runs on OpenWrt-supported devices.

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to nodewatcher-agent

TG799VAC-XTREME-17.2-MINT
My personal unique wiki for hacking the router firmware used by (Telia)TG799vac Xtream v17.2-MINT delivered from Technicolor
Stars: ✭ 71 (+407.14%)
Mutual labels:  openwrt, uci
firmware-core
nodewatcher firmware.
Stars: ✭ 26 (+85.71%)
Mutual labels:  openwrt, nodewatcher
go-uci
Native Go bindings for OpenWrt's UCI.
Stars: ✭ 69 (+392.86%)
Mutual labels:  openwrt, uci
scal
System Configuration Abstraction Layer
Stars: ✭ 14 (+0%)
Mutual labels:  openwrt, ubus
SAGEMCOM-FAST-5370e-TELIA
This is my personal wiki for hacking the router firmware used by (Sagemcom)F@st Version 3.43.2 delivered from Sagemcom
Stars: ✭ 92 (+557.14%)
Mutual labels:  openwrt, uci
saklarku
Aplikasi mobile remote control untuk mengendalikan saklar/relay yang terhubung dengan port LED/GPIO di router berbasis OpenWRT
Stars: ✭ 20 (+42.86%)
Mutual labels:  openwrt
lede-dockercompiler
Docker image to compile LEDE/OpenWrt from source
Stars: ✭ 21 (+50%)
Mutual labels:  openwrt
openipc.github.io
Alternative IP Camera firmware from an open community, http://openipc.org site source code
Stars: ✭ 28 (+100%)
Mutual labels:  openwrt
ct-frontend
Frontend Demo for Cucumber Tony API
Stars: ✭ 20 (+42.86%)
Mutual labels:  openwrt
openwrt
A custom ROM for IPQ40xx (currently: EA6350v3, MR8300, EA8300, GL-S1300, and GL-B1300) with several modifications and many annoyances fixed.
Stars: ✭ 58 (+314.29%)
Mutual labels:  openwrt
kokopu
A JavaScript/TypeScript library implementing the chess game rules and providing tools to read/write the standard chess file formats.
Stars: ✭ 18 (+28.57%)
Mutual labels:  uci
docker-openwrt-builder
A Docker container to build OpenWrt images
Stars: ✭ 98 (+600%)
Mutual labels:  openwrt
owrtwifi2mqtt
Using your OpenWRT Router's Wifi to detect if a person's smartphone is still in/near the apartment and publish via MQTT
Stars: ✭ 70 (+400%)
Mutual labels:  openwrt
owbot
OpenWrt Telegram Bot
Stars: ✭ 26 (+85.71%)
Mutual labels:  openwrt
NueXini Packages
Packages for OpenWrt【每日更新luci-app OpenWrt Packages】
Stars: ✭ 269 (+1821.43%)
Mutual labels:  openwrt
khadas-openwrt
openwrt for Khadas boards
Stars: ✭ 25 (+78.57%)
Mutual labels:  openwrt
wrt-hisicam
OpenWrt based HiSilicon`s System-On-a-Chip ip camera firmware
Stars: ✭ 21 (+50%)
Mutual labels:  openwrt
openwrt-tailscale-enabler
Brings Tailscale to low powered OpenWRT devices
Stars: ✭ 409 (+2821.43%)
Mutual labels:  openwrt
amlogic-s9xxx-openwrt
OpenWrt for Amlogic and Rockchip. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, rk3588, rk3568, rk3288, etc. including install to EMMC and update related functions.
Stars: ✭ 724 (+5071.43%)
Mutual labels:  openwrt
TzumiMagicTV-RTLSDR
Working with the 13 dollar Tzumi MagicTV.
Stars: ✭ 38 (+171.43%)
Mutual labels:  openwrt

nodewatcher-agent

Nodewatcher agent is a monitoring agent that runs on OpenWrt-supported devices and can provide various telemetry information to the nodewatcher monitor daemon via HTTP.

Configuration

The agent may be configured via UCI. An example configuration, also used by the provided OpenWrt package, which should be placed under /etc/config/nodewatcher follows below:

config agent
  option output_json '/www/nodewatcher/feed'

Currently, the only option is to configure where the JSON output feed should be placed. By default, no output feed is generated and nodewatcher agent data is only accessible via the ubus API.

ubus API

The nodewatcher agent exposes an API via ubus so other applications can access its data feeds. It registers itself under the nodewatcher.agent identifier. Currently the only supported method is get_data which can be used as follows:

$ ubus call nodewatcher.agent get_data
{
  ...
  // Returns data feed in the format described below

The method accepts a single parameter called module which can be used to limit the output to a specific module as follows:

$ ubus call nodewatcher.agent get_data "{ 'module': 'core.general' }"

Monitoring report format

To output monitoring data, JSON format is used as in the following example:

{
  // Each module outputs a section that has the module name as the section key.
  'core.general': {
    // Inside the section a special _meta section is always present, giving
    // some metadata about the module. Currently, the only metadata is the
    // module's version number.
    '_meta': {
      'version': 4
    },
    // Additional sections are module-dependent and contain monitoring data.
    'uuid': '64840ad9-aac1-4494-b4d1-9de5d8cbedd9',
    'hostname': 'test-4',
    'version': 'git.12f427d',
    'kernel': '3.10.36',
    'local_time': 1401093621,
    'uptime': 4612,
    'hardware': {
      'board': 'tl-wr741nd-v4',
      'model': 'TP-Link TL-WR740N/ND v4'
    }
  }
}

All float values are encoded as strings due to the fact that ubus message blobs do not currently support serialization of float/double types.

HTTP push support

The agent can also be configured to perform periodic push of monitoring data by using HTTP POST requests. This functionality is implemented in the http_push module which must be enabled for this to be available. The use of this module requires libcurl to be installed.

After enabling the module, the following additional options may be specified via UCI:

config agent
  # ...

  # Push URL.
  option push_url 'https://host/push/http/64840ad9-aac1-4494-b4d1-9de5d8cbedd9'
  # Push interval in seconds.
  option push_interval '120'
  # Path to server-side public key for authenticating the server.
  option push_server_pubkey '/etc/crypto/public_key/server'

Push is performed via a single HTTP POST request to the specified URL where the body contains the same JSON-formatted document as is used for reports.

Modules

The agent is fully modular, with all reporting functionality being implemented in modules which are loaded as shared library plugins. On startup modules are automatically discovered from /usr/lib/nodewatcher-agent. Currently the following modules are implemented:

  • core.general provides general information about the running system such as the node's uuid, hostname, kernel and firmware versions, etc.
  • core.resources provides system resource usage information such as the amount of memory used, the number and type of running processes, load averages, CPU usage and number of tracker connections.
  • core.interfaces reports status and statistics for network interfaces configured via UCI.
  • core.wireless provides additional information for wireless interfaces.
  • core.keys.ssh provides information about the node's host SSH keys.
  • core.clients provides information about the clients currently connected with the node, obtained from DHCP leases file.
  • core.push.http enables periodic push of JSON data to a remote nodewatcher server.
  • core.routing.babel provides information about the node's Babel routing daemon.
  • core.routing.olsr provides information about the node's OLSR routing daemon.
  • core.meshpoint provides information about the Cilab MeshPoint node's built-in sensors.

Development setup

To build the master version of nodewatcher agent package a buildroot needs to be set up. It can either be built from OpenWrt source or a precompiled OpenWrt SDK can be used. This example uses 18.06.1 version of OpenWrt, ipq40xx target and its SDK. For latest version OpenWrt download page should be checked.:

curl -O https://downloads.openwrt.org/releases/18.06.1/targets/ipq40xx/generic/openwrt-sdk-18.06.1-ipq40xx_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz
tar xvf openwrt-sdk-18.06.1-ipq40xx_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz
cd openwrt-sdk-18.06.1-ipq40xx_gcc-7.3.0_musl_eabi.Linux-x86_64

Now you can either manually add Makefile localy or add a remote repository. In this example a remote repository is used.:

echo "src-git wlansi https://github.com/wlanslovenija/firmware-packages-opkg.git" >> feeds.conf.default
./scripts/feeds update -a
./scripts/feeds install nodewatcher-agent

You probably want to disable some default settings, which build every available package. Enter Global Build Settings and in the submenu, deselect/exclude the following options:

Select all target specific packages by default
Select all kernel module packages by default
Select all userspace packages by default

After that go to Base system and select Nodewatcher-agent and any modules you want. And simple make V=s will start building the package.

Installing packages

If building for an x86_64 architecture, a virtual machine can be used for development. You can acquire VMWare or Virtualbox images from OpenWrt download page. Once the VM is running, set the SSH password using passwd and change lan setting from static to dhcp using:

uci set network.lan.proto='dhcp'
uci commit
reboot

The built packages are located in bin/packages/. They need to be transferred to a target device or virtual machine and installed. The easiest way would be to set up a local network and transfer the packages using:

scp $filename [email protected]:/tmp

Once all the packages are on the target machine connect to it using SSH:

ssh [email protected]

Go to target directories and install packages using:

opkg install *.ipk

Troubleshooting

Troubleshoot connection issues with commands like uci show dropbear, cat /etc/passwd, cat /etc/shadow, logread, ip addr...

Source Code, Issue Tracker and Mailing List

For development Github issues is used, so you can see existing open tickets or open a new one there. Source code is available on GitHub.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].