Commit graph

30 commits

Author SHA1 Message Date
Simone Mainardi
09c69edb22 Major rework of user_scripts.lua to use new pools 2020-07-10 13:01:29 +02:00
Simone Mainardi
e487427aab Refactors alert_utils and enterprise_alert_utils
Addresses #3720

Alerts Refactor: alert_utils as module

Alerts Refactor: notify_ntopng_start and notify_ntopng_stop

Alerts Refactor: processAlertNotifications

Alerts Refactor: checkStoreAlertsFromC

Alerts Refactor: formatAlertNotification

Alerts Refactor: notification_timestamp_rev

Alerts Refactor: formatAlertMessage

Alerts Refactor: getConfigsetAlertLink

Alerts Refactor: alertNotificationActionToLabel

Alerts Refactor: flushAlertsData

Alerts Refactor: disableAlertsGeneration

Alerts Refactor: newAlertsWorkingStatus and other

Alerts Refactor: drawAlerts

Alerts Refactor: drawAlertTables

Alerts Refactor: printAlertTables

Alerts Refactor: checkDeleteStoredAlerts

Alerts Refactor: getUnpagedAlertOptions

Alerts Refactor: getTabParameters

Alerts Refactor: getAlerts

Alerts Refactor: getNumAlerts

Alerts Refactor: performAlertsQuery

Alerts Refactor: sec2granularity

Alerts Refactor: granularity2id

Alerts Refactor: granularity2sec

Alerts Refactor: alertEngineLabel

Alerts Refactor: alertEngine

Alerts Refactor: alertEngineRaw

Alerts Refactor: alertTypeDescription

Alerts Refactor: alertType

Alerts Refactor: alertTypeLabel

Alerts Refactor: alertTypeRaw

Alerts Refactor: alertSeverity

Alerts Refactor: alertSeverityLabel

Alerts Refactor: alertSeverityRaw

Alerts Refactor: get_make_room_keys

Alerts Refactor: enterprise_alert_utils
2020-04-10 14:03:20 +02:00
emanuele-f
c848ea2395 Fix script failure due to removed host.getLocalhostInfo 2020-04-02 18:42:52 +02:00
Simone Mainardi
3144bc8bdf Renames alert_config to user_script_config 2020-03-26 14:51:53 +01:00
emanuele-f
0facf0e27d Implement host timeseries off/light/mode selection
Closes #3466
2020-03-03 15:52:04 +01:00
emanuele-f
aca088ea13 Add hyperlink to jump to the alert configuration
Closes #2936
2020-01-17 19:11:15 +01:00
emanuele-f
892c779fb7 Fix score ts written when host timeseries are disabled 2020-01-16 19:08:57 +01:00
emanuele-f
d7528e1628 Score improvements
The score is now calculated differently on the client and on the server of the flow.
The hosts flow is updated every minute and charted.
It's now possible to trigger an alert when the score threshold is exceeded
2020-01-15 12:34:16 +01:00
Luca Deri
170bc60f19 Updated (C) 2020-01-08 23:52:51 +01:00
emanuele-f
d037f9a9a4 Use new user scripts config and gui
The user scripts configuration can now be configured from the "User Scripts" entry under the cog
icon. It allows the creation of multiple configuration presets to be applied to hosts, networks and
interfaces.
2020-01-03 13:03:34 +01:00
emanuele-f
c665bc78d7 Make configsets global 2019-12-23 13:25:35 +01:00
emanuele-f
c6c6c46132 Implement configsets target hosts CIDR match 2019-12-20 14:27:38 +01:00
emanuele-f
b10520e264 Rename checkAlerts callback to runScripts 2019-12-16 09:31:24 +01:00
emanuele-f
0d48bff069 Implement more flexible user_scripts api
NOTE: The existing alerts configuration of the users will be discarded.

Some code has been added to make the current gui on/off toggle work.
It is marked with the following comment:

-- TODO remove after implementing the new gui
2019-11-28 11:06:14 +01:00
emanuele-f
54140b6f1a Migrate alertable disabled alerts preference to lua
This avoids performing multiple hget on redis, thus increasing performance
2019-11-05 14:59:38 +01:00
Simone Mainardi
ab1687fb44 Fixes triggere/release of alerts at mixed granularities 2019-10-21 23:30:45 +02:00
Simone Mainardi
5b3f34b72a Fixes flapping of engaged alerts 2019-10-21 17:41:50 +02:00
Simone Mainardi
e80dc962f4 Optimizes host.getFullInfo with smaller functions in periodic scripts 2019-10-21 16:21:03 +02:00
Simone Mainardi
945deec076 Minor fix 2019-10-18 18:55:49 +02:00
Simone Mainardi
a6571252fd Adds debug code do estimate cost of host.getFullInfo calls 2019-10-18 18:44:09 +02:00
Simone Mainardi
43d0b89bd9 Prevens tons of unnecessary calls to alerts_api.trigger() 2019-10-17 18:54:13 +02:00
emanuele-f
7bd6feb622 Rename check_module -> user_script 2019-10-10 18:14:53 +02:00
emanuele-f
b8f1a039fb Fix always_enabled required for non-alert scripts 2019-10-10 18:03:36 +02:00
emanuele-f
75cf795521 Unify teardown function 2019-10-10 17:24:24 +02:00
Simone Mainardi
4ef7d35296 Benchmarks for hosts interface and network scripts 2019-10-10 11:54:31 +02:00
emanuele-f
ab0094c1c3 Unify syslog with user scripts API 2019-10-09 18:53:19 +02:00
emanuele-f
e66889154c Migrate flow script documentation and document traffic element scripts 2019-10-09 17:23:51 +02:00
emanuele-f
ffd3b4c1ee Users scripts api changes and initial documentation 2019-10-09 15:12:28 +02:00
emanuele-f
ede9a7940a Generalize periodic and flows callbacks
Now periodic callbacks are properly called even when alerts are disabled
The granularity filter and check_function has been replaced with a more generic hooks list
2019-10-07 19:05:43 +02:00
emanuele-f
bee1efdded Move callbacks scripts into separate tab 2019-10-04 10:48:13 +02:00
Renamed from scripts/callbacks/interface/alerts/host.lua (Browse further)