If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.

0
U

Property:monitor.lua

From BoxMatrix
(Redirected from monitor.lua)


BoxMatrix >> Webinterface >> monitor.lua @ BoxMatrix   -   IRC-Chat   -   Translate: de es fr it nl pl
News Selectors Models Accessories Components Environment Config Commands System Webif Software Develop Lexicon Community Project Media

UI-Structure UI-Modules HTML-Files XML-Files REST-API Lua-Scripts Javascript Browser SSI-Files SSI-Directives HTML-Text Event-Text Help-Pages CSS-Files Graphics Research

RESTAPI-Script

Goto:   Functions  -  Dependencies   -   Model-Matrix   -   SMW-Browser

Details

monitor.lua is the REST-API Plugin for the monitoring API. It is the glue to the rrd ui-module.

It is auto-included by api.lua, like all /usr/rest_api/plugins/*.lua scripts, and supports:

GET /api/v0/monitor/datasets                   # get the descriptions of the monitor datasets

GET /api/v0/monitor/macaddrs/subsetXXXX        # get the measurement data of a specific subset
GET /api/v0/monitor/nets/subsetXXXX            # get the measurement data of a specific subset
GET /api/v0/monitor/onlinemonitor/subsetXXXX   # get the measurement data of a specific subset

GET /api/v0/monitor/configuration/...          # get the configuration of the monitor

PUT /api/v0/monitor/...                        # put data from params and http body

There are 3 datasets, each representing a bunch of enumerated subsets:

  • macaddrs - one subset for each MAC address of all network neighbours in the LAN
  • nets - one subset for each subnet in the LAN (local, lan, guest)
  • onlinemonitor - one subset for each VLAN or PVC provided by the ISP

REST-API:

Functions

The function names of scripts often help to understand function blocks (and show gaps in the docs). fw 8.00 functions:

$ grep -e '^function' -e '^local function' /usr/rest_api/plugins/monitor.lua

# map the monitoring api status code to a rest api error
local function map_monitor_status_2_api_error(monitor_error)

# converts the datasource type in a api user friendly way
local function convert_datasource_type(ui_module_ds_type)

# Check if the given name is a valid monitor name
local function is_valid_monitor_name(name)

# Check if the given rrd-list item is valid for the rest api
local function is_valid_monitor(rrditem)

# Converts the subsets list from uimodule rrd to a more REST-API like data model
local function convert_to_external_subsetlist(subsets)

# Get the descriptions of the monitor datasets
# GET /api/v0/monitor/datasets
local function get_monitor_datasets()

# for each datasource build an object and append it to the datasubset list
local function post_process_monitor_measurements(monitor_data)

# Get the measurement data of the monitor for specific subset
# GET /api/v0/monitor/macaddrs/subset000X
local function get_monitor_measurements(monitorname, subset)

# get the configuration of the monitor
local function get_monitor_configuration(params)

# handles all GET-requests of the plugin
function plugin.get_data(params)

# handles all PUT-requests of the plugin
function plugin.put_data(params) 

Dependencies

Daily updated index of all dependencies of this script. Last update: GMT.
A * in the Mod column marks info from Supportdata-Probes, which will always stay incomplete.
If an Object includes itself then this is a file with the same name but another Path and the dependencies are merged.

Relation Typ Object Mod Firmware Info Origin
Requires lib libavmluautils.so 25 7.90 - 8.00 Utility Lua-Library AVM
Requires rest plugin_common.lua 24 7.90 - 8.00 REST-API Plugin helper functions AVM
Requires rest resource.lua 24 7.90 - 8.00 REST-API ResourceProperty Constructor representing one Webvariable AVM
Requires rest response.lua 25 7.90 - 8.00 REST-API Response API AVM
Requires rest rest_api_const.lua 25 7.90 - 8.00 REST-API Const Tables AVM
Requires rest string.lua 25 7.90 - 8.00 REST-API common extension of the Lua string module AVM
Requires rest uimod.lua (restapi) 25 7.90 - 8.00 REST-API UI-Modules API AVM
7 dependencies for this script

Model-Matrix

Daily updated index of the presence, path and size of this script for each model. Last update: GMT.
Showing all models using this script. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom/rtl) label in the Model column shows which CPU is meant for Multi-Linux models.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.

Model Firmware Path Size/Bytes
FRITZ!Box 4040 7.90 - 8.00 /usr/rest_api/plugins 14.4k
FRITZ!Box 4050 7.90 /usr/rest_api/plugins 14.3k
FRITZ!Box 4060 7.90 /usr/rest_api/plugins 14.4k
FRITZ!Box 5530 Fiber (main) 8.00 /usr/rest_api/plugins 14.3k
FRITZ!Box 5590 Fiber (main) 7.90 - 8.00 /usr/rest_api/plugins 14.4k
FRITZ!Box 5590 Fiber (prx) 7.90 - 8.00 /usr/rest_api/plugins 14.3k - 14.5k
FRITZ!Box 6591 Cable (arm) 8.00 /usr/rest_api/plugins 14.3k
FRITZ!Box 6591 Cable (atom) 7.90 /usr/rest_api/plugins 6.9k - 14.4k
FRITZ!Box 6660 Cable (arm) 7.90 - 8.00 /usr/rest_api/plugins 14.3k
FRITZ!Box 6660 Cable (atom) 7.90 /usr/rest_api/plugins 14.4k
FRITZ!Box 6670 Cable (arm) 7.90 /usr/rest_api/plugins 14.3k
FRITZ!Box 6670 Cable (atom) 7.90 /usr/rest_api/plugins 14.4k
FRITZ!Box 6690 Cable (arm) 7.90 /usr/rest_api/plugins 14.3k
FRITZ!Box 6690 Cable (atom) 7.90 /usr/rest_api/plugins 14.4k
FRITZ!Box 6850 5G 7.90 /usr/rest_api/plugins 14.4k
FRITZ!Box 6850 LTE 7.90 /usr/rest_api/plugins 14.4k
FRITZ!Box 7510 7.90 - 8.00 /usr/rest_api/plugins 14.3k
FRITZ!Box 7520 8.00 /usr/rest_api/plugins 14.4k
FRITZ!Box 7520 v2 (main) 7.90 - 8.00 /usr/rest_api/plugins 14.4k
FRITZ!Box 7530 7.90 - 8.00 /usr/rest_api/plugins 14.4k
FRITZ!Box 7530 AX 8.00 /usr/rest_api/plugins 14.4k
FRITZ!Box 7583 VDSL (main) 8.00 /usr/rest_api/plugins 14.3k
FRITZ!Box 7590 (main) 7.90 - 8.00 /usr/rest_api/plugins 6.9k - 14.3k
FRITZ!Box 7590 AX (main) 8.00 /usr/rest_api/plugins 14.3k
FRITZ!Box 7690 7.90 /usr/rest_api/plugins 14.3k
25 models use this script

SMW-Browser

Information is currently being retrieved from the backend.
 

Synonyms

Showing 1 related property.

m