Filter plugin prep

This commit is contained in:
Jokob-sk
2023-07-16 09:30:55 +10:00
parent 4d433b633f
commit d0284a0603
6 changed files with 114 additions and 62 deletions

View File

@@ -58,9 +58,6 @@ def importConfigs (db):
return
conf.lastImportedConfFile = os.path.getmtime(config_file)
mylog('debug', ['[Import Config] importing config file'])
conf.mySettings = [] # reset settings
@@ -86,14 +83,6 @@ def importConfigs (db):
conf.DAYS_TO_KEEP_EVENTS = ccd('DAYS_TO_KEEP_EVENTS', 90 , c_d, 'Delete events days', 'integer', '', 'General')
conf.HRS_TO_KEEP_NEWDEV = ccd('HRS_TO_KEEP_NEWDEV', 0 , c_d, 'Keep new devices for', 'integer', "0", 'General')
# # New device defaults
# conf.NEWDEV_SCAN = ccd('NEWDEV_SCAN', 1 , c_d, 'Scan Device', 'integer.select', "['0', '1']", 'NewDeviceDefaults')
# conf.NEWDEV_ALERT_ALL = ccd('NEWDEV_ALERT_ALL', 0 , c_d, 'Alert All Events', 'integer.select', "['0', '1']", 'NewDeviceDefaults')
# conf.NEWDEV_ALERT_DWN = ccd('NEWDEV_ALERT_DWN', 0 , c_d, 'Alert Down', 'integer.select', "['0', '1']", 'NewDeviceDefaults')
# conf.NEWDEV_NEWDEV = ccd('NEWDEV_NEWDEV', 1 , c_d, 'New Device', 'integer.select', "['0', '1']", 'NewDeviceDefaults')
# conf.NEWDEV_ARCHIVED = ccd('NEWDEV_ARCHIVED', 0 , c_d, 'Archived', 'integer.select', "['0', '1']", 'NewDeviceDefaults')
# conf.NEWDEV_SKIPNTF = ccd('NEWDEV_SKIPNTF', 0 , c_d, 'Skip repeated notifications for', 'integer.select', "['0', '1', '8', '24', '168']", 'NewDeviceDefaults')
# Email
conf.REPORT_MAIL = ccd('REPORT_MAIL', False , c_d, 'Enable email', 'boolean', '', 'Email', ['test'])
conf.SMTP_SERVER = ccd('SMTP_SERVER', '' , c_d,'SMTP server URL', 'text', '', 'Email')

View File

@@ -8,4 +8,4 @@ A simple template-based plugin for new devices. You can change the default value
### Notes
- This plugin generates editable settings taht are then used in the `device.py` script to initialize new values.
- This plugin generates editable settings that are then used in the `device.py` script to initialize new values.

View File

@@ -3,6 +3,13 @@
"unique_prefix": "NMAPSRV",
"enabled": true,
"data_source": "pialert-db-query",
"data_filters": [
{
"column" : "Object_PrimaryID",
"function" : "==",
"filter_field_id": "txtMacFilter"
}
],
"localized": ["display_name", "description", "icon"],
"display_name" : [{
"language_code":"en_us",