-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge Engaged and Stored alerts #8795
Labels
Comments
SQLite in-memory schema implemented in b48c0e0 |
cardigliano
added a commit
that referenced
this issue
Nov 8, 2024
Temporary added constraint in 6bde300 to avoid a full db scan when visualizing engaged alerts. Showing alerts engaged up to 1 day before. |
MatteoBiscosi
added a commit
that referenced
this issue
Nov 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently ntopng visualize alerts in different tabs according to the status (engaged or stored). It is requested to merge them in a single view, which should allow also sorting and filtering them. In order to achieve this, it is required to store engaged alerts in an in-memory database table, and create a view (union) which includes both in-memory and stored records.
Current implementation details:
Database schema is defined in the files below:
httpdocs/misc/alert_store_schema.sql (SQLite)
httpdocs/misc/db_schema_clickhouse.sql (CH)
httpdocs/misc/db_schema_clickhouse_cluster.sql (CH Cluster)
NetworkInterface allocates AlertStore (SQLiteAlertStore, or ClickHouseAlertStore when enabled) into alertStore (class AlertStore) for storing alerts. SQLiteAlertStore opens the database on the provided file path, while ClickHouseAlertStore executes queries (e.g. in ClickHouseAlertStore::query()) through the db (class DB) instance in NetworkInterface (e.g. iface->exec_sql_query()), where db is an instance of ClickHouseFlowDB.
Alerts (one-shot or engaged when they are released) are currently stored to the persistent database from Lua by calling interface.alert_store_query() mapped to C++ which is calling alertStore->query()
Engaged (e.g. Host) alerts are triggered in Host::triggerAlert and released in Host::releaseAlert, those methods use addEngagedAlert(alert) and removeEngagedAlert(alert) to add and remove them from the active alerts in memory.
It is requested to:
Nice to have:
Open issues:
The text was updated successfully, but these errors were encountered: