mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Merge pull request #47 from Final-Hawk/main
Bug Fixes and Improved NTFY
This commit is contained in:
@@ -356,9 +356,6 @@ def scan_network ():
|
||||
|
||||
# ScanCycle data
|
||||
cycle_interval = scanCycle_data['cic_EveryXmin']
|
||||
# arpscan_retries = scanCycle_data['cic_arpscanCycles'] no longer needed
|
||||
# TESTING - Fast scan
|
||||
# arpscan_retries = 1
|
||||
|
||||
# arp-scan command
|
||||
print ('\nScanning...')
|
||||
@@ -451,33 +448,12 @@ def query_ScanCycle_Data (pOpenCloseDB = False):
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def execute_arpscan ():
|
||||
|
||||
# #101 - arp-scan subnet configuration
|
||||
# Prepare command arguments
|
||||
subnets = SCAN_SUBNETS.strip().split()
|
||||
|
||||
# ---------------START----------------Rollback-----------------START---------------
|
||||
# rolled-back to previous code - arp-scan wouldn't discover all devices
|
||||
# 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
|
||||
|
||||
# Rolled back line(FROM) :
|
||||
#arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--bandwidth=512k', '--retry=3', SCAN_SUBNETS]
|
||||
# Rolled back line(TO) :
|
||||
# Retry is 6 to avoid false offline devices
|
||||
arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--retry=6'] + subnets
|
||||
# ---------------END------------------Rollback-----------------END---------------
|
||||
|
||||
# Default arp-scan
|
||||
# arpscan_args = ['sudo', 'arp-scan', SCAN_SUBNETS, '--ignoredups', '--retry=' + str(pRetries)]
|
||||
# print (arpscan_args)
|
||||
|
||||
# TESTING - Fast Scan
|
||||
# arpscan_args = ['sudo', 'arp-scan', '--localnet', '--ignoredups', '--retry=1']
|
||||
|
||||
# DEBUG - arp-scan command
|
||||
# print (" ".join (arpscan_args))
|
||||
|
||||
|
||||
# Execute command
|
||||
arpscan_output = subprocess.check_output (arpscan_args, universal_newlines=True)
|
||||
|
||||
@@ -491,9 +467,6 @@ def execute_arpscan ():
|
||||
devices_list = [device.groupdict()
|
||||
for device in re.finditer (re_pattern, arpscan_output)]
|
||||
|
||||
# Bugfix #5 - Delete duplicated MAC's with different IP's
|
||||
# TEST - Force duplicated device
|
||||
# devices_list.append(devices_list[0])
|
||||
# Delete duplicate MAC
|
||||
unique_mac = []
|
||||
unique_devices = []
|
||||
@@ -738,6 +711,16 @@ def create_new_devices ():
|
||||
WHERE dev_MAC = cur_MAC) """,
|
||||
(startTime, cycle) )
|
||||
|
||||
print_log ('New devices - Insert Connection into session table')
|
||||
sql.execute ("""INSERT INTO Sessions (ses_MAC, ses_IP, ses_EventTypeConnection, ses_DateTimeConnection,
|
||||
ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_StillConnected, ses_AdditionalInfo)
|
||||
SELECT cur_MAC, cur_IP,'Connected',?, NULL , NULL ,1, cur_Vendor
|
||||
FROM CurrentScan
|
||||
WHERE cur_ScanCycle = ?
|
||||
AND NOT EXISTS (SELECT 1 FROM Sessions
|
||||
WHERE ses_MAC = cur_MAC) """,
|
||||
(startTime, cycle) )
|
||||
|
||||
# arpscan - Create new devices
|
||||
print_log ('New devices - 2 Create devices')
|
||||
sql.execute ("""INSERT INTO Devices (dev_MAC, dev_name, dev_Vendor,
|
||||
@@ -965,17 +948,10 @@ def update_devices_data_from_scan ():
|
||||
sql.executemany ("UPDATE Devices SET dev_Vendor = ? WHERE dev_MAC = ? ",
|
||||
recordsToUpdate )
|
||||
|
||||
# New Apple devices -> Cycle 15
|
||||
# print_log ('Update devices - 6 Cycle for Apple devices')
|
||||
# sql.execute ("""UPDATE Devices SET dev_ScanCycle = 1
|
||||
# WHERE dev_FirstConnection = ?
|
||||
# AND UPPER(dev_Vendor) LIKE '%APPLE%' """,
|
||||
# (startTime,) )
|
||||
|
||||
print_log ('Update devices end')
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Feature #43 - Resoltion name for unknown devices
|
||||
# Feature #43 - Resolve name for unknown devices
|
||||
def update_devices_names ():
|
||||
# Initialize variables
|
||||
recordsToUpdate = []
|
||||
@@ -1204,9 +1180,9 @@ def email_reporting ():
|
||||
|
||||
# Disable reporting on events for devices where reporting is disabled based on the MAC address
|
||||
sql.execute ("""UPDATE Events SET eve_PendingAlertEmail = 0
|
||||
WHERE eve_PendingAlertEmail = 1 AND eve_MAC IN
|
||||
WHERE eve_PendingAlertEmail = 1 AND eve_EventType != 'Device Down' AND eve_MAC IN
|
||||
(
|
||||
SELECT dev_MAC FROM Devices WHERE dev_AlertEvents = 0
|
||||
SELECT dev_MAC FROM Devices WHERE dev_AlertEvents = 0
|
||||
)""")
|
||||
|
||||
# Open text Template
|
||||
@@ -1402,7 +1378,7 @@ def send_ntfy (_Text):
|
||||
data=_Text,
|
||||
headers={
|
||||
"Title": "Pi.Alert Notification",
|
||||
"Click": REPORT_DASHBOARD_URL,
|
||||
"Actions": "view, Open Dashboard, "+ REPORT_DASHBOARD_URL,
|
||||
"Priority": "urgent",
|
||||
"Tags": "warning"
|
||||
})
|
||||
@@ -1423,19 +1399,6 @@ def send_pushsafer (_Text):
|
||||
}
|
||||
requests.post(url, data=post_fields)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
def send_ntfy (_Text):
|
||||
requests.post("https://ntfy.sh/{}".format(NTFY_TOPIC),
|
||||
data=_Text,
|
||||
headers={
|
||||
"Title": "Pi.Alert Notification",
|
||||
"Click": REPORT_DASHBOARD_URL,
|
||||
"Priority": "urgent",
|
||||
"Tags": "warning"
|
||||
})
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def format_report_section (pActive, pSection, pTable, pText, pHTML):
|
||||
global mail_text
|
||||
|
||||
@@ -1,7 +1,32 @@
|
||||
cp pialert.conf pialert.conf.bak
|
||||
#!/bin/sh
|
||||
PIA_CONF_FILE='pialert.conf'
|
||||
PIA_PASS=$1
|
||||
echo "The password '$1' is hashed"
|
||||
PIA_PASS_HASH=$(echo -n $PIA_PASS | sha256sum | awk '{print $1}')
|
||||
echo "The hashed password is: $PIA_PASS_HASH"
|
||||
sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" pialert.conf
|
||||
echo "The hash was saved in the configuration file"
|
||||
echo "Check of key PIALERT_WEB_PROTECTION exists:"
|
||||
CHECK_PROT=$(grep "PIALERT_WEB_PROTECTION" $PIA_CONF_FILE | wc -l)
|
||||
if [ $CHECK_PROT -eq 0 ]
|
||||
then
|
||||
cp $PIA_CONF_FILE $PIA_CONF_FILE.bak1
|
||||
echo " Key not found. Key 'PIALERT_WEB_PROTECTION' will be created."
|
||||
echo " Check Config after the script is finished."
|
||||
sed -i "/^VENDORS_DB.*/a PIALERT_WEB_PROTECTION = False" $PIA_CONF_FILE > pialert.tmp
|
||||
else
|
||||
echo " Key exists. Nothing to do."
|
||||
fi
|
||||
echo ""
|
||||
echo "Check of key PIALERT_WEB_PASSWORD exists:"
|
||||
CHECK_PWD=$(grep "PIALERT_WEB_PASSWORD" $PIA_CONF_FILE | wc -l)
|
||||
if [ $CHECK_PWD -eq 0 ]
|
||||
then
|
||||
cp $PIA_CONF_FILE $PIA_CONF_FILE.bak2
|
||||
echo " Key not found. Key 'PIALERT_WEB_PASSWORD' will be created."
|
||||
echo " Check Config after the script is finished."
|
||||
echo " If the key is just created, please run the script again to set a new password".
|
||||
sed -i "/^PIALERT_WEB_PROTECTION.*/a PIALERT_WEB_PASSWORD = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'" $PIA_CONF_FILE
|
||||
else
|
||||
echo " The password '$1' is hashed"
|
||||
PIA_PASS_HASH=$(echo -n $PIA_PASS | sha256sum | awk '{print $1}')
|
||||
echo " The hashed password is:"
|
||||
echo " $PIA_PASS_HASH"
|
||||
sed -i "/PIALERT_WEB_PASSWORD/c\PIALERT_WEB_PASSWORD = '$PIA_PASS_HASH'" $PIA_CONF_FILE
|
||||
echo " The hash was saved in the configuration file"
|
||||
fi
|
||||
|
||||
@@ -664,6 +664,27 @@ input[type="password"]::-webkit-caps-lock-indicator {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.nav-tabs-custom > .nav-tabs > li:hover > a, .nav-tabs-custom > .nav-tabs > li.active:hover > a {
|
||||
background-color: #272c30;
|
||||
color: #bec5cb;
|
||||
}
|
||||
|
||||
.nav-tabs-custom > .nav-tabs > li.active > a, .nav-tabs-custom > .nav-tabs > li.active:hover > a {
|
||||
border-left-color: #30383f;
|
||||
border-right-color: #30383f;
|
||||
background-color: #272c30;
|
||||
color: #bec5cb;
|
||||
}
|
||||
.nav-tabs-custom > .nav-tabs {
|
||||
background-color: #353c42;
|
||||
}
|
||||
.nav-tabs-custom .tab-content {
|
||||
background-color: #272c30;
|
||||
}
|
||||
.top_small_box_gray_text {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
/* remove white border that appears on mobile screen sizes */
|
||||
.box-body {
|
||||
border: 0px;
|
||||
|
||||
@@ -1387,7 +1387,7 @@ function getSessionsPresenceEvents () {
|
||||
// Define Presence datasource and query data
|
||||
$('#calendar').fullCalendar('removeEventSources');
|
||||
$('#calendar').fullCalendar('addEventSource',
|
||||
{ url: 'php/server/events.php?action=getDevicePresence&mac=' + mac +'&period='+ period });
|
||||
{ url: 'php/server/events.php?action=getDevicePresence&mac=' + mac});
|
||||
|
||||
// Query events
|
||||
getDeviceEvents();
|
||||
|
||||
@@ -19,7 +19,7 @@ $config_file_lines_bypass = array_values(preg_grep('/^PIALERT_WEB_PROTECTION\s.*
|
||||
$protection_line = explode("=", $config_file_lines_bypass[0]);
|
||||
$Pia_WebProtection = strtolower(trim($protection_line[1]));
|
||||
|
||||
if ($Pia_WebProtection == 'false')
|
||||
if ($Pia_WebProtection != 'true')
|
||||
{
|
||||
header('Location: /pialert/devices.php');
|
||||
$_SESSION["login"] = 1;
|
||||
@@ -156,4 +156,4 @@ if ($ENABLED_DARKMODE === True) {
|
||||
<?php
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -214,7 +214,6 @@ if (submit && isset($_POST['langselector_set'])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab_Settings" data-toggle="tab"><?php echo $pia_lang['Maintenance_Tools_Tab_Settings'];?></a></li>
|
||||
@@ -311,6 +310,14 @@ if (submit && isset($_POST['langselector_set'])) {
|
||||
</div>
|
||||
<div class="db_tools_table_cell_b"><?php echo $pia_lang['Maintenance_Tool_del_allevents_text'];?></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="db_info_table_row">
|
||||
<div class="db_tools_table_cell_a" style="">
|
||||
<button type="button" class="btn btn-default pa-btn pa-btn-delete bg-red dbtools-button" id="btnDeleteActHistory" onclick="askDeleteActHistory()"><?php echo $pia_lang['Maintenance_Tool_del_ActHistory'];?></button>
|
||||
</div>
|
||||
<div class="db_tools_table_cell_b"><?php echo $pia_lang['Maintenance_Tool_del_ActHistory_text'];?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_BackupRestore">
|
||||
@@ -338,8 +345,6 @@ if (submit && isset($_POST['langselector_set'])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div style="width: 100%; height: 20px;"></div>
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
|
||||
@@ -354,7 +359,6 @@ if (submit && isset($_POST['langselector_set'])) {
|
||||
require 'php/templates/footer.php';
|
||||
?>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// delete devices with emty macs
|
||||
@@ -413,6 +417,20 @@ function deleteEvents()
|
||||
});
|
||||
}
|
||||
|
||||
// delete Hostory
|
||||
function askDeleteActHistory () {
|
||||
// Ask
|
||||
showModalWarning('<?php echo $pia_lang['Maintenance_Tool_del_ActHistory_noti'];?>', '<?php echo $pia_lang['Maintenance_Tool_del_ActHistory_noti_text'];?>',
|
||||
'Cancel', 'Delete', 'deleteActHistory');
|
||||
}
|
||||
function deleteActHistory()
|
||||
{
|
||||
// Execute
|
||||
$.get('php/server/devices.php?action=deleteActHistory', function(msg) {
|
||||
showMessage (msg);
|
||||
});
|
||||
}
|
||||
|
||||
// Backup DB to Archive
|
||||
function askPiaBackupDBtoArchive () {
|
||||
// Ask
|
||||
|
||||
@@ -51,6 +51,7 @@ function OpenDB () {
|
||||
}
|
||||
|
||||
$db = SQLite3_connect(true);
|
||||
$db->exec('PRAGMA journal_mode = wal;');
|
||||
if(!$db)
|
||||
{
|
||||
die ('Error connecting to database');
|
||||
|
||||
@@ -43,6 +43,7 @@ if (strlen($pia_lang_selected) == 0) {$pia_lang_selected = 'en_us';}
|
||||
case 'runScan1min': runScan1min(); break;
|
||||
case 'deleteUnknownDevices': deleteUnknownDevices(); break;
|
||||
case 'deleteEvents': deleteEvents(); break;
|
||||
case 'deleteActHistory': deleteActHistory(); break;
|
||||
case 'PiaBackupDBtoArchive': PiaBackupDBtoArchive(); break;
|
||||
case 'PiaRestoreDBfromArchive': PiaRestoreDBfromArchive(); break;
|
||||
case 'PiaPurgeDBBackups': PiaPurgeDBBackups(); break;
|
||||
@@ -272,6 +273,26 @@ function deleteEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Delete History
|
||||
//------------------------------------------------------------------------------
|
||||
function deleteActHistory() {
|
||||
global $db;
|
||||
global $pia_lang;
|
||||
|
||||
// sql
|
||||
$sql = 'DELETE FROM Online_History';
|
||||
// execute sql
|
||||
$result = $db->query($sql);
|
||||
|
||||
// check result
|
||||
if ($result == TRUE) {
|
||||
echo $pia_lang['BackDevices_DBTools_DelActHistory'];
|
||||
} else {
|
||||
echo $pia_lang['BackDevices_DBTools_DelActHistoryError']."\n\n$sql \n\n". $db->lastErrorMsg();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Backup DB to Archiv
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -358,7 +379,7 @@ function PiaPurgeDBBackups() {
|
||||
echo $pia_lang['BackDevices_DBTools_Purge'];
|
||||
echo("<meta http-equiv='refresh' content='1'>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Toggle Dark/Light Themes
|
||||
|
||||
@@ -225,7 +225,7 @@ function getDeviceSessions() {
|
||||
}
|
||||
|
||||
// Duration
|
||||
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == '<missing event>') {
|
||||
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeConnection'] == NULL || $row['ses_EventTypeDisconnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == NULL) {
|
||||
$dur = '...';
|
||||
} elseif ($row['ses_StillConnected'] == true) {
|
||||
$dur = formatDateDiff ($row['ses_DateTimeConnection'], ''); //***********
|
||||
@@ -261,7 +261,6 @@ function getDevicePresence() {
|
||||
|
||||
// Request Parameters
|
||||
$mac = $_REQUEST['mac'];
|
||||
$periodDate = getDateFromPeriod();
|
||||
$startDate = '"'. formatDateISO ($_REQUEST ['start']) .'"';
|
||||
$endDate = '"'. formatDateISO ($_REQUEST ['end']) .'"';
|
||||
|
||||
|
||||
@@ -220,31 +220,37 @@ $pia_lang['Maintenance_Tool_purgebackup'] = 'Sicherungen aufräumen';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_text'] = 'Es werden, bis auf die letzten 3 Backups, alle übrigen Backups gelöscht.';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti'] = 'Sicherungen aufräumen';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti_text'] = 'Sind Sie sicher, alle Backups, bis auf die letzten 3 löschen möchten?';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory'] = 'Löschen der Netzwerkaktivität';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_text'] = 'Der Graph für die Netzwerkaktivität wird zurückgesetzt. Hierbei werden die Events nicht beeinflusst.';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_noti'] = 'Netzwerkaktivität löschen';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_noti_text'] = 'Sind Sie sicher, dass Sie die Netzwerkaktivität zurücksetzen möchten?';
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Maintenance Page
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
$pia_lang['BackDevices_Arpscan_disabled'] = 'Automatischer Arp-Scan deaktiviert';
|
||||
$pia_lang['BackDevices_Arpscan_enabled'] = 'Automatischer Arp-Scan aktiviert';
|
||||
$pia_lang['BackDevices_darkmode_disabled'] = 'Heller Modus aktiviert';
|
||||
$pia_lang['BackDevices_darkmode_enabled'] = 'Dunkler Modus aktiviert';
|
||||
$pia_lang['BackDevices_Arpscan_disabled'] = 'Automatischer Arp-Scan deaktiviert.';
|
||||
$pia_lang['BackDevices_Arpscan_enabled'] = 'Automatischer Arp-Scan aktiviert.';
|
||||
$pia_lang['BackDevices_darkmode_disabled'] = 'Heller Modus aktiviert.';
|
||||
$pia_lang['BackDevices_darkmode_enabled'] = 'Dunkler Modus aktiviert.';
|
||||
$pia_lang['BackDevices_Restore_CopError'] = 'Die originale Datenbank konnte nicht kopiert werden.';
|
||||
$pia_lang['BackDevices_Restore_okay'] = 'Die Wiederherstellung wurde erfolgreich ausgeführt';
|
||||
$pia_lang['BackDevices_Restore_okay'] = 'Die Wiederherstellung wurde erfolgreich ausgeführt.';
|
||||
$pia_lang['BackDevices_Restore_Failed'] = 'Die Wiederherstellung ist fehlgeschlagen. Stellen Sie das Backup manuell her.';
|
||||
$pia_lang['BackDevices_Backup_CopError'] = 'Die originale Datenbank konnte nicht gesichert werden.';
|
||||
$pia_lang['BackDevices_Backup_okay'] = 'Das Backup wurde erfolgreich beendet';
|
||||
$pia_lang['BackDevices_Backup_okay'] = 'Das Backup wurde erfolgreich beendet.';
|
||||
$pia_lang['BackDevices_Backup_Failed'] = 'Das Backup wurde teilweise ausgeführt. Das Archiv ist entweder leer oder nicht vorhanden.';
|
||||
$pia_lang['BackDevices_DBTools_DelDev_a'] = 'Gerät erfolgreich gelöscht';
|
||||
$pia_lang['BackDevices_DBTools_DelDev_b'] = 'Geräte erfolgreich gelöscht';
|
||||
$pia_lang['BackDevices_DBTools_DelEvents'] = 'Events erfolgreich gelöscht';
|
||||
$pia_lang['BackDevices_DBTools_DelEventsError'] = 'Fehler beim Löschen der Ereignisse';
|
||||
$pia_lang['BackDevices_DBTools_DelDevError_a'] = 'Fehler beim Löschen des Gerätes';
|
||||
$pia_lang['BackDevices_DBTools_DelDevError_b'] = 'Fehler beim Löschen der Geräte';
|
||||
$pia_lang['BackDevices_DBTools_UpdDev'] = 'Gerät erfolgreich aktualisiert';
|
||||
$pia_lang['BackDevices_DBTools_UpdDevError'] = 'Fehler beim Aktualisieren des Gerätes';
|
||||
$pia_lang['BackDevices_DBTools_Upgrade'] = 'Datenbank erfolgreich aktualisiert';
|
||||
$pia_lang['BackDevices_DBTools_UpgradeError'] = 'Fehler beim Aktualisieren der Datenbank';
|
||||
$pia_lang['BackDevices_DBTools_Purge'] = 'Die ältesten Backups wurden gelöscht';
|
||||
$pia_lang['BackDevices_DBTools_DelDev_a'] = 'Gerät erfolgreich gelöscht.';
|
||||
$pia_lang['BackDevices_DBTools_DelDev_b'] = 'Geräte erfolgreich gelöscht.';
|
||||
$pia_lang['BackDevices_DBTools_DelEvents'] = 'Events erfolgreich gelöscht.';
|
||||
$pia_lang['BackDevices_DBTools_DelEventsError'] = 'Fehler beim Löschen der Ereignisse.';
|
||||
$pia_lang['BackDevices_DBTools_DelDevError_a'] = 'Fehler beim Löschen des Gerätes.';
|
||||
$pia_lang['BackDevices_DBTools_DelDevError_b'] = 'Fehler beim Löschen der Geräte.';
|
||||
$pia_lang['BackDevices_DBTools_UpdDev'] = 'Gerät erfolgreich aktualisiert.';
|
||||
$pia_lang['BackDevices_DBTools_UpdDevError'] = 'Fehler beim Aktualisieren des Gerätes.';
|
||||
$pia_lang['BackDevices_DBTools_Upgrade'] = 'Datenbank erfolgreich aktualisiert.';
|
||||
$pia_lang['BackDevices_DBTools_UpgradeError'] = 'Fehler beim Aktualisieren der Datenbank.';
|
||||
$pia_lang['BackDevices_DBTools_Purge'] = 'Die ältesten Backups wurden gelöscht.';
|
||||
$pia_lang['BackDevices_DBTools_DelActHistory'] = 'Die Anzeige der Netzwerkaktivität wurde zurückgesetzt.';
|
||||
$pia_lang['BackDevices_DBTools_DelActHistoryError'] = 'Fehler beim Zurücksetzen der Netzwerkaktivitätsanzeige.';
|
||||
?>
|
||||
|
||||
|
||||
@@ -220,6 +220,10 @@ $pia_lang['Maintenance_Tool_purgebackup'] = 'Purge Backups';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_text'] = 'All other backups will be deleted except for the last 3 backups.';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti'] = 'Purge Backups';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti_text'] = 'Are you sure you want to delete all backups except the last 3?';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory'] = 'Deleting the network activity';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_text'] = 'The network activity graph is reset. This does not affect the events.';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_noti'] = 'Delete network activity';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_noti_text'] = 'Are you sure you want to reset the network activity?';
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Maintenance Page
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Device Page - by @TeroRERO 23jul2022
|
||||
// Device Page - Update by @TeroRERO 25jul2022
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
$pia_lang['Navigation_Devices'] = 'Dispositivos';
|
||||
@@ -36,7 +36,7 @@ $pia_lang['Device_Table_nav_next'] = 'Siguiente';
|
||||
$pia_lang['Device_Table_nav_prev'] = 'Anterior';
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Presence Page - by @TeroRERO 23jul2022
|
||||
// Presence Page - Update by @TeroRERO 25jul2022
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
$pia_lang['Presence_Title'] = 'Historial por dispositivo';
|
||||
@@ -57,7 +57,7 @@ $pia_lang['Presence_CalHead_month'] = 'mes';
|
||||
$pia_lang['Presence_CalHead_week'] = 'semana';
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Events Page - by @TeroRERO 23jul2022
|
||||
// Events Page - Update by @TeroRERO 25jul2022
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
$pia_lang['Events_Title'] = 'Eventos';
|
||||
@@ -93,7 +93,7 @@ $pia_lang['Events_Table_nav_next'] = 'Siguiente';
|
||||
$pia_lang['Events_Table_nav_prev'] = 'Anterior';
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Device Details Page - by @TeroRERO 23jul2022
|
||||
// Device Details Page - Update by @TeroRERO 25jul2022
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
$pia_lang['DevDetail_Periodselect_today'] = 'Hoy';
|
||||
@@ -154,7 +154,7 @@ $pia_lang['DevDetail_Nmap_buttonDefault_text'] = 'Escaneo predeterminado: NMAP e
|
||||
$pia_lang['DevDetail_Nmap_buttonDetail_text'] = 'Escaneo detallado: escaneo predeterminado con detección de sistema operativo habilitado, detección de versiones, escaneo de script y traceroute (hasta 30 segundos o más)';
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Maintenance Page - by @TeroRERO 23jul2022
|
||||
// Maintenance Page - Update by @TeroRERO 25jul2022
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
$pia_lang['Maintenance_Title'] = 'Herramientas de mantenimiento';
|
||||
@@ -216,13 +216,17 @@ $pia_lang['Maintenance_Tool_restore'] = 'Restaurar DB';
|
||||
$pia_lang['Maintenance_Tool_restore_text'] = 'La última copia de seguridad se puede restaurar a través del botón, pero las copias de seguridad anteriores solo se pueden restaurar manualmente. Después de la restauración, realice una verificación de integridad en la base de datos por seguridad, en caso de que el DB estuviera actualmente en acceso de escritura cuando se creó la copia de seguridad.';
|
||||
$pia_lang['Maintenance_Tool_restore_noti'] = 'Restaurar DB';
|
||||
$pia_lang['Maintenance_Tool_restore_noti_text'] = '¿Estás seguro de que quieres hacer exactos la restauración de DB? Asegúrese de que ningún escaneo se esté ejecutando actualmente.';
|
||||
$pia_lang['Maintenance_Tool_purgebackup'] = 'Purge Backups';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_text'] = 'All other backups will be deleted except for the last 3 backups.';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti'] = 'Purge Backups';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti_text'] = 'Are you sure you want to delete all backups except the last 3?';
|
||||
$pia_lang['Maintenance_Tool_purgebackup'] = 'Purgar Respaldos';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_text'] = 'Todas las copias de seguridad serán eliminadas, excepto las 3 últimas.';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti'] = 'Purgar Respaldos';
|
||||
$pia_lang['Maintenance_Tool_purgebackup_noti_text'] = '¿Está seguro de borrar todas las copias de seguridad excepto las 3 últimas?';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory'] = 'Eliminar la actividad de la red';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_text'] = 'El gráfico de actividad de la red se resetea. Esto no afecta a los eventos.';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_noti'] = 'Borrar la actividad de la red';
|
||||
$pia_lang['Maintenance_Tool_del_ActHistory_noti_text'] = '¿Está seguro de restablecer la actividad de la red?';
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Maintenance Page - by @TeroRERO 23jul2022
|
||||
// Maintenance Page - Update by @TeroRERO 25jul2022
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
$pia_lang['BackDevices_Arpscan_disabled'] = 'Arp-Scan Desactivado';
|
||||
@@ -245,6 +249,5 @@ $pia_lang['BackDevices_DBTools_UpdDev'] = 'Dispositivo actualizado con éxito';
|
||||
$pia_lang['BackDevices_DBTools_UpdDevError'] = 'Error al actualizar el dispositivo';
|
||||
$pia_lang['BackDevices_DBTools_Upgrade'] = 'Base de datos actualizada correctamente';
|
||||
$pia_lang['BackDevices_DBTools_UpgradeError'] = 'Falló la actualización de la base de datos';
|
||||
$pia_lang['BackDevices_DBTools_Purge'] = 'The oldest backups were deleted';
|
||||
$pia_lang['BackDevices_DBTools_Purge'] = 'Las copias de seguridad más antiguas fueron eliminadas';
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
DB_NAME="pialert.db"
|
||||
echo "Create backup before insert new table"
|
||||
cp ../db/pialert.db ../db/pialert.db.bak
|
||||
echo "Insert new table 'Online_History' to pialert.db"
|
||||
sqlite3 ../db/pialert.db "CREATE TABLE 'Online_History' ('Index' INTEGER, 'Scan_Date' TEXT, 'Online_Devices' INTEGER, 'Down_Devices' INTEGER, 'All_Devices' INTEGER, 'Archived_Devices' INTEGER, PRIMARY KEY('Index' AUTOINCREMENT));"
|
||||
cp ../db/$DB_NAME ../db/pialert.db.bak
|
||||
echo "Insert new table 'Online_History' to $DB_NAME"
|
||||
sqlite3 ../db/$DB_NAME "CREATE TABLE 'Online_History' ('Index' INTEGER, 'Scan_Date' TEXT, 'Online_Devices' INTEGER, 'Down_Devices' INTEGER, 'All_Devices' INTEGER, 'Archived_Devices' INTEGER, PRIMARY KEY('Index' AUTOINCREMENT));"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user