diff --git a/back/pialert.py b/back/pialert.py index 9d7708c3..f91392a1 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -456,7 +456,7 @@ def execute_arpscan (pRetries): # arp-scan for larger Networks like /16 # otherwise the system starts multiple processes. the 15min cronjob isn't necessary. # the scan is about 4min on a /16 network - arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--bandwidth=512k', '--retry=3', SCAN_SUBNETS] + arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--bandwidth=512k', '--retry=2', SCAN_SUBNETS] # Default arp-scan # arpscan_args = ['sudo', 'arp-scan', SCAN_SUBNETS, '--ignoredups', '--retry=' + str(pRetries)] @@ -701,12 +701,15 @@ def print_scan_stats (): sql.execute("SELECT * FROM Devices") History_All = sql.fetchall() History_All_Devices = len(History_All) + sql.execute("SELECT * FROM Devices WHERE dev_Archived = 1") + History_Archived = sql.fetchall() + History_Archived_Devices = len(History_Archived) sql.execute("SELECT * FROM CurrentScan") History_Online = sql.fetchall() History_Online_Devices = len(History_Online) - History_Offline_Devices = History_All_Devices - History_Online_Devices - sql.execute ("INSERT INTO Online_History (Scan_Date, Online_Devices, Down_Devices, All_Devices) "+ - "VALUES ( ?, ?, ?, ?)", (startTime, History_Online_Devices, History_Offline_Devices, History_All_Devices ) ) + History_Offline_Devices = History_All_Devices - History_Archived_Devices - History_Online_Devices + sql.execute ("INSERT INTO Online_History (Scan_Date, Online_Devices, Down_Devices, All_Devices, Archived_Devices) "+ + "VALUES ( ?, ?, ?, ?, ?)", (startTime, History_Online_Devices, History_Offline_Devices, History_All_Devices, History_Archived_Devices ) ) #------------------------------------------------------------------------------- def create_new_devices (): diff --git a/front/devices.php b/front/devices.php index ec388348..5cba1fbd 100644 --- a/front/devices.php +++ b/front/devices.php @@ -118,7 +118,8 @@ var pia_js_online_history_time = []; var pia_js_online_history_ondev = []; var pia_js_online_history_dodev = []; - pia_draw_graph_online_history(pia_js_online_history_time, pia_js_online_history_ondev, pia_js_online_history_dodev); + var pia_js_online_history_ardev = []; + pia_draw_graph_online_history(pia_js_online_history_time, pia_js_online_history_ondev, pia_js_online_history_dodev, pia_js_online_history_ardev); diff --git a/front/js/graph_online_history.js b/front/js/graph_online_history.js index 65d672bd..268acdc4 100644 --- a/front/js/graph_online_history.js +++ b/front/js/graph_online_history.js @@ -1,24 +1,30 @@ -function pia_draw_graph_online_history(pia_js_graph_online_history_time, pia_js_graph_online_history_ondev, pia_js_graph_online_history_dodev) { +function pia_draw_graph_online_history(pia_js_graph_online_history_time, pia_js_graph_online_history_ondev, pia_js_graph_online_history_dodev, pia_js_graph_online_history_ardev) { var xValues = pia_js_graph_online_history_time; new Chart("OnlineChart", { type: "bar", data: { labels: xValues, datasets: [{ - label: 'Online Devices', + label: 'Online', data: pia_js_graph_online_history_ondev, - borderColor: "#00a65a", + borderColor: "rgba(0, 166, 89)", fill: true, backgroundColor: "rgba(0, 166, 89, .6)", pointStyle: 'circle', pointRadius: 3, pointHoverRadius: 3 }, { - label: 'Offline/Down Devices', + label: 'Offline/Down', data: pia_js_graph_online_history_dodev, - borderColor: "#dd4b39", + borderColor: "rgba(222, 74, 56)", fill: true, backgroundColor: "rgba(222, 74, 56, .6)", + }, { + label: 'Archived', + data: pia_js_graph_online_history_ardev, + borderColor: "rgba(220,220,220)", + fill: true, + backgroundColor: "rgba(220,220,220, .6)", }] }, options: { diff --git a/front/maintenance.php b/front/maintenance.php index 51462c18..b261011f 100644 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -209,7 +209,7 @@ if (submit && isset($_POST['langselector_set'])) {