-
-
@@ -46,16 +31,14 @@
-
-
+
diff --git a/front/report_templates/report_template.txt b/front/report_templates/report_template.txt
index ce814751..8be4447b 100755
--- a/front/report_templates/report_template.txt
+++ b/front/report_templates/report_template.txt
@@ -1,8 +1,9 @@
-Report Date:
-Server:
-
+
+Report Date:
+Server:
+
\ No newline at end of file
diff --git a/front/report_templates/report_template_new_version.html b/front/report_templates/report_template_new_version.html
deleted file mode 100755
index 7abbd37a..00000000
--- a/front/report_templates/report_template_new_version.html
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- NetAlertx
- |
-
-
- |
- New version available
- |
-
-
-
- |
-
- |
-
-
-
- |
-
-
-
-
-
-
-
-
- |
-
-
-
- |
-
- |
-
-
-
-
-
diff --git a/front/report_templates/webhook_json_sample.json b/front/report_templates/webhook_json_sample.json
index be98f5f9..c252e4e6 100755
--- a/front/report_templates/webhook_json_sample.json
+++ b/front/report_templates/webhook_json_sample.json
@@ -18,37 +18,36 @@
"title_link": "",
"text": {
"new_devices_meta": {
- "title": "πNew devices",
- "columnNames": [
- "MAC",
- "Datetime",
- "IP",
- "Event Type",
- "Device name",
- "Comments"
- ]
+ "title": "π New devices",
+ "columnNames": [
+ "MAC",
+ "Datetime",
+ "IP",
+ "Event Type",
+ "Device name",
+ "Comments"
+ ]
},
"new_devices": [
{
- "MAC": "74:ac:74:ac:74:ac",
- "Datetime": "2023-01-30 22:15:09",
- "IP": "192.168.1.1",
+ "MAC": "00:1a:76:e3:26:4a",
+ "Datetime": "2025-01-06 11:05:00+11:00",
+ "IP": "192.168.1.82",
"Event Type": "New Device",
- "Device name": "(name not found)",
- "Comments": null,
- "Device Vendor": null
+ "Device name": "(unknown) TEST",
+ "Comments": ""
}
],
"down_devices_meta": {
- "title": "Down devices",
- "columnNames": [
- "MAC",
- "Datetime",
- "IP",
- "Event Type",
- "Device name",
- "Comments"
- ]
+ "title": "π΄ Down devices",
+ "columnNames": [
+ "devName",
+ "eve_MAC",
+ "devVendor",
+ "eve_IP",
+ "eve_DateTime",
+ "eve_EventType"
+ ]
},
"down_devices": [],
"events_meta": {
@@ -64,12 +63,12 @@
},
"down_reconnected": [
{
- "devName": "Phone - Pixel",
+ "devName": "Phone - Moto 82",
"eve_MAC": "74:ac:74:ac:74:ac",
- "devVendor": "Google",
+ "devVendor": "Motorola Mobility LLC, a Lenovo Company",
"eve_IP": "192.168.1.167",
- "DownTime": "2024-05-26 09:06:56+10:00",
- "ConnectedTime": "2024-05-26 09:13:24+10:00"
+ "eve_DateTime": "2025-01-11 10:05:01+11:00",
+ "eve_EventType": "Down Reconnected"
}
],
"down_reconnected_meta": {
@@ -79,8 +78,8 @@
"eve_MAC",
"devVendor",
"eve_IP",
- "DownTime",
- "ConnectedTime"
+ "eve_DateTime",
+ "eve_EventType"
]
},
"events": [
@@ -90,8 +89,7 @@
"IP": "192.168.1.92",
"Event Type": "Disconnected",
"Device name": "(name not found)",
- "Comments": null,
- "Device Vendor": null
+ "Comments": null
},
{
"MAC": "74:ac:74:ac:74:ac",
@@ -99,45 +97,34 @@
"IP": "192.168.1.150",
"Event Type": "Disconnected",
"Device name": "(name not found)",
- "Comments": null,
- "Device Vendor": null
+ "Comments": null
}
],
"plugins_meta": {
- "title": "Plugins",
+ "title": "π Plugins",
"columnNames": [
- "Plugin",
- "Object_PrimaryID",
- "Object_SecondaryID",
- "DateTimeChanged",
- "Watched_Value1",
- "Watched_Value2",
- "Watched_Value3",
- "Watched_Value4",
- "Status",
- "Extra",
- "UserData",
- "ForeignKey",
- "SyncHubNodeName"
+ "Plugin",
+ "Object_PrimaryID",
+ "Object_SecondaryID",
+ "DateTimeChanged",
+ "Watched_Value1",
+ "Watched_Value2",
+ "Watched_Value3",
+ "Watched_Value4",
+ "Status"
]
},
"plugins": [
{
- "Index": 138,
- "Plugin": "INTRSPD",
- "Object_PrimaryID": "Speedtest",
- "Object_SecondaryID": "2023-10-08 02:01:16+02:00",
- "DateTimeCreated": "2023-10-08 02:01:16",
- "DateTimeChanged": "2023-10-08 02:32:15",
- "Watched_Value1": "-1",
- "Watched_Value2": "-1",
- "Watched_Value3": "null",
- "Watched_Value4": "null",
- "Status": "missing-in-last-scan",
- "Extra": "null",
- "UserData": "null",
- "ForeignKey": "null",
- "SyncHubNodeName": "null"
+ "Plugin": "ARPSCAN",
+ "Object_PrimaryID": "74:ac:74:ac:74:ac",
+ "Object_SecondaryID": "192.168.1.114",
+ "DateTimeChanged": "2025-01-11 12:21:00",
+ "Watched_Value1": "192.168.1.114",
+ "Watched_Value2": "Microsoft Corporation",
+ "Watched_Value3": "192.168.1.0/24 --interface=eth1",
+ "Watched_Value4": "",
+ "Status": "new"
}
]
}
diff --git a/server/notification.py b/server/notification.py
index a2e106f9..a771488b 100755
--- a/server/notification.py
+++ b/server/notification.py
@@ -78,7 +78,8 @@ class Notification_obj:
# mylog('debug', ['[Notification] notiStruc:', json.dumps(notiStruc.__dict__, indent=4)])
Text = ""
- HTML = ""
+ HTML = ""
+ template_file_path = reportTemplatesPath + 'report_template.html'
# Open text Template
@@ -90,17 +91,17 @@ class Notification_obj:
# Open html Template
mylog('verbose', ['[Notification] Open html Template'])
- # select template type depoending if running latest version or an older one
- if conf.newVersionAvailable :
- template_file_path = reportTemplatesPath + 'report_template_new_version.html'
- else:
- template_file_path = reportTemplatesPath + 'report_template.html'
-
- mylog('verbose', ['[Notification] Using template', template_file_path])
template_file = open(template_file_path, 'r')
mail_html = template_file.read()
template_file.close()
+ # prepare new version text
+ newVersionText = ''
+ if conf.newVersionAvailable :
+ newVersionText = 'πA new version is available.'
+
+ mail_text = mail_text.replace ('', newVersionText)
+ mail_html = mail_html.replace ('', newVersionText)
# Report "REPORT_DATE" in Header & footer
timeFormated = timeNowTZ().strftime ('%Y-%m-%d %H:%M')
diff --git a/server/plugin.py b/server/plugin.py
index b517a777..6973c0c7 100755
--- a/server/plugin.py
+++ b/server/plugin.py
@@ -913,8 +913,6 @@ def handle_test(runType, db, all_plugins, pluginsState):
mylog('minimal', ['[', timeNowTZ(), '] [Test] START Test: ', runType])
# Prepare test samples
- sample_txt = get_file_content(reportTemplatesPath + 'report_sample.txt')
- sample_html = get_file_content(reportTemplatesPath + 'report_sample.html')
sample_json = json.loads(get_file_content(reportTemplatesPath + 'webhook_json_sample.json'))[0]["body"]["attachments"][0]["text"]
# Create fake notification
| |