The most complete example of plugin 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 |-- user_scripts | |-- flow | | `-- example.lua | |-- host | | `-- example.lua | |-- 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 plugin. Sub-directories contain:
manifest.lua: file containing a name and a description of the plugin. See Manifest.
locales(optional): files for the localization of strings used within the plugin, such as the description of a generated alert. When this directory is omitted, strings found in the plugin 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 plugin does not create alert endpoints. See Alert Endpoints.
alert_definitions(optional): files for the definition of alerts generated by the plugin. This directory can be omitted when no alert is generated by the plugin. See Alert Definitions.
status_definitions(optional): files for the definition of flow statuses set by the plugin. When the plugin does not set flow statuses, this directory can be omitted from the structure. See Flow Definitions.
user_scripts: files with the logic necessary to perform custom actions. This directory contains additional sub-directories, namely,
system. ntopng guarantees files found under the
flowdirectory are be executed for every flow; files found under the
hostdirectory will be executed for every host; and so on. Sub-directories can be missing or empty, depending on whether the plugins wants to perform certain actions or not. See User Scripts.
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.