X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/3742fa2929619a4c54a50d3e79e0eeadb4d6ca6f..2735ea768aa812998a9498cf411563f118bd6ad6:/src/nominatim_db/tools/collect_os_info.py?ds=sidebyside diff --git a/src/nominatim_db/tools/collect_os_info.py b/src/nominatim_db/tools/collect_os_info.py index db3e773d..fc921b20 100644 --- a/src/nominatim_db/tools/collect_os_info.py +++ b/src/nominatim_db/tools/collect_os_info.py @@ -15,7 +15,6 @@ from pathlib import Path from typing import List, Optional, Union import psutil -from psycopg2.extensions import make_dsn from ..config import Configuration from ..db.connection import connect, server_version_tuple, execute_scalar @@ -97,7 +96,7 @@ def report_system_information(config: Configuration) -> None: """Generate a report about the host system including software versions, memory, storage, and database configuration.""" - with connect(make_dsn(config.get_libpq_dsn(), dbname='postgres')) as conn: + with connect(config.get_libpq_dsn(), dbname='postgres') as conn: postgresql_ver: str = '.'.join(map(str, server_version_tuple(conn))) with conn.cursor() as cur: @@ -133,24 +132,25 @@ def report_system_information(config: Configuration) -> None: - PostgreSQL version: {postgresql_ver} - PostGIS version: {postgis_ver} - OS: {os_name_info()} - - + + **Hardware Configuration:** - RAM: {friendly_memory_string(psutil.virtual_memory().total)} - number of CPUs: {psutil.cpu_count(logical=False)} - - bare metal/AWS/other cloud service (per systemd-detect-virt(1)): {run_command("systemd-detect-virt")} + - bare metal/AWS/other cloud service (per systemd-detect-virt(1)): + {run_command("systemd-detect-virt")} - type and size of disks: **`df -h` - df - report file system disk space usage: ** ``` {run_command(["df", "-h"])} ``` - + **lsblk - list block devices: ** ``` {run_command("lsblk")} ``` - - + + **Postgresql Configuration:** ``` {postgresql_config}