From c56c7609cc48d82dda2958c409e4f5fa15c235fc Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Sat, 22 Jul 2023 12:28:27 +1000 Subject: [PATCH] Plugin tweaks --- front/plugins/README.md | 4 ++-- front/plugins/dhcp_servers/last_result.log | 1 + front/plugins/nmap_services/config.json | 8 ++++---- front/plugins/website_monitor/last_result.log | 4 ++-- front/plugins/website_monitor/script.log | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/front/plugins/README.md b/front/plugins/README.md index e8564117..7d05222d 100755 --- a/front/plugins/README.md +++ b/front/plugins/README.md @@ -251,7 +251,7 @@ Plugin entries can be filtered based on values entered into filter fields. The ` 7. Filters are only applied if a filter is specified and the `txtMacFilter` is not `undefined` or empty (`--`). -### Mapping the plugin results into a database table +### 🗺 Mapping the plugin results into a database table PiAlert will take the results of the plugin execution and insert these results into a database table, if a plugin contains the property `"mapped_to_table"` in the `config.json` root. The mapping of the columns is defined in the `database_column_definitions` array. @@ -426,7 +426,7 @@ You can have any `"function": "my_custom_name"` custom name, however, the ones l > } > ``` -##### Localized strings +##### 🌍Localized strings - `"language_code":""` - code name of the language string. Only these three are currently supported. At least the `"language_code":"en_us"` variant has to be defined. - `"string"` - The string to be displayed in the given language. diff --git a/front/plugins/dhcp_servers/last_result.log b/front/plugins/dhcp_servers/last_result.log index b7a0ef6f..19393e0e 100755 --- a/front/plugins/dhcp_servers/last_result.log +++ b/front/plugins/dhcp_servers/last_result.log @@ -32,3 +32,4 @@ 192.168.1.1|localdomain|2023-06-10 08:32:03|null|192.168.1.168|null|192.168.1.1|5m00s,255.255.255.0|192.168.1.1 192.168.1.1|localdomain|2023-06-10 11:03:18|null|192.168.1.168|null|192.168.1.1|5m00s,255.255.255.0|192.168.1.1 192.168.1.1|localdomain|2023-06-11 16:40:30|null|192.168.1.168|null|192.168.1.1|5m00s,255.255.255.0|192.168.1.1 +192.168.1.1|localdomain|2023-07-22 12:22:51|null|192.168.1.168|null|192.168.1.1|5m00s,255.255.255.0|192.168.1.1 diff --git a/front/plugins/nmap_services/config.json b/front/plugins/nmap_services/config.json index ef2f65a0..75680cb8 100755 --- a/front/plugins/nmap_services/config.json +++ b/front/plugins/nmap_services/config.json @@ -5,10 +5,10 @@ "data_source": "pialert-db-query", "data_filters": [ { - "compare_column" : "Object_PrimaryID", + "compare_column" : "ForeignKey", "compare_operator" : "==", "compare_field_id": "txtMacFilter", - "compare_js_template": "'{value}'.toString()", + "compare_js_template": "'{value}.toString()'", "compare_use_quotes": true } ], @@ -58,13 +58,13 @@ "column": "Object_PrimaryID", "css_classes": "col-sm-2", "show": true, - "type": "devicemac", + "type": "label", "default_value":"", "options": [], "localized": ["name"], "name":[{ "language_code":"en_us", - "string" : "Device MAC" + "string" : "Device name" }] }, { diff --git a/front/plugins/website_monitor/last_result.log b/front/plugins/website_monitor/last_result.log index 55fd0a4e..95754855 100755 --- a/front/plugins/website_monitor/last_result.log +++ b/front/plugins/website_monitor/last_result.log @@ -1,2 +1,2 @@ -https://google.com|null|2023-06-11 16:40:26|200|0.340850|null|null|null|null -https://duck.com|null|2023-06-11 16:40:26|200|0.051173|null|null|null|null +https://google.com|null|2023-07-22 12:22:47|200|0.492018|null|null|null|null +https://duck.com|null|2023-07-22 12:22:48|200|0.262285|null|null|null|null diff --git a/front/plugins/website_monitor/script.log b/front/plugins/website_monitor/script.log index 0dd6f711..9421be71 100755 --- a/front/plugins/website_monitor/script.log +++ b/front/plugins/website_monitor/script.log @@ -3,11 +3,11 @@ Pi.Alert [Prototype]: Current User: root Monitor Web-Services -Timestamp: 2023-06-11 16:40:25 +Timestamp: 2023-07-22 12:22:46 Start Services Monitoring | Timestamp | URL | StatusCode | ResponseTime | ----------------------------------------------- -2023-06-11 16:40:26 | https://google.com | 200 | 0.340850 -2023-06-11 16:40:26 | https://duck.com | 200 | 0.051173 +2023-07-22 12:22:47 | https://google.com | 200 | 0.492018 +2023-07-22 12:22:48 | https://duck.com | 200 | 0.262285