3 Description="The purpose of this script is to collect system information for bug reports.\n
4 Submit issues to https://github.com/osm-search/Nominatim/issues"
7 ####### Gather the Information ##################################################
8 # Separate the information gathering from the report generation. Dividing these
9 # makes it easier to make trivial changes by not have to learn the other portion
13 # NOTE: Getting this version will NOT work if it is being ran from in another
14 # folder than Nominatim/utils. It call python3 to import version.py locally and
15 # prints it in the version format.
16 NominatimVersion=`cd ../nominatim/ && python3 -c "import version; print('{0[0]}.{0[1]}.{0[2]}-{0[3]}'.format(version.NOMINATIM_VERSION))"`
19 PostgreSQLVersion=`postgres --version`
22 PostgreSQLVersion="Not installed"
26 # The command for this should look something like this:
27 # psql -U nominatim -d mydatabase -c 'SELECT PostGIS_full_version();'
28 # ASSUME the username is nominatim
29 # This needs to be ran under the account with the appropriate permissions.
30 # This has been left blank.
33 # There are different ways to getting the Linux OS information.
34 # https://www.cyberciti.biz/faq/how-to-check-os-version-in-linux-command-line/
35 # /etc/os-release has a number of representations of the OS
36 # PRETTY_NAME is pity.
37 OperatingSystem=`grep '^PRETTY_NAME' /etc/os-release | cut -d'=' -f2`
39 RAM=`grep ^MemTotal /proc/meminfo | cut -d':' -f2`
41 # In /proc/cupinfo: siblings seems to refer to total cores like hyperthreaded cores.
42 # The hyperthreaded cores could be included if that is needed.
43 NumCPUs=`grep '^cpu cores' /proc/cpuinfo | head -1 | cut -d':' -f2`
46 # - type and size of disks:
47 # could use `sudo fdisk -l` or `mount` to print this, but snaps have made this
48 # worse than useless with loop devices on Ubuntu.
49 # `df -h` - show the free space on drives
50 # `lsblk` - this tell you what the server has not necessarily this machine. So in a container environment
51 # (like docker) this wouldn't be the correct report.
52 # This guide shows ways to get various storage device information: https://www.cyberciti.biz/faq/find-hard-disk-hardware-specs-on-linux/
54 # - bare metal/AWS/other cloud service:
55 # Unsure of how to detect this, but it might be useful for reporting disk storage.
56 # One options would be to prompt the user something like this:
57 # Enter system configuration (1) bare metal (2) AWS (3) Other Cloud (4) Docker (5) Other: _
59 # ------ What do these commands do? -------------------------------------------
60 # "cut -d':' -f2" command take the line and splits it at the semicolon(:)
61 # and returns the portion in the second (2nd) "field"
63 # "head -1" returns the first line that matches
66 ####### Print the Markdown Report ######################################################
67 # 1>&2 redirects echo to print to stderr instead of stdout
70 echo -e $Description 1>&2
71 echo Copy and paste or redirect the output of the file: 1>&2
72 echo " \$ ./collect_os_info.sh > report.md" 1>&2
76 echo "**Software Environment (please complete the following information):**"
77 echo - Nominatim version: $NominatimVersion
78 echo - PostgreSQL version: $PostgreSQLVersion
79 echo - PostGIS version: $PostGISVersion
80 echo - OS: $OperatingSystem
85 echo "**Hardware Configuration (please correct the following information):**"
87 echo - number of CPUs: $NumCPUs
88 echo - type and size of disks:
89 echo - bare metal/AWS/other cloud service:
92 echo **Postgresql Configuration:**