Commit Graph

17 Commits

Author SHA1 Message Date
Dennis Camera 05c2a62191 [explorer/machine_type] Implement chroot detection using /proc/.../mountinfo 2021-08-05 13:52:51 +02:00
Dennis Camera 5af1317c29 [explorer/machine_type] Try to detect chroot path 2021-08-05 13:52:51 +02:00
Dennis Camera 4a05669765 [explorer/machine_type] Implement chroot detection 2021-08-05 13:52:51 +02:00
Dennis Camera 23fbfaf035 [explorer/machine_type] Use systemd-detect-virt (if available) to detect containers and VMs 2021-08-05 13:52:51 +02:00
Dennis Camera 2ffa895f57 [explorer/machine_type] Remove CPUID check
it's a lot of code and depends on a binary helper unlikely to be installed.
2021-08-05 13:52:51 +02:00
Dennis Camera abc6d009b2 [explorer/machine_type] Print top most machine layer as first line (fallback to physical) 2021-08-05 13:52:51 +02:00
Dennis Camera edcac70b2a [explorer/machine_type] Reimplement 2021-08-05 13:52:51 +02:00
evilham 8b790b0a54 [explorer/machine_type] Make shellcheck happy! 2020-05-18 16:47:20 +02:00
evilham cf44c4a01b [explorer/machine_type] Simplify Linux + basic OpenBSD support.
By abstracting away vendor-dependent pattern matching for the linux code, we can
re-use that and be reasonably sure about OpenBSD machines being virtualised when
we can identify the undelrying virtualisation technology.
It remains to be solved how to tell if an OpenBSD machine is physical; in that
case previous cdist behaviour ("unknown") remains.

For NetBSD something similar to OpenBSD could be done, with different sysctls:
hw.machine and hw.model wary of adding those without testing though, so for
NetBSD previous cdist behaviour ("unknown") remains.
https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7.i386+NetBSD-9.0
2020-05-18 16:35:50 +02:00
evilham 7ca2bfc14a [explorer/machine_type] Add support for FreeBSD.
More research is needed for {Net,Open}BSD support.

Indentation is left as-is for the linux code as I intend to simplify it in a
future MR, this way the diff is minimal.
2020-05-18 16:00:23 +02:00
tom 134c84607f fix another SC2166 (test `[ .. -a.. ]` replaced by `[ .. ] && ]`) 2018-10-04 12:28:59 +02:00
Darko Poljak 44acfcdd12 Fix SC2002 2018-10-03 14:12:07 +02:00
Sven Wick ed55d01b35 Update machine_type (#564)
detect kvm on proxmox
2017-09-01 20:56:48 +02:00
Stu Zhao a6643f0d7f Explore machine type for virtualbox guest 2016-07-06 18:39:27 -04:00
Stephan Leemburg 98160624a0 Add openvz/lxc discovery 2016-06-22 13:21:10 +02:00
Daniel Heule 7b6102750e as requested, replace space with _ 2014-03-26 11:57:15 +01:00
Daniel Heule e8f5d4c340 some new explorers wich are handy if you must tune for example sap or
oracle to the systemtype, cpu cores and/or physical memory
2014-02-13 15:38:35 +01:00