online history - fix negative
This commit is contained in:
@@ -1125,6 +1125,10 @@ def scan_network ():
|
|||||||
# Sessions snapshot
|
# Sessions snapshot
|
||||||
file_print(' Creating sessions snapshot')
|
file_print(' Creating sessions snapshot')
|
||||||
create_sessions_snapshot ()
|
create_sessions_snapshot ()
|
||||||
|
|
||||||
|
# Sessions snapshot
|
||||||
|
file_print(' Inserting scan results into Online_History')
|
||||||
|
insertOnlineHistory()
|
||||||
|
|
||||||
# Skip repeated notifications
|
# Skip repeated notifications
|
||||||
file_print(' Skipping repeated notifications')
|
file_print(' Skipping repeated notifications')
|
||||||
@@ -1391,6 +1395,8 @@ def print_scan_stats ():
|
|||||||
(cycle,))
|
(cycle,))
|
||||||
file_print(' IP Changes.........: ' + str ( sql.fetchone()[0]) )
|
file_print(' IP Changes.........: ' + str ( sql.fetchone()[0]) )
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
def insertOnlineHistory():
|
||||||
# Add to History
|
# Add to History
|
||||||
sql.execute("SELECT * FROM Devices")
|
sql.execute("SELECT * FROM Devices")
|
||||||
History_All = sql.fetchall()
|
History_All = sql.fetchall()
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ $Pia_Graph_Device_Online = array();
|
|||||||
$Pia_Graph_Device_Down = array();
|
$Pia_Graph_Device_Down = array();
|
||||||
$Pia_Graph_Device_Arch = array();
|
$Pia_Graph_Device_Arch = array();
|
||||||
|
|
||||||
//$db = new SQLite3('../db/pialert.db');
|
|
||||||
$results = $db->query('SELECT * FROM Online_History ORDER BY Scan_Date DESC LIMIT 144');
|
$results = $db->query('SELECT * FROM Online_History ORDER BY Scan_Date DESC LIMIT 144');
|
||||||
while ($row = $results->fetchArray()) {
|
while ($row = $results->fetchArray()) {
|
||||||
$time_raw = explode(' ', $row['Scan_Date']);
|
$time_raw = explode(' ', $row['Scan_Date']);
|
||||||
|
|||||||
Reference in New Issue
Block a user