Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory: '/sys/class/hwmon/hwmon2/fan4_input' #1129

Closed
ssaip opened this issue Sep 22, 2017 · 1 comment
Closed

No such file or directory: '/sys/class/hwmon/hwmon2/fan4_input' #1129

ssaip opened this issue Sep 22, 2017 · 1 comment

Comments

@ssaip
Copy link
Contributor

ssaip commented Sep 22, 2017

I face the following issue running psutil (5.3.1) used by glances v2.11.1. Might be related to #990 .
glances -d gives the following:

2017-09-22 02:28:48,483 -- CRITICAL -- Error while initializing the sensors plugin ([Errno 2] No such file or directory: '/sys/class/hwmon/hwmon2/fan4_input')
2017-09-22 02:28:48,484 -- ERROR -- Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/glances/stats.py", line 117, in _load_plugin
    self._plugins[name] = plugin.Plugin(args=args)
  File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_sensors.py", line 53, in __init__
    self.glancesgrabsensors = GlancesGrabSensors()
  File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_sensors.py", line 245, in __init__
    self.sfans = psutil.sensors_fans()
  File "/usr/local/lib/python2.7/dist-packages/psutil/__init__.py", line 2298, in sensors_fans
    return _psplatform.sensors_fans()
  File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 1193, in sensors_fans
    current = int(cat(base + '_input'))
  File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 298, in cat
    with open_binary(fname) if binary else open_text(fname) as f:
  File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 190, in open_binary
    return open(fname, "rb", **kwargs)
IOError: [Errno 2] No such file or directory: '/sys/class/hwmon/hwmon2/fan4_input'

Output in python:

>>> psutil.sensors_fans()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/psutil/__init__.py", line 2298, in sensors_fans
	return _psplatform.sensors_fans()
File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 1193, in sensors_fans
	current = int(cat(base + '_input'))
File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 298, in cat
	with open_binary(fname) if binary else open_text(fname) as f:
File "/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py", line 190, in open_binary
	return open(fname, "rb", **kwargs)
IOError: [Errno 2] No such file or directory: '/sys/class/hwmon/hwmon2/fan4_input'
>>>

The problem is how psutil tries to read the fans:
/usr/local/lib/python2.7/dist-packages/psutil/_pslinux.py

basenames = glob.glob('/sys/class/hwmon/hwmon*/fan*_*')

basenames = sorted(set([x.split('_')[0] for x in basenames]))
for base in basenames:
    unit_name = cat(os.path.join(os.path.dirname(base), 'name'),
                    binary=False)
    label = cat(base + '_label', fallback='', binary=False)
    current = int(cat(base + '_input'))

    ret[unit_name].append(_common.sfan(label, current))

return dict(ret)

as there is a fan4_* but no fan4_input:

00 ~ # ll /sys/class/hwmon/hwmon2/fan*
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan1_alarm
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan1_beep
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan1_input
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan1_min
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan1_pulses
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan1_target
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan1_tolerance
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan2_alarm
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan2_beep
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan2_input
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan2_min
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan2_pulses
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan2_target
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan2_tolerance
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan3_alarm
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan3_beep
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan3_input
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan3_min
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan3_pulses
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan3_target
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan3_tolerance
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan4_target
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan4_tolerance
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan5_alarm
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan5_beep
-r--r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan5_input
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan5_min
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan5_pulses
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan5_target
-rw-r--r-- 1 root root 4096 Sep 22 02:06 /sys/class/hwmon/hwmon2/fan5_tolerance

And here's the output of sensors which is working except cpu fan rpm of 0:
(edit: actually the rpm 0 is fine as well, as I only have one fan (fan2) connected.)

00 ~ # sensors
nct6779-isa-0290
Adapter: ISA adapter

Vcore:                  +0.97 V  (min =  +0.00 V, max =  +1.74 V)
in1:                    +1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:                   +3.41 V  (min =  +2.98 V, max =  +3.63 V)
+3.3V:                  +3.39 V  (min =  +2.98 V, max =  +3.63 V)
in4:                    +1.01 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                    +0.00 V  (min =  +0.00 V, max =  +0.00 V)
in6:                    +0.94 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
3VSB:                   +3.41 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:                   +3.30 V  (min =  +2.70 V, max =  +3.63 V)
in9:                    +1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                   +0.14 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                   +0.12 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                   +0.11 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                   +0.12 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                   +0.12 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                     0 RPM  (min =    0 RPM)
fan2:                   678 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan5:                     0 RPM  (min =    0 RPM)
SYSTIN:                +121.0°C  (high =  +0.0°C, hyst =  +0.0°C)  sensor = ther                                                                                                                                                             mistor
CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = ther                                                                                                                                                             mistor
AUXTIN0:                +29.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor                                                                                                                                                              = thermistor
AUXTIN1:               +114.0°C    sensor = thermistor
AUXTIN2:               +113.0°C    sensor = thermistor
AUXTIN3:                +36.0°C    sensor = thermal diode
PECI Agent 0:           +25.0°C
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C
PCH_CHIP_TEMP:           +0.0°C
PCH_CPU_TEMP:            +0.0°C
intrusion0:            ALARM
intrusion1:            ALARM
beep_enable:           disabled

acpitz-virtual-0
Adapter: Virtual device
temp1:        +27.8°C  (crit = +99.0°C)
temp2:        +29.8°C  (crit = +99.0°C)

asus-isa-0000
Adapter: ISA adapter
cpu_fan:        0 RPM

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +34.0°C  (high = +80.0°C, crit = +98.0°C)
Core 0:         +34.0°C  (high = +80.0°C, crit = +98.0°C)
Core 1:         +29.0°C  (high = +80.0°C, crit = +98.0°C)
Core 2:         +33.0°C  (high = +80.0°C, crit = +98.0°C)
Core 3:         +30.0°C  (high = +80.0°C, crit = +98.0°C)

Because of this error there is no sensors information at all in glances :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants