mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
585 lines
15 KiB
JSON
Executable File
585 lines
15 KiB
JSON
Executable File
{
|
|
"code_name": "sync",
|
|
"template_type": "database-entry",
|
|
"unique_prefix": "SYNC",
|
|
"plugin_type": "system",
|
|
"enabled": true,
|
|
"data_source": "template",
|
|
"show_ui": true,
|
|
"localized": ["display_name", "description", "icon"],
|
|
"display_name": [{
|
|
"language_code": "en_us",
|
|
"string": "Sync Hub"
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string": "Plugin to synchronize multiple NetAlertX instances."
|
|
}],
|
|
"icon": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "<i class=\"fa fa-group-arrows-rotate\"></i>"
|
|
}
|
|
],
|
|
"params" : [],
|
|
"database_column_definitions": [
|
|
{
|
|
"column": "Index",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "N/A"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "N/A"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Plugin",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "N/A"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "N/A"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Object_PrimaryID",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Plugin"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Object_SecondaryID",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Time"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "DateTimeCreated",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Sent when"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "DateTimeChanged",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Changed"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Watched_Value1",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value":"",
|
|
"options": [
|
|
],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Node name"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Watched_Value2",
|
|
"css_classes": "col-sm-8",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Status code"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Watched_Value3",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "textarea_readonly",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Response"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Watched_Value4",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "N/A"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "UserData",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "textbox_save",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Comments"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Status",
|
|
"css_classes": "col-sm-1",
|
|
"show": false,
|
|
"type": "replace",
|
|
"default_value": "",
|
|
"options": [
|
|
{
|
|
"equals": "watched-not-changed",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-square-check'></i><div></div>"
|
|
},
|
|
{
|
|
"equals": "watched-changed",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-triangle-exclamation'></i></div>"
|
|
},
|
|
{
|
|
"equals": "new",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-circle-plus'></i></div>"
|
|
},
|
|
{
|
|
"equals": "missing-in-last-scan",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-question'></i></div>"
|
|
}
|
|
],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Status"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Estado"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Extra",
|
|
"css_classes": "col-sm-3",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Extra"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Extra"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"settings":[
|
|
{
|
|
"function": "instance_type",
|
|
"type": "text.select",
|
|
"maxLength": 50,
|
|
"default_value": ["hub"],
|
|
"options": ["hub", "node"],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Instance type"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "If this app instance is to receive the synchronization data, select <code>hub</code>. If this instance is sending the data, select <code>node</code>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "RUN",
|
|
"events": ["run"],
|
|
"type": "text.select",
|
|
"display_condition": {
|
|
"type" : "setting",
|
|
"name" : "SYNC_instance_type",
|
|
"value": "hub"
|
|
},
|
|
"default_value":"disabled",
|
|
"options": ["disabled", "once", "schedule", "always_after_scan", "on_new_device", "on_notification"],
|
|
"localized": ["name", "description"],
|
|
"name" :[{
|
|
"language_code":"en_us",
|
|
"string" : "When to run"
|
|
},
|
|
{
|
|
"language_code":"es_es",
|
|
"string" : "Cuándo ejecutar"
|
|
},
|
|
{
|
|
"language_code":"de_de",
|
|
"string" : "Wann laufen"
|
|
}],
|
|
"description": [{
|
|
"language_code":"en_us",
|
|
"string" : "When the node sync should run. Data might be lost if you run the sync less frequently. Good options are <code>always_after_scan</code>, <code>on_new_device</code>, <code>on_notification</code>"
|
|
}]
|
|
},
|
|
{
|
|
"function": "hub_url",
|
|
"type": "text",
|
|
"display_condition": {
|
|
"type" : "setting",
|
|
"name" : "SYNC_instance_type",
|
|
"value": "hub"
|
|
},
|
|
"maxLength": 50,
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Hub URL"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Target hub URL to send the data to without a trailig slash, for example <code>http://192.168.1.82:20211</code>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "node_name",
|
|
"type": "text",
|
|
"display_condition": {
|
|
"type" : "setting",
|
|
"name" : "SYNC_instance_type",
|
|
"value": "node"
|
|
},
|
|
"maxLength": 50,
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Node name"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Use a unique node name, without spaces or special characters, such as <code>Node_Vlan01</code>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "devices",
|
|
"type": "boolean",
|
|
"default_value": false,
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Send Devices"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "When enabled the whole Devices table is sent over. Only new devices with new MACs are inserted in the target hub."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "plugins",
|
|
"type": "text.multiselect",
|
|
"display_condition": {
|
|
"type" : "setting",
|
|
"name" : "SYNC_instance_type",
|
|
"value": "node"
|
|
},
|
|
"maxLength": 50,
|
|
"default_value": [
|
|
],
|
|
"options": ["{value}"],
|
|
"options_params" : [
|
|
{
|
|
"name" : "value",
|
|
"type" : "setting",
|
|
"value" : "LOADED_PLUGINS"
|
|
}
|
|
],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Send Plugins"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Plugins to synchronize. Only plugins that produce some kind of output in <code>last_result.log</code> can be synchronized."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "api_token",
|
|
"type": "text",
|
|
"maxLength": 50,
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "API token"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "API token to secure communication. The API token needs to be the same on the hub and on the nodes."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "encryption_key",
|
|
"type": "text",
|
|
"maxLength": 50,
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Encryption Key"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Encryption key used to encrypt the sent data. The key needs to be the same on the hub and on the nodes."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "CMD",
|
|
"type": "readonly",
|
|
"default_value": "python3 /app/front/plugins/sync/sync.py",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Command"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Comando"
|
|
},
|
|
{
|
|
"language_code": "de_de",
|
|
"string": "Befehl"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Command to run. This can not be changed"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Comando a ejecutar. Esto no se puede cambiar"
|
|
},
|
|
{
|
|
"language_code": "de_de",
|
|
"string": "Befehl zum Ausführen. Dies kann nicht geändert werden"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "RUN_SCHD",
|
|
"type": "text",
|
|
"display_condition": {
|
|
"type" : "setting",
|
|
"name" : "SYNC_instance_type",
|
|
"value": "hub"
|
|
},
|
|
"default_value":"0 2 * * 3",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code":"en_us",
|
|
"string" : "Schedule"
|
|
},
|
|
{
|
|
"language_code":"es_es",
|
|
"string" : "Schedule"
|
|
},
|
|
{
|
|
"language_code":"de_de",
|
|
"string" : "Schedule"
|
|
}],
|
|
"description": [{
|
|
"language_code":"en_us",
|
|
"string" : "Only enabled if you select <code>schedule</code> in the <a href=\"#SYNC_RUN\"><code>SYNC_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes."
|
|
},
|
|
{
|
|
"language_code":"es_es",
|
|
"string" : "Solo está habilitado si selecciona <code>schedule</code> en la configuración <a href=\"#SYNC_RUN\"><code>SYNC_RUN</code></a>. Asegúrese de ingresar la programación en el formato similar a cron correcto (por ejemplo, valide en <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Por ejemplo, ingresar <code>0 4 * * *</code> ejecutará el escaneo después de las 4 a.m. en el <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ código> que configuró arriba</a>. Se ejecutará la PRÓXIMA vez que pase el tiempo."
|
|
},
|
|
{
|
|
"language_code":"de_de",
|
|
"string" : "Nur aktiviert, wenn Sie <code>schedule</code> in der <a href=\"#SYNC_RUN\"><code>SYNC_RUN</code>-Einstellung</a> auswählen. Stellen Sie sicher, dass Sie den Zeitplan im richtigen Cron-ähnlichen Format eingeben (z. B. validieren unter <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Wenn Sie beispielsweise <code>0 4 * * *</code> eingeben, wird der Scan nach 4 Uhr morgens in der <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ ausgeführt. Code> den Sie oben festgelegt haben</a>. Wird das NÄCHSTE Mal ausgeführt, wenn die Zeit vergeht."
|
|
}]
|
|
},
|
|
{
|
|
"function": "RUN_TIMEOUT",
|
|
"type": "integer",
|
|
"default_value": 30,
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Run timeout"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Tiempo límite de ejecución"
|
|
},
|
|
{
|
|
"language_code": "de_de",
|
|
"string": "Zeitüberschreitung"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted."
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Tiempo máximo en segundos para esperar a que finalice el script. Si se supera este tiempo, el script se cancela."
|
|
},
|
|
{
|
|
"language_code": "de_de",
|
|
"string": "Maximale Zeit in Sekunden, die auf den Abschluss des Skripts gewartet werden soll. Bei Überschreitung dieser Zeit wird das Skript abgebrochen."
|
|
}
|
|
]
|
|
}
|
|
|
|
|
|
]
|
|
|
|
}
|