diff --git a/back/pialert.py b/back/pialert.py index dd60c646..7620c42c 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -1267,6 +1267,9 @@ def save_scanned_devices (p_arpscan_devices, p_cycle_interval): mylog('debug', [' Saving this IP into the CurrentScan table:', local_ip]) + if check_IP_format(local_ip) == '': + local_ip = '0.0.0.0' + # Check if local mac has been detected with other methods sql.execute ("SELECT COUNT(*) FROM CurrentScan WHERE cur_ScanCycle = ? AND cur_MAC = ? ", (cycle, local_mac) ) if sql.fetchone()[0] == 0 : diff --git a/front/plugins/README.md b/front/plugins/README.md index e7a10e5c..d86ca0f1 100755 --- a/front/plugins/README.md +++ b/front/plugins/README.md @@ -197,15 +197,15 @@ During script execution, the app will take the command `"python3 /home/pi/pialer 2) It finds `"name" : "urls"` 3) Checks the type of the `urls` params and finds `"type" : "setting"` 4) Gets the setting name from `"value" : "WEBMON_urls_to_check"` - - IMPORTANT: in the `config.json` this setting is identified by `"function":"urls_to_check"`, not `"function":"WEBMON_urls_to_check"` - - You can also use a global setting, or a setting from a different plugin + - IMPORTANT: in the `config.json` this setting is identified by `"function":"urls_to_check"`, not `"function":"WEBMON_urls_to_check"` + - You can also use a global setting, or a setting from a different plugin 5) The app gets the user defined value from the setting with the code name `WEBMON_urls_to_check` - - let's say the setting with the code name `WEBMON_urls_to_check` containes 2 values entered by the user: - - `WEBMON_urls_to_check=['https://google.com','https://duck.com']` + - let's say the setting with the code name `WEBMON_urls_to_check` contains 2 values entered by the user: + - `WEBMON_urls_to_check=['https://google.com','https://duck.com']` 6) The app takes the value from `WEBMON_urls_to_check` and replaces the `{urls}` wildcard in the setting where `"function":"CMD"`, so you go from: - - `python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls={urls}` - - to - - `python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls=https://google.com,https://duck.com` + - `python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls={urls}` + - to + - `python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls=https://google.com,https://duck.com` Below are some general additional notes, when definig `params`: