I'm writing a program that displays various system information (on a CentOS system). For example, the processor type and speed (from /proc/cpuinfo), the last boot time (calculated from /proc/uptime), the IP address (from ifconfig output), and a list of installed printers (from lpstat output).
Currently, several pieces of data are obtained from the dmidecode program:
- The platform type (
dmidecode -s system-product-name) - The BIOS version (
dmidecode -s bios-version) - The amount of physical memory (
dmidecode -t17 | grep Size)
These are only available if my program is run as root (because otherwise the dmidecode subprocess fails with a /dev/mem: Permission denied error). Is there an alternative way to get this information, that a normal user can access?