- Joined
- May 28, 2011
- Messages
- 10,996
I'm working again on making some changes to FreeNAS for my personal use and right now I'm trying to add a few columns of data to the Storage -> View Disks tab. The columns I am adding are: Temp, Run Hours, Spinup Cycles and Pending Sector Count.
The work I've done to date:
I have made some minor changes to the layout, now the columns are:
The code to derive the data is not complete but here is the idea:
I believe I need to make changes only to middleware.py to add some version of the code above in order to pass the values to view.py but this is where I get lost quickly.
Once I figure this out I will post it but I'm looking for some guidance right now because after 2 days I'm not gaining ground fast.
--- Updated ---
I've also located 0029_auto_add_field_disk_serial.py where I added into storage.disk
since I'm working on Temp right now. Don't want to bite off too much.
The work I've done to date:
I have made some minor changes to the layout, now the columns are:
Code:
|Edit | Name | Serial # | Description | Temp | Run Hours | Spinup Cycles | Pend. Sect. Ct. | HDD Stby | APM | AL | SMART On |
The code to derive the data is not complete but here is the idea:
Code:
smartctl -a /dev/ada1 | grep 'Temperature_Celsius' | sed 's/\(..\)*/\1/' smartctl -a /dev/ada1 | grep 'Power_On_Hours' | sed 's/\(....\)*/\1/' smartctl -a /dev/ada1 | grep 'Pending' | sed 's/\(....\)*/\1/' smartctl -a /dev/ada1 | grep 'Start_Stop_Count' | sed 's/\(....\)*/\1/'
I believe I need to make changes only to middleware.py to add some version of the code above in order to pass the values to view.py but this is where I get lost quickly.
Once I figure this out I will post it but I'm looking for some guidance right now because after 2 days I'm not gaining ground fast.
--- Updated ---
I've also located 0029_auto_add_field_disk_serial.py where I added into storage.disk
Code:
'disk_temp': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
since I'm working on Temp right now. Don't want to bite off too much.