Commit Graph

6 Commits

Author SHA1 Message Date
Nathan Scott 5b50ae3aa3 Separate display from sampling in SysArch and Hostname Meters
Several of our newer meters have merged coding concerns in terms
of extracting values and displaying those values.  This commit
rectifies that for the SysArch and Hostname meters, allowing use
of this code with alternative front/back ends.  The SysArch code
is also refined to detect whether the platform has an os-release
file at all and/or the sys/utsname.h header via configure.ac.
2021-03-04 13:40:11 +11:00
Christian Göttsche a40347e85b SysArchMeter: avoid static variable 2021-03-02 16:37:11 +01:00
Benny Baumann 8a1112141d Fix a possible truncation of the intermediate strings in the SysArch meter 2021-03-01 09:56:07 +01:00
Christian Göttsche 84e5682473 SysArchMeter: read os-release instead of running lsb-release
os-release is available on FreeBSD by default.
Also avoid executing a third-party program.

Examples:
  Linux 5.10.0-3-amd64 [x86_64] @ Debian GNU/Linux bullseye/sid
  FreeBSD 12.2-RELEASE-p3 [amd64]

Closes: #516
2021-02-17 15:05:36 +01:00
Christian Hesse 85a855f5b2 SysArchMeter: skip "n/a" values
Unavailable values are returned as "n/a" from lsb_release, skip these.

$ lsb_release -a
LSB Version:    1.4
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a
2021-02-04 13:26:39 +01:00
ahgamut 51e79ddc07 [#480] SysArchMeter to view kernel/arch info
At start, SysArchMeter calls the uname function to obtain the kernel
version and architecture. If available, the distro version is obtained
by calling lsb_release. The obtained values are stored in static
variables and used when updating the meter.
2021-01-31 20:08:09 +01:00