The most complete example of script structure is the following
example/ |-- manifest.lua |-- locales | `-- en.lua |-- alert_endpoints | |-- example.lua | `-- prefs_entries.lua |-- alert_definitions | `-- alert_example.lua |-- status_definitions | `-- status_example.lua |-- checks | |-- interface | | `-- example.lua | |-- network | | `-- example.lua | |-- snmp_device | | `-- example.lua | `-- system | `-- example.lua |-- ts_schemas | |-- min.lua | `-- 5mins.lua `-- web_gui |-- example_page.lua `-- menu.lua
The root directory
example must have a name which is
representative for the script. Sub-directories contain:
manifest.lua: file containing a name and a description of the script. See Specifying the files to distribute.
locales(optional): files for the localization of strings used within the script, such as the description of a generated alert. When this directory is omitted, strings found in the script will be taken verbatim. See Localization.
alert_endpoints(optional): files to create alert endpoints. An alert endpoint is called by ntopng every time an alert is generated. Alert endpoints enable an alert to be post-processed or delivered downstream to an external alert collector. This directory can be omitted when the script does not create alert endpoints. See Alert Endpoints.
checks: files with the logic necessary to perform custom actions. This directory contains additional sub-directories, namely,
system. ntopng guarantees files found under the
interfacedirectory are be executed for every interface; files found under the
networkdirectory will be executed for every local network; and so on. Sub-directories can be missing or empty, depending on whether the scripts wants to perform certain actions or not. See Checks.
ts_schemas: contains timeseries schemas definitions. See Timeseries Schemas.
web_gui: file to create custom ntopng pages and link them in the main ntopng menu. See Custom Pages.