Initial server monitoring system with port 80 support
Features: - Device management and monitoring dashboard - Remote command execution on devices via port 80 - Auto-update coordination for multiple devices - Database reset functionality with safety confirmations - Server logs filtering and dedicated logging interface - Device status monitoring and management - SQLite database for comprehensive logging - Web interface with Bootstrap styling - Comprehensive error handling and logging Key components: - server.py: Main Flask application with all routes - templates/: Complete web interface templates - data/database.db: SQLite database for device logs - UPDATE_SUMMARY.md: Development progress documentation
This commit is contained in:
19
Working_Files/initalizedb.py
Normal file
19
Working_Files/initalizedb.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import sqlite3
|
||||
def initialize_database():
|
||||
DATABASE = "data/database.db"
|
||||
with sqlite3.connect(DATABASE) as conn:
|
||||
cursor = conn.cursor()
|
||||
cursor.execute('''
|
||||
CREATE TABLE IF NOT EXISTS logs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
hostname TEXT NOT NULL,
|
||||
device_ip TEXT NOT NULL,
|
||||
nume_masa TEXT NOT NULL,
|
||||
timestamp TEXT NOT NULL,
|
||||
event_description TEXT NOT NULL
|
||||
)
|
||||
''')
|
||||
conn.commit()
|
||||
print("Database initialized")
|
||||
|
||||
initialize_database()
|
||||
Reference in New Issue
Block a user