{ "code_name": "kea_api", "unique_prefix": "KEALSS", "plugin_type": "device_scanner", "execution_order" : "Layer_3", "enabled": true, "data_source": "script", "data_filters": [ { "compare_column": "objectPrimaryId", "compare_operator": "==", "compare_field_id": "txtMacFilter", "compare_js_template": "'{value}'.toString()", "compare_use_quotes": true } ], "show_ui": true, "localized": ["display_name", "description", "icon"], "mapped_to_table": "CurrentScan", "display_name": [{"language_code": "en_us", "string": "Kea DHCP API"}], "icon": [{"language_code": "en_us", "string": ""}], "description": [{"language_code": "en_us", "string": "Imports leases via Kea Control Agent REST API"}], "database_column_definitions": [ { "column": "index", "css_classes": "col-sm-2", "show": true, "type": "none", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "Index"}] }, { "column": "objectPrimaryId", "mapped_to_column": "scanMac", "css_classes": "col-sm-2", "show": true, "type": "device_mac", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "MAC address"}] }, { "column": "objectSecondaryId", "mapped_to_column": "scanLastIP", "css_classes": "col-sm-2", "show": true, "type": "device_ip", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "IP" }] }, { "column": "dateTimeCreated", "css_classes": "col-sm-2", "show": true, "type": "label", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "Created"}] }, { "column": "dateTimeChanged", "mapped_to_column": "scanLastConnection", "css_classes": "col-sm-2", "show": true, "type": "label", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "Changed"}] }, { "column": "watchedValue1", "css_classes": "col-sm-2", "show": true, "type": "label", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "Is active"}] }, { "column": "watchedValue2", "mapped_to_column": "scanName", "css_classes": "col-sm-2", "show": true, "type": "label", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "Hostname"}] }, { "column": "watchedValue4", "css_classes": "col-sm-2", "show": true, "type": "label", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "State"}] }, { "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": "Dummy", "mapped_to_column": "scanSourcePlugin", "mapped_to_column_data": { "value": "KEALSS" }, "css_classes": "col-sm-2", "show": false, "type": "label", "default_value": "", "options": [], "localized": ["name"], "name": [{"language_code": "en_us", "string": "Scan method"}] }, { "column": "status", "css_classes": "col-sm-1", "show": true, "type": "replace", "default_value": "", "options": [ { "equals": "watched-not-changed", "replacement": "
" }, { "equals": "watched-changed", "replacement": "
" }, { "equals": "new", "replacement": "
" }, { "equals": "missing-in-last-scan", "replacement": "
" } ], "localized": ["name"], "name": [{"language_code": "en_us", "string": "Status"}] } ], "settings": [ { "function": "RUN", "events": ["run"], "type": { "dataType": "string", "elements": [{"elementType": "select", "elementOptions": [], "transformers": []}] }, "default_value": "disabled", "options": [ "disabled", "once", "schedule", "always_after_scan", "on_new_device" ], "localized": ["name", "description"], "name": [{"language_code": "en_us", "string": "When to run"}], "description": [ { "language_code": "en_us", "string": "Enable import of devices from Kea API. If you select schedule the scheduling settings from below are applied. If you select once the scan is run only once on start of the application (container) or after you update your settings. ⚠ Use the same schedule if you have multiple Device scanners enabled." } ] }, { "function": "CMD", "type": { "dataType": "string", "elements": [ { "elementType": "input", "elementOptions": [], "transformers": [] } ] }, "default_value": "python3 /app/front/plugins/kea_api/script.py", "options": [], "localized": ["name", "description"], "name": [{"language_code": "en_us", "string": "Command"}], "description": [{"language_code": "en_us", "string": "Command to run"}] }, { "function": "URL", "localized": ["name", "description"], "name": [{"language_code": "en_us", "string": "API URL"}], "description": [{"language_code": "en_us", "string": "Kea Control Agent URL"}], "type": { "dataType": "string", "elements": [ { "elementType": "input", "elementOptions": [], "transformers": [] } ] }, "default_value": "http://127.0.0.1:8000" }, { "function": "USER", "localized": ["name", "description"], "name": [{"language_code": "en_us", "string": "API User"}], "description": [{"language_code": "en_us", "string": "Basic Auth Username"}], "type": { "dataType": "string", "elements": [ { "elementType": "input", "elementOptions": [], "transformers": [] } ] }, "default_value": "kea-api" }, { "function": "PASS", "localized": ["name", "description"], "name": [{"language_code": "en_us", "string": "API Password"}], "description": [{"language_code": "en_us", "string": "Basic Auth Password"}], "type": { "dataType": "string", "elements": [ { "elementType": "input", "elementOptions": [{"type": "password"}], "transformers": [] } ] }, "default_value": "" }, { "function": "RUN_SCHD", "type": { "dataType": "string", "elements": [ { "elementType": "span", "elementOptions": [ { "cssClasses": "input-group-addon validityCheck" }, { "getStringKey": "Gen_ValidIcon" } ], "transformers": [] }, { "elementType": "input", "elementOptions": [ { "focusout": "validateRegex(this)" }, { "base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldKyg/Oi9bMC05XSspP3xcKi9bMC05XSspKSg/OiwoPzpbMC05XXxbMS01XVswLTldfFswLTldKy1bMC05XSsoPzovWzAtOV0rKT98XCovWzAtOV0rKSkqXHMrKD86XCp8KD86WzAtOV18MVswLTldfDJbMC0zXXxbMC05XSstWzAtOV0rKD86L1swLTldKyk/fFwqL1swLTldKykpKD86LCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldKyg/Oi9bMC05XSspP3xcKi9bMC05XSspKSpccysoPzpcKnwoPzpbMS05XXxbMTJdWzAtOV18M1swMV18WzAtOV0rLVswLTldKyg/Oi9bMC05XSspP3xcKi9bMC05XSspKSg/OiwoPzpbMS05XXxbMTJdWzAtOV18M1swMV18WzAtOV0rLVswLTldKyg/Oi9bMC05XSspP3xcKi9bMC05XSspKSpccysoPzpcKnwoPzpbMS05XXwxWzAtMl18WzAtOV0rLVswLTldKyg/Oi9bMC05XSspP3xcKi9bMC05XSspKSg/OiwoPzpbMS05XXwxWzAtMl18WzAtOV0rLVswLTldKyg/Oi9bMC05XSspP3xcKi9bMC05XSspKSpccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XSg/Oi9bMC05XSspP3xcKi9bMC05XSspKSg/OiwoPzpbMC02XXxbMC02XS1bMC02XSg/Oi9bMC05XSspP3xcKi9bMC05XSspKSok" } ], "transformers": [] } ] }, "default_value": "0 2 * * *", "options": [], "localized": ["name", "description"], "name": [ { "language_code": "en_us", "string": "Schedule" } ], "description": [ { "language_code": "en_us", "string": "Only enabled if you select schedule in the KEALSS_RUN setting. Make sure you enter the schedule in the correct cron-like format (e.g. validate at crontab.guru). For example entering 0 4 * * * will run the scan after 4 am in the TIMEZONE you set above. Will be run NEXT time the time passes.
It's recommended to use the same schedule interval for all plugins responsible for discovering new devices." } ] }, { "function": "RUN_TIMEOUT", "type": { "dataType": "integer", "elements": [ { "elementType": "input", "elementOptions": [{ "type": "number" }], "transformers": [] } ] }, "default_value": 10, "options": [], "localized": ["name", "description"], "name": [ { "language_code": "en_us", "string": "Run timeout" } ], "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." } ] }, { "function": "SET_ALWAYS", "type": { "dataType": "array", "elements": [ { "elementType": "select", "elementOptions": [{ "multiple": "true", "orderable": "true"}], "transformers": [] } ] }, "default_value": ["devMac", "devLastIP"], "options": [ "devMac", "devLastIP" ], "localized": ["name", "description"], "name": [ { "language_code": "en_us", "string": "Set always columns" } ], "description": [ { "language_code": "en_us", "string": "These columns are treated as authoritative and will overwrite existing values, including those set by other plugins, unless the current value was explicitly set by the user (Source = USER or Source = LOCKED)." } ] }, { "function": "SET_EMPTY", "type": { "dataType": "array", "elements": [ { "elementType": "select", "elementOptions": [{ "multiple": "true", "orderable": "true" }], "transformers": [] } ] }, "default_value": [], "options": [ "devMac", "devLastIP", "devName", "devSourcePlugin" ], "localized": ["name", "description"], "name": [ { "language_code": "en_us", "string": "Set empty columns" } ], "description": [ { "language_code": "en_us", "string": "These columns are only overwritten if they are empty (NULL / empty string) or if their Source is set to NEWDEV" } ] }, { "function": "WATCH", "type": { "dataType": "array", "elements": [ { "elementType": "select", "elementOptions": [{ "multiple": "true", "orderable": "true"}], "transformers": [] } ] }, "default_value": ["watchedValue1", "watchedValue4"], "options": [ "watchedValue1", "watchedValue2", "watchedValue4" ], "localized": ["name", "description"], "name": [ { "language_code": "en_us", "string": "Watched" } ], "description": [ { "language_code": "en_us", "string": "Send a notification if selected values change. Use CTRL + Click to select/deselect. " } ] }, { "function": "REPORT_ON", "type": { "dataType": "array", "elements": [ { "elementType": "select", "elementOptions": [{ "multiple": "true", "orderable": "true"}], "transformers": [] } ] }, "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" } ], "description": [ { "language_code": "en_us", "string": "Send a notification only on these statuses. new means a new unique (unique combination of PrimaryId and SecondaryId) object was discovered. watched-changed means that selected watchedValueN columns changed." } ] } ] }