diff --git a/scripts/locales/en.lua b/scripts/locales/en.lua
index 4a7be0b0d8..de873cec1b 100644
--- a/scripts/locales/en.lua
+++ b/scripts/locales/en.lua
@@ -337,12 +337,16 @@ local lang = {
["flows_flood"] = "Flows Flood",
["ghost_network_detected"] = "Ghost Network Detected",
["ghost_network_detected_description"] = "Subnet %{network} does not belong to the %{entity} networks.",
+ ["ghost_networks"] = "Ghost Networks",
+ ["ghost_networks_description"] = "Trigger an alert for unknown networks detected on the network interface.",
["host_pool_connection"] = "Host Pool Connection",
["host_pool_disconnection"] = "Host Pool Disconnection",
["icmp_anomaly"] = "ICMP Anomaly",
["inactivity"] = "Inactivity",
["influxdb_dropped_points"] = "InfluxDB Dropped Points",
["influxdb_export_failure"] = "InfluxDB Export Failure",
+ ["influxdb_monitor"] = "InfluxDB monitor",
+ ["influxdb_monitor_description"] = "Monitor the InfluxDB health",
["info"] = "Info",
["involving_msg"] = "Flow Alerts Involving",
["last_day"] = "Last Day",
@@ -356,6 +360,8 @@ local lang = {
["malicious_signature_detected"] = "Possibly Malicious Signature",
["many_replies"] = "%{count} %{what} replies",
["many_requests"] = "%{count} %{what} requests",
+ ["memory_ts"] = "Memory Timeseries",
+ ["memory_ts_description"] = "Generate process memory timeseries",
["misbehaving_flows_ratio"] = "Too Many Misbehaving Flows",
["misconfigured_app"] = "Misconfigured App",
["misconfigured_dhcp_range"] = "Misconfigured DHCP Range",
@@ -381,15 +387,19 @@ local lang = {
["slow_periodic_activity"] = "Slow Periodic Activity",
["slow_purge"] = "Slow Idle Purging",
["slow_stats_update"] = "Slow Statistics Update",
+ ["slow_stats_update_description"] = "Trigger an alert when the periodic interfaces stats update is running too slow",
["snmp_device_is_unresponsive"] = "SNMP device %{device} is unresponsive",
["snmp_port_changed_duplex_status"] = "Interface %{port} on SNMP device %{device} changed its duplex status to %{new_op}",
["snmp_port_changed_operational_status"] = "Interface %{port} on SNMP device %{device} changed its status to %{new_op}",
["snmp_port_duplexstatus_change"] = "Interface Duplex Status Change",
+ ["snmp_port_duplexstatus_change_description"] = "Trigger an alert when an interface duplex status changes",
["snmp_port_errors"] = "Interface Errors",
+ ["snmp_port_errors_description"] = "Trigger an alert when an interface discard/error counters increase",
["snmp_port_errors_increased"] = "Discard/error counters increased on interface %{port} on SNMP device %{device}",
["snmp_port_load_threshold_exceeded"] = "Interface Load Threshold Exceeded",
["snmp_port_load_threshold_exceeded_message"] = "Load threshold exceeded on interface %{port} on SNMP device %{device} [threshold: %{threshold}%%][IN load: %{in_load}%%][OUT load: %{out_load}%%]",
["snmp_port_status_change"] = "Interface Status Change",
+ ["snmp_port_status_change_description"] = "Trigger an alert when the status of an interface changes",
["starting_on"] = "starting on",
["submit"] = "Update Dashboard",
["suspicious_activity"] = "Suspicious Activity",
@@ -399,6 +409,10 @@ local lang = {
["too_low_replies_received"] = "%{entity} has sent %{requests} but received %{replies} [%{granularity} ratio: %{ratio}%%]",
["too_low_replies_sent"] = "%{entity} has received %{requests} but sent %{replies} [%{granularity} ratio: %{ratio}%%]",
["too_many_drops"] = "Packet Drops",
+ ["too_many_flows"] = "Too Many Flows Alert",
+ ["too_many_flows_description"] = "Trigger an alert when the number of active flows is too high",
+ ["too_many_hosts"] = "Too Many Hosts Alert",
+ ["too_many_hosts_description"] = "Trigger an alert when the number of active hosts is too high",
["total_alerts"] = "Total Alerts",
["trailing_msg"] = "Time Window",
["unresponsive_device"] = "Unresponsive Device",
@@ -832,6 +846,8 @@ local lang = {
["capture_packets"] = "Captured Packets",
["signatures_failed"] = "Signatures Failed",
["signatures_loaded"] = "Signatures Loaded",
+ ["suricata"] = "Suricata",
+ ["suricata_description"] = "Extracts alerts and metadata from Suricata",
["suricata_statistics"] = "Suricata Statistics",
["title"] = "External Statistics",
},
@@ -1792,6 +1808,7 @@ local lang = {
["mud_recording"] = "MUD Recording",
["mud_special_purpose"] = "Special Purpose",
["rtt_monitor"] = "RTT Monitor",
+ ["rtt_monitor_description"] = "Configure and monitor the RTT of specific hosts",
["trigger_alerts_for_host"] = "Trigger alerts for Host %{host}",
["trigger_host_alerts"] = "Trigger Host Alerts",
["unblock_host_traffic"] = "Unblock Host Traffic",
@@ -3477,6 +3494,8 @@ local lang = {
["redis_health_red"] = "Persistence Issues",
["redis_health_red_descr"] = "Redis is unable to persist data. Expect %{product} to malfunction.",
["redis_keys"] = "Database Keys",
+ ["redis_monitor"] = "Redis Monitor",
+ ["redis_monitor_description"] = "Monitor the Redis health",
["short_desc_redis_health"] = "Current Redis health.",
["short_desc_redis_keys"] = "Total keys in the Redis database.",
["short_desc_redis_ram_memory"] = "Total memory Redis has obtained from the operating system.",
diff --git a/scripts/lua/modules/user_scripts.lua b/scripts/lua/modules/user_scripts.lua
index 3c5202574a..92ba88bdbb 100644
--- a/scripts/lua/modules/user_scripts.lua
+++ b/scripts/lua/modules/user_scripts.lua
@@ -478,7 +478,7 @@ function user_scripts.load(ifid, script_type, subdir, options)
end
if((not user_script.gui) or (not user_script.gui.i18n_title) or (not user_script.gui.i18n_description)) then
- traceError(TRACE_DEBUG, TRACE_CONSOLE, string.format("Module '%s' does not define a gui", mod_fname))
+ traceError(TRACE_WARNING, TRACE_CONSOLE, string.format("Module '%s' does not define a gui", mod_fname))
end
-- Augument with additional attributes
@@ -751,7 +751,13 @@ end
-- ##############################################
+local cached_config_sets = nil
+
function user_scripts.getConfigsets()
+ if cached_config_sets then
+ return(cached_config_sets)
+ end
+
local configsets = ntop.getHashAllCache(CONFIGSETS_KEY) or {}
local rv = {}
@@ -763,6 +769,9 @@ function user_scripts.getConfigsets()
end
end
+ -- Cache to avoid loading them again
+ cached_config_sets = rv
+
return(rv)
end
@@ -934,6 +943,25 @@ end
-- ##############################################
+-- Returns true if a system script is enabled for some hook
+function user_scripts.isSystemScriptEnabled(script_key)
+ local configsets = user_scripts.getConfigsets()
+ local default_config = user_scripts.getDefaultConfig(configsets, "system")
+ local script_config = default_config[script_key]
+
+ if(script_config) then
+ for _, hook in pairs(script_config) do
+ if(hook.enabled) then
+ return(true)
+ end
+ end
+ end
+
+ return(false)
+end
+
+-- ##############################################
+
local default_config = {
enabled = false,
script_conf = {},
diff --git a/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_flows.lua b/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_flows.lua
index 19bd7d452a..7a900efbf4 100644
--- a/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_flows.lua
+++ b/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_flows.lua
@@ -14,7 +14,12 @@ local script = {
hooks = {
min = alerts_api.anomaly_check_function,
- }
+ },
+
+ gui = {
+ i18n_title = "alerts_dashboard.too_many_flows",
+ i18n_description = "alerts_dashboard.too_many_flows_description",
+ },
}
-- #################################################################
diff --git a/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_hosts.lua b/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_hosts.lua
index 19bd7d452a..8a4f9e3241 100644
--- a/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_hosts.lua
+++ b/scripts/plugins/app_misconfiguration/user_scripts/interface/too_many_hosts.lua
@@ -14,7 +14,12 @@ local script = {
hooks = {
min = alerts_api.anomaly_check_function,
- }
+ },
+
+ gui = {
+ i18n_title = "alerts_dashboard.too_many_hosts",
+ i18n_description = "alerts_dashboard.too_many_hosts_description",
+ },
}
-- #################################################################
diff --git a/scripts/plugins/ghost_networks/user_scripts/interface/ghost_networks.lua b/scripts/plugins/ghost_networks/user_scripts/interface/ghost_networks.lua
index 7154251f70..24dfc98b31 100644
--- a/scripts/plugins/ghost_networks/user_scripts/interface/ghost_networks.lua
+++ b/scripts/plugins/ghost_networks/user_scripts/interface/ghost_networks.lua
@@ -35,6 +35,11 @@ script = {
hooks = {
min = check_ghost_networks,
},
+
+ gui = {
+ i18n_title = "alerts_dashboard.ghost_networks",
+ i18n_description = "alerts_dashboard.ghost_networks_description",
+ },
}
-- #################################################################
diff --git a/scripts/plugins/influxdb_monitor/user_scripts/system/influxdb_monitor.lua b/scripts/plugins/influxdb_monitor/user_scripts/system/influxdb_monitor.lua
index 0086516ce8..3099582064 100644
--- a/scripts/plugins/influxdb_monitor/user_scripts/system/influxdb_monitor.lua
+++ b/scripts/plugins/influxdb_monitor/user_scripts/system/influxdb_monitor.lua
@@ -11,6 +11,11 @@ local script = {
-- No default configuration is provided
default_value = {},
+ gui = {
+ i18n_title = "alerts_dashboard.influxdb_monitor",
+ i18n_description = "alerts_dashboard.influxdb_monitor_description",
+ },
+
-- See below
hooks = {},
}
diff --git a/scripts/plugins/influxdb_monitor/web_gui/menu.lua b/scripts/plugins/influxdb_monitor/web_gui/menu.lua
index ff0f67039d..b54bfb1fff 100644
--- a/scripts/plugins/influxdb_monitor/web_gui/menu.lua
+++ b/scripts/plugins/influxdb_monitor/web_gui/menu.lua
@@ -4,7 +4,9 @@ return {
sort_order = 1600,
is_shown = function()
local ts_utils = require("ts_utils_core")
+ local user_scripts = require("user_scripts")
- return(ts_utils.getDriverName() == "influxdb")
+ return((ts_utils.getDriverName() == "influxdb") and
+ user_scripts.isSystemScriptEnabled("influxdb_monitor"))
end
}
diff --git a/scripts/plugins/redis_monitor/user_scripts/system/redis_monitor.lua b/scripts/plugins/redis_monitor/user_scripts/system/redis_monitor.lua
index 6965185263..24aaa74a98 100644
--- a/scripts/plugins/redis_monitor/user_scripts/system/redis_monitor.lua
+++ b/scripts/plugins/redis_monitor/user_scripts/system/redis_monitor.lua
@@ -13,6 +13,11 @@ local script = {
-- See below
hooks = {},
+
+ gui = {
+ i18n_title = "system_stats.redis.redis_monitor",
+ i18n_description = "system_stats.redis.redis_monitor_description",
+ },
}
-- ##############################################
diff --git a/scripts/plugins/redis_monitor/web_gui/menu.lua b/scripts/plugins/redis_monitor/web_gui/menu.lua
index 21f316b0ed..4a92d5dc1a 100644
--- a/scripts/plugins/redis_monitor/web_gui/menu.lua
+++ b/scripts/plugins/redis_monitor/web_gui/menu.lua
@@ -2,4 +2,10 @@ return {
label = "Redis",
script = "redis_stats.lua",
sort_order = 1700,
+
+ is_shown = function()
+ local user_scripts = require("user_scripts")
+
+ return(user_scripts.isSystemScriptEnabled("redis_monitor"))
+ end
}
diff --git a/scripts/plugins/rtt/user_scripts/system/rtt.lua b/scripts/plugins/rtt/user_scripts/system/rtt.lua
index 18a122323b..aeda34d4c8 100644
--- a/scripts/plugins/rtt/user_scripts/system/rtt.lua
+++ b/scripts/plugins/rtt/user_scripts/system/rtt.lua
@@ -23,6 +23,11 @@ local script = {
-- See below
hooks = {},
+
+ gui = {
+ i18n_title = "host_config.rtt_monitor",
+ i18n_description = "host_config.rtt_monitor_description",
+ },
}
-- #################################################################
diff --git a/scripts/plugins/rtt/web_gui/menu.lua b/scripts/plugins/rtt/web_gui/menu.lua
index 36d961946f..e6644936f1 100644
--- a/scripts/plugins/rtt/web_gui/menu.lua
+++ b/scripts/plugins/rtt/web_gui/menu.lua
@@ -2,4 +2,10 @@ return {
label = "rtt.rtt_monitor",
script = "rtt_stats.lua",
sort_order = 1500,
+
+ is_shown = function()
+ local user_scripts = require("user_scripts")
+
+ return(user_scripts.isSystemScriptEnabled("rtt"))
+ end
}
diff --git a/scripts/plugins/slow_stats_update/user_scripts/interface/slow_stats_update.lua b/scripts/plugins/slow_stats_update/user_scripts/interface/slow_stats_update.lua
index 9565f3684e..de83c499bd 100644
--- a/scripts/plugins/slow_stats_update/user_scripts/interface/slow_stats_update.lua
+++ b/scripts/plugins/slow_stats_update/user_scripts/interface/slow_stats_update.lua
@@ -15,6 +15,11 @@ local script = {
hooks = {
min = alerts_api.anomaly_check_function,
},
+
+ gui = {
+ i18n_title = "alerts_dashboard.slow_stats_update",
+ i18n_description = "alerts_dashboard.slow_stats_update_description",
+ },
}
-- #################################################################
diff --git a/scripts/plugins/suricata_collector/user_scripts/syslog/suricata.lua b/scripts/plugins/suricata_collector/user_scripts/syslog/suricata.lua
index 966b232a0b..a502f2d64f 100644
--- a/scripts/plugins/suricata_collector/user_scripts/syslog/suricata.lua
+++ b/scripts/plugins/suricata_collector/user_scripts/syslog/suricata.lua
@@ -11,7 +11,14 @@ local alert_consts = require("alert_consts")
local syslog_module = {
key = "suricata",
+
+ -- See below
hooks = {},
+
+ gui = {
+ i18n_title = "external_stats.suricata",
+ i18n_description = "external_stats.suricata_description",
+ },
}
local external_stats_key = getRedisIfacePrefix(interface.getId())..'.external_stats'
diff --git a/scripts/plugins/timeseries/user_scripts/system/memory_ts.lua b/scripts/plugins/timeseries/user_scripts/system/memory_ts.lua
index 79c7959271..66d1f42419 100644
--- a/scripts/plugins/timeseries/user_scripts/system/memory_ts.lua
+++ b/scripts/plugins/timeseries/user_scripts/system/memory_ts.lua
@@ -13,6 +13,11 @@ local script = {
-- See below
hooks = {},
+
+ gui = {
+ i18n_title = "alerts_dashboard.memory_ts",
+ i18n_description = "alerts_dashboard.memory_ts_description",
+ },
}
-- ##############################################