Advertisement
ksieradzinski

Untitled

May 14th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1.  
  2. def get_logs():
  3. with sqlite3.connect(DBNAME) as connection:
  4. connection.row_factory = sqlite3.Row
  5. cursor = connection.cursor()
  6. cursor.execute(
  7. """SELECT
  8. hosts.hostname,
  9. ping_time,
  10. timestamp
  11. FROM logs
  12. LEFT JOIN hosts ON logs.host_id=hosts.id
  13. ORDER BY timestamp DESC
  14. """
  15. )
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement