Commit graph

671 commits

Author SHA1 Message Date
Luca Deri
958fed3a54 Implemented script code editor 2019-12-10 17:58:16 +01:00
emanuele-f
a3432e00e8 Implement ntopng plugins
Plugins are a convenient way to group together related lua scripts.
Their primary use case is to group user scripts and their alert/status
definition.
The builtin ntopng user scripts and definitions are now
packed into plugins directories. In future, we will support loading of
user created plugins.
Plugins are loaded at startup into some runtime directories and then
used. Other changes provided by this commit include:

- Add sample flow logger plugin
- Initial support for system user scripts
- Rename edge to threshold
- Migrate system probes to user scripts/plugins
- Migrate scripts to more explicit alerts_api.checkThresholdAlert api
2019-12-10 09:25:57 +01:00
Simone Mainardi
7402bbdd14 FontAwesome 5 migration 2019-12-09 15:11:37 +01:00
Alfredo Cardigliano
256f42bcf4 Fix alert delete 2019-12-05 17:19:35 +01:00
Simone Mainardi
1aa0546b85 Bootstrap migration dropdown style fixes 2019-12-05 09:27:48 +01:00
Simone Mainardi
a34a326d4c Bootstrap migration glyphicon filter to fa 2019-12-05 09:27:48 +01:00
Simone Mainardi
222be5ae10 Bootstrap migration host nav bar 2019-12-05 09:27:47 +01:00
Simone Mainardi
db272831e9 Bootstrap migration tabs 2019-12-05 09:27:47 +01:00
Simone Mainardi
6d36e7cb76 Bootstrap migration btn-default to btn-secondary 2019-12-05 09:27:47 +01:00
Simone Mainardi
2639d49e4a Bootstrap migration progress bars 2019-12-05 09:27:47 +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
Simone Mainardi
0f507dba1c Fixes alerts API error
Fixes #3002
2019-11-26 18:07:01 +01:00
Simone Mainardi
188ec66c25 Implements scriptable SNMP devices alerts 2019-11-22 18:00:31 +01:00
emanuele-f
1fd65ac44c Flow user scripts enhancements
- Add title label in hash table utilization gauges
- List Hash Tables charts and Periodic Activities charts in a single page
- Replace Periodic Activities max duration column with time utilization percentage
- Add api to add a straight line in the charts
- Show max duration time as a straight line in Periodic Activities charts
- Move dropped flow calls charts to the Peridic Activities page
- Fix expert view number of calls 0
- Fix interface/host/network trigger alert label
- Move chart icon to separate column in redis and influxdb pages
- Fix interface menu selection in Hash Tables and Periodic Activities
- Highlight issues with a warning triangle in Hash Tables and Periodic Activities
- Fix some page navigation issues with extra_params
- Fix wrong schema graph options passed to nv_graph_utils
2019-11-20 20:09:45 +01:00
emanuele-f
2df9b34201 Add flow user scripts drops alert 2019-11-19 17:37:58 +01:00
emanuele-f
227eef9d3e Fix entity specific settings defaults not populated 2019-11-19 17:37:31 +01:00
Alfredo Cardigliano
390a3e4141 Links to the scripts list (fix #3011) 2019-11-15 18:46:57 +01:00
emanuele-f
bea63668b8 Separate old benchmark from user scripts 2019-11-14 20:03:43 +01:00
emanuele-f
c19bda5425 Move internal alerts queue from redis to C 2019-11-14 12:07:29 +01:00
emanuele-f
df0556cb87 Optimize flow alerts generation
This provides a ~10x speedup by performing the JSON serialization work in C
(and thus avoiding Lua->C overhead). This also implements two in-memory alerts
queues (one for sqlite and one for the notifications) in order to reduce Redis load.
Alerts queue are now global instead of per-interface as there is only 1 dequeing thread.
2019-11-14 11:54:13 +01:00
emanuele-f
4d322c3c09 Add missing max devices check 2019-11-05 16:00:26 +01:00
Alfredo Cardigliano
acdab024da Enqueueing flow alerts to be stored/notified from Lua, removed DB select to notiy alert (using the alert object directly) 2019-11-05 15:53:10 +01:00
emanuele-f
17a22ef986 nil fix 2019-11-05 15:35:56 +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
emanuele-f
a96a90b65f Optimize disabled alerts bitmap redis access 2019-11-05 12:29:08 +01:00
Simone Mainardi
c4ad235bf8 Fixes empty callbacks lists with alerts disabled
Fixes #3037
2019-11-04 18:38:20 +01:00
emanuele-f
675adcf90e Migrate hosts disabled flow status preference to lua
By loading all the preferences at once in flow.lua setup() the
redis load is reduced and design is simpler.
2019-11-04 16:50:26 +01:00
emanuele-f
33949d31fd Rework benchmark stats and charts 2019-10-31 17:48:53 +01:00
Alfredo Cardigliano
d10dfc7762 Deferred flow alerts insertion through a redis queue. Removed alerts DB select when printing flow details. 2019-10-31 12:53:23 +01:00
emanuele-f
e978a83151 Improve user scripts charts
Fixes #3020
2019-10-31 13:30:24 +01:00
emanuele-f
e238605f86 Fix latest run label 2019-10-25 17:51:29 +02:00
Alfredo Cardigliano
c7120e23f3 Hide periodic user scripts in pcap dump mode (unless --original-speed is specified) 2019-10-25 16:45:23 +02:00
emanuele-f
58a12f1241 Add user scripts benchmark charts
Implements #2999
2019-10-24 20:24:13 +02:00
emanuele-f
10aa5542f8 Rework alertEntity functions to avoid modules circular dependencies
Fixes #2975
2019-10-23 13:01:57 +02:00
Simone Mainardi
fca66af5e5 Adds speed and num calls to script duration information 2019-10-22 19:05:57 +02:00
emanuele-f
bb4f073b1a Avoid triggering remote-to-remote alerts when disabled 2019-10-22 18:46:03 +02:00
emanuele-f
cbddac0562 Fix outside DHCP range alert 2019-10-22 17:16:45 +02:00
Alfredo Cardigliano
b816bfc2d6 Fix purge past alerts button 2019-10-22 16:56:06 +02:00
emanuele-f
ab0875155e Remove AlertType typedef from C 2019-10-22 14:43:21 +02:00
emanuele-f
b3374651ce Merge branch 'alerts_cleanup' into dev 2019-10-22 10:50:21 +02:00
emanuele-f
b3a8c6d49a Migrate C flow status alerts to Lua user scripts
- Alerts and flow status cleanup
- Community flow user scripts migration
- Implement scripts filters by l7 proto and packet interface only
- Migrate flow2statusinfojson
- Lower flow periodic update to 30 seconds if there is flow activity
- Display flow scripts without a gui section
2019-10-22 10:42:22 +02:00
Simone Mainardi
1ec35c3042 Fixes and cleanup of disabled alerts 2019-10-22 10:33:42 +02:00
Simone Mainardi
43d0b89bd9 Prevens tons of unnecessary calls to alerts_api.trigger() 2019-10-17 18:54:13 +02:00
Simone Mainardi
f8443ff03d Disk space reclaim and defrag of alerts db 2019-10-17 12:12:28 +02:00
Simone Mainardi
6fd7386c03 Fixes possible collisions when looking up flows by key 2019-10-16 19:04:10 +02:00
emanuele-f
873b96c20a Split alert types definitions in multiple files 2019-10-16 12:04:07 +02:00
emanuele-f
7a14a9cf11 Improvements in status definition API 2019-10-16 10:33:19 +02:00
emanuele-f
9ea7ff01b8 Improve flow alert trigger logic and fix support for custom message 2019-10-15 18:36:41 +02:00
emanuele-f
b217909966 Split flow status definitions in multiple files 2019-10-15 17:28:45 +02:00
Simone Mainardi
b258f45858 Fixes deletion of old alerts when above a certain threshold 2019-10-14 18:03:16 +02:00