Htpc-Manager / pySMART cant selftest

Status
Not open for further replies.

giddykong

Cadet
Joined
May 29, 2016
Messages
2
hey everyone

Not sure if i got the right spot. sorry if its in the wrong section.

I've been scouring around for a while to get this one working. i seem to be having troubles retrieving smart data using pySMART. i have a HP ML350 G6 with an M1015 flashed to IT mode running 6 2TB western digital red drives and a samsung evo 840 120gb as the l2arc cache . using smartctl i am able to grab my drives smart data using "smartctl -d sat -a /dev/pass0"

when i try to access the smart data under the system tab no items are shown just an empty grid. i'm pretty sure its pysmart failing as the output in the jail is listing pySMART files.


Code:
2016-05-29 20:24:27 :: modules.stats :: ERROR :: Error Pulling S.M.A.R.T. data 'layer'                                             
Traceback (most recent call last):                                                                                                 
  File "/HTPC-Manager/modules/stats.py", line 532, in smart_info                                                                   
    devlist = DeviceList()                                                                                                         
  File "/HTPC-Manager/libs/pySMART/device_list.py", line 51, in __init__                                                           
    self._initialize()                                                                                                             
  File "/HTPC-Manager/libs/pySMART/device_list.py", line 106, in _initialize                                                       
    self.devices.append(Device(name))                                                                                              
  File "/HTPC-Manager/libs/pySMART/device.py", line 140, in __init__                                                               
    self.update()                                                                                                                  
  File "/HTPC-Manager/libs/pySMART/device.py", line 433, in update                                                                 
    smartctl_type[self.interface], self.name), shell=True,                                                                         
KeyError: 'layer'                 


I tracked it down further and tried to use "from pySMART.device import Device" in python to pull the smart data. my l2arc works fine. i get a further error when i try to access pass0 - 5.


Code:
Python 2.7.11 (default, May  8 2016, 06:05:17)                                                                                     
[GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9                                                                                 
Type "help", "copyright", "credits" or "license" for more information.                                                             
>>> from pySMART.device import Device                                                                                              
>>> pass0 =Device('/dev/pass0')                                                                                                    
Traceback (most recent call last):                                                                                                 
  File "<stdin>", line 1, in <module>                                                                                              
  File "/usr/local/lib/python2.7/site-packages/pySMART/device.py", line 140, in __init__                                           
    self.update()                                                                                                                  
  File "/usr/local/lib/python2.7/site-packages/pySMART/device.py", line 434, in update                                             
    smartctl_type[self.interface], self.name), shell=True,                                                                         
KeyError: '-d'                                        


I hope someone can shed some light. i'm in too deep haha
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I have a feeling this should not work and disk devices are not exposed to the jail.
maybe you can try instsalling smartmontools in the jail and confirm if it can see the drives?
 

giddykong

Cadet
Joined
May 29, 2016
Messages
2
I have a feeling this should not work and disk devices are not exposed to the jail.
maybe you can try instsalling smartmontools in the jail and confirm if it can see the drives?
yes smartmontools and smartctl are installed and working in the jail. i can use "smartctl -d sat -a /dev/ada0" and it works. short tests also work. ill post an output when i get home from work today.
 

brando56894

Wizard
Joined
Feb 15, 2014
Messages
1,537
I raised an issue on Hellowlol's fork (which is the one I use, https://github.com/Hellowlol/HTPC-Manager/issues/341) and he said I had to wait until the changes were merged into freenas/py-smart. That was back in 2015 and I see that py-smart was last updated in January, so it should work. Looks like something is screwed up in htpc-manager because I can confirm that it works perfectly on Linux using ZFS and 8 drives connected to a m1015 flashed to IT mode.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I raised an issue on Hellowlol's fork (which is the one I use, https://github.com/Hellowlol/HTPC-Manager/issues/341) and he said I had to wait until the changes were merged into freenas/py-smart. That was back in 2015 and I see that py-smart was last updated in January, so it should work. Looks like something is screwed up in htpc-manager because I can confirm that it works perfectly on Linux using ZFS and 8 drives connected to a m1015 flashed to IT mode.
I got it working by doing the following.
1) install smartmontools in the jail
Code:
pkg install smartmontools

2) htpc-manager must be run as root
Code:
sysrc htpc_manager_user="root"

3) apply these commits to /usr/pbi/htpc-manager/share/htpc-manager/HTPC-Manager/libs/pySMART/
https://github.com/freenas/py-SMART/commit/6e3e69c67fdaae38342809efb9ddc71edef2d0a0
https://github.com/freenas/py-SMART/commit/68e6a05718fa01032200200876115c17d1f69bce


Ideally to resolve #3, pySMART would incorporate all of the changes here https://github.com/freenas/py-SMART/commits/master, release v4.0, and HTPC-Manager would pull in the changes.
I'm not sure if pySMART has incorporated the changes since v3.0 in, I couldn't find their code repo from a quick search online.
 
Status
Not open for further replies.
Top