diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/op_mode/show_sensors.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/op_mode/show_sensors.py b/src/op_mode/show_sensors.py index 1efcc9aec..365a358ac 100755 --- a/src/op_mode/show_sensors.py +++ b/src/op_mode/show_sensors.py @@ -17,9 +17,17 @@ import re import sys + +from vyos.utils.file import read_file from vyos.utils.process import popen from vyos.utils.process import DEVNULL +cpu_info = read_file('/proc/cpuinfo') +# Linux always adds "hypervisor" to CPU flags +if 'hypervisor' in cpu_info: + print('VyOS running under hypervisor, no sensors available!') + sys.exit(1) + output,retcode = popen("sensors --no-adapter", stderr=DEVNULL) if retcode == 0: print (output) |
