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

Crash on launch when viewing temperature of laptop HDD in sleep mode #824

Closed
pantherbotics3863 opened this issue Mar 27, 2016 · 5 comments
Closed
Milestone

Comments

@pantherbotics3863
Copy link

Some laptop HDDs will go into sleep mode after being powered off for awhile, which results in hddtemp returning the string "SLP" instead of the temperature. Glances v2.6.1 does not currently have support for this, resulting in the following crash upon launching glances:

roger@MEGIDO:~$ glances -V
Glances v2.6.1 with psutil v4.1.0
roger@MEGIDO:~$ glances
Traceback (most recent call last):
  File "/usr/local/bin/glances", line 9, in <module>
    load_entry_point('Glances==2.6.1', 'console_scripts', 'glances')()
  File "/usr/local/lib/python2.7/dist-packages/glances/__init__.py", line 130, in main
    args=core.get_args())
  File "/usr/local/lib/python2.7/dist-packages/glances/standalone.py", line 67, in __init__
    self.stats.update()
  File "/usr/local/lib/python2.7/dist-packages/glances/stats.py", line 154, in update
    self._plugins[p].update()
  File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_hddtemp.py", line 62, in update
    self.stats = self.glancesgrabhddtemp.get()
  File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_hddtemp.py", line 145, in get
    self.__update__()
  File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_hddtemp.py", line 122, in __update__
    hddtemp_current['value'] = float(temperature) if temperature != b'ERR' else temperature
ValueError: could not convert string to float: SLP
roger@MEGIDO:~$
@nicolargo nicolargo added the bug label Mar 27, 2016
@nicolargo nicolargo added this to the 2.7 milestone Mar 27, 2016
@nicolargo
Copy link
Owner

Corrected in the DEVELOP branch. Can you test it ?

@rogerfachini
Copy link

Posted this originally on the wrong account, will continue correspondence on this account from now on, sorry for the confusion. Pulled the Develop branch, ran it, and no crashes this time! Though none of the drives are showing any of the temperatures.
sensoroutput
I can verify that the hddtemp daemon is outputting temperatures, as running netcat returns the following:

roger@MEGIDO:~/glances$ nc localhost 7634
|/dev/sda|WDC WD2500JS-75MHB0|42|C||/dev/sdb|WDC WD2500JS-75MHB0|35|C||/dev/sdc|WDC WD3200AAKS-75B3A0|42|C||/dev/sdd|WDC WD3200AAKS-75B3A0|42|C||/dev/sde|WDC WD3200AAKS-75B3A0|42|C||/dev/sdf|SAMSUNG HM321HI|37|C||/dev/sdg|HGST HTS541010A9E680|37|C|

It may be important to note that at the time of testing, the two laptop drives that can go into sleep mode (/dev/sdf and /dev/sdg, labelled as STG RAID 3 and ARC DISK 0) were not in sleep mode. I will test again when one or more of the drives goes into sleep mode

@rogerfachini
Copy link

Update: When a drive is in sleep mode, the result is the same as the image in my previous post. Running netcat returns the following:

roger@MEGIDO:~$ nc localhost 7634
|/dev/sda|WDC WD2500JS-75MHB0|44|C||/dev/sdb|WDC WD2500JS-75MHB0|35|C||/dev/sdc|WDC WD3200AAKS-75B3A0|45|C||/dev/sdd|WDC WD3200AAKS-75B3A0|45|C||/dev/sde|WDC WD3200AAKS-75B3A0|43|C||/dev/sdf|SAMSUNG HM321HI|39|C||/dev/sdg|HGST HTS541010A9E680|SLP|*|

@nicolargo
Copy link
Owner

@rogerfachini Last commit should correct the issue.

selection_003

Can you test the lastest DEVELOP version ?

@rogerfachini
Copy link

Latest commit is confirmed to work!
sensorswork

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

3 participants