mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
430 lines
12 KiB
JSON
Executable File
430 lines
12 KiB
JSON
Executable File
{
|
|
"code_name": "internet_ip",
|
|
"unique_prefix": "INTRNT",
|
|
"enabled": true,
|
|
"mapped_to_table": "CurrentScan",
|
|
"data_filters": [
|
|
{
|
|
"compare_column": "Object_PrimaryID",
|
|
"compare_operator": "==",
|
|
"compare_field_id": "txtMacFilter",
|
|
"compare_js_template": "'{value}'.toString()",
|
|
"compare_use_quotes": true
|
|
}
|
|
],
|
|
"data_source": "script",
|
|
"show_ui": true,
|
|
"localized": [
|
|
"display_name",
|
|
"description",
|
|
"icon"
|
|
],
|
|
"display_name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Internet check"
|
|
}
|
|
],
|
|
"icon": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "<i class=\"fa-solid fa-globe\"></i>"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "A plugin to check your internet connectivity and IP."
|
|
}
|
|
],
|
|
"params": [
|
|
{
|
|
"name": "prev_ip",
|
|
"type": "sql",
|
|
"value": "SELECT dev_LastIP FROM Devices WHERE dev_MAC = 'Internet' "
|
|
},
|
|
{
|
|
"name": "DIG_GET_IP_ARG",
|
|
"type": "setting",
|
|
"value": "DIG_GET_IP_ARG",
|
|
"base64": true
|
|
}
|
|
],
|
|
"settings": [
|
|
{
|
|
"function": "RUN",
|
|
"events": ["run"],
|
|
"type": "text.select",
|
|
"default_value": "schedule",
|
|
"options": [
|
|
"disabled",
|
|
"once",
|
|
"schedule",
|
|
"always_after_scan"
|
|
],
|
|
"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 plugin should run. An hourly or daily <code>SCHEDULE</code> is a good option."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "CMD",
|
|
"type": "readonly",
|
|
"default_value": "python3 /home/pi/pialert/front/plugins/internet_ip/script.py prev_ip={prev_ip} DIG_GET_IP_ARG={DIG_GET_IP_ARG}",
|
|
"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",
|
|
"default_value": "*/5 * * * *",
|
|
"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=\"#INTRNT_RUN\"><code>INTRNT_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=\"#INTRNT_RUN\"><code>INTRNT_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=\"#INTRNT_RUN\"><code>INTRNT_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."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "WATCH",
|
|
"type": "text.multiselect",
|
|
"default_value": [
|
|
"Watched_Value1"
|
|
],
|
|
"options": [
|
|
"Watched_Value1",
|
|
"Watched_Value2",
|
|
"Watched_Value3",
|
|
"Watched_Value4"
|
|
],
|
|
"localized": [
|
|
"name",
|
|
"description"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Watched"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Visto"
|
|
}
|
|
],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Send a notification if selected values change. Use <code>CTRL + Click</code> to select/deselect. <ul> <li><code>Watched_Value1</code> is Previous IP (not recommended)</li><li><code>Watched_Value2</code> unused</li><li><code>Watched_Value3</code> unused </li><li><code>Watched_Value4</code> unused </li></ul>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "REPORT_ON",
|
|
"type": "text.multiselect",
|
|
"default_value":["new","watched-changed"],
|
|
"options": ["new","watched-changed","watched-not-changed", "missing-in-last-scan"],
|
|
"localized": ["name", "description"],
|
|
"name" :[{
|
|
"language_code":"en_us",
|
|
"string" : "Report on"
|
|
},
|
|
{
|
|
"language_code":"es_es",
|
|
"string" : "Informar sobre"
|
|
} ] ,
|
|
"description":[{
|
|
"language_code":"en_us",
|
|
"string" : "Send a notification only on these statuses. <code>new</code> means a new unique (unique combination of PrimaryId and SecondaryId) object was discovered. <code>watched-changed</code> means that selected <code>Watched_ValueN</code> columns changed."
|
|
},
|
|
{
|
|
"language_code":"es_es",
|
|
"string" : "Envíe una notificación solo en estos estados. <code>new</code> significa que se descubrió un nuevo objeto único (una combinación única de PrimaryId y SecondaryId). <code>watched-changed</code> significa que las columnas <code>Watched_ValueN</code> seleccionadas cambiaron."
|
|
}]
|
|
}
|
|
],
|
|
"database_column_definitions": [
|
|
{
|
|
"column": "Object_PrimaryID",
|
|
"mapped_to_column": "cur_MAC",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "device_name_mac",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "MAC"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "MAC"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Object_SecondaryID",
|
|
"mapped_to_column": "cur_IP",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "device_ip",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "IP"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "IP"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Watched_Value1",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Extra"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Dummy",
|
|
"mapped_to_column": "cur_ScanMethod",
|
|
"mapped_to_column_data": {
|
|
"value": "INTRNT"
|
|
},
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Scan method"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Método de escaneo"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "DateTimeCreated",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Created"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Creado"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "DateTimeChanged",
|
|
"mapped_to_column": "cur_DateTime",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": [
|
|
"name"
|
|
],
|
|
"name": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string": "Changed"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string": "Cambiado"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "Status",
|
|
"css_classes": "col-sm-1",
|
|
"show": true,
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |