nephri / freenas-disklist Goto Github PK
View Code? Open in Web Editor NEWFreeNas "Disklist" script for report informations about installed hard drives, volumes and partitions
License: GNU Lesser General Public License v3.0
FreeNas "Disklist" script for report informations about installed hard drives, volumes and partitions
License: GNU Lesser General Public License v3.0
Hello:
command used:
perl ./disklist.pl -c:z
Use of uninitialized value in string ne at ./disklist2.pl line 615.
MEDIAS
Use of uninitialized value in string ne at ./disklist2.pl line 615.
MEDIAS
Use of uninitialized value in string ne at ./disklist2.pl line 615.
MEDIAS
Use of uninitialized value in string ne at ./disklist2.pl line 615.
MEDIAS
Use of uninitialized value in string ne at ./disklist2.pl line 615.
TEMP
Use of uninitialized value in string ne at ./disklist2.pl line 615.
TEMP
Use of uninitialized value in string ne at ./disklist2.pl line 615.
TEMP
TV
Use of uninitialized value in numeric eq (==) at ./disklist2.pl line 1004.
Use of uninitialized value in string ne at ./disklist2.pl line 615.
root@freenas:~ #
this tool is dramatically better than the janky bash one I made....except it does have power on hours. any chance those could be added?
I tried looking at the code to see if I could do it but...its way too much for me :(
if you do go for it, sas and sata use at least 2 different texts in smartctl on my drives:
sata="power_on_hours"
sas="number of hours powered up"
"(exemple: ada0p1)"
still an amazing tool
Hi!
First of all, thanks for this nice script. I like it a lot, is very useful.
We've a system with a degraded multipath and in the current conditions (we haven't tested before on this system) the affected device is not shown when we launch DiskList. We've tried with several arguments but the disk is not shown on the list.
Here's the output of DiskList without arguments:
ada0p1 gptid/db611e37-47c0-11e7-af51-0007433c9d20 datos ada0 INTEL SSDSC2BB240G7 240 SSD PHDV703502DL240AGN 0
ada1p1 gptid/edcb224a-47c0-11e7-af51-0007433c9d20 datos ada1 INTEL SSDSC2BA200G4 200 SSD BTHV7092018Q200MGN 0
multipath/disk1p2 gptid/4267f34f-47bf-11e7-af51-0007433c9d20 datos da34,da10 HGST HUH728080AL4200 8001 HDD VLHE5MWV 7200 SAS3008(0):3#10 multipath/disk1 OPTIMAL
multipath/disk2p2 gptid/42eabbff-47bf-11e7-af51-0007433c9d20 datos da28,da4 HGST HUH728080AL4200 8001 HDD VLH96KWV 7200 SAS3008(0):3#4 multipath/disk2 OPTIMAL
multipath/disk3p2 gptid/4351b1c6-47bf-11e7-af51-0007433c9d20 datos da41,da17 HGST HUH728080AL4200 8001 HDD VLH14ZEV 7200 SAS3008(0):3#17 multipath/disk3 OPTIMAL
multipath/disk4p2 gptid/43b65fc5-47bf-11e7-af51-0007433c9d20 datos da35,da11 HGST HUH728080AL4200 8001 HDD VLGSGP4V 7200 SAS3008(0):3#11 multipath/disk4 OPTIMAL
multipath/disk5p2 gptid/44297dae-47bf-11e7-af51-0007433c9d20 datos da29,da5 HGST HUH728080AL4200 8001 HDD VLHE40LV 7200 SAS3008(0):3#5 multipath/disk5 OPTIMAL
multipath/disk6p2 gptid/44915638-47bf-11e7-af51-0007433c9d20 datos da45,da21 HGST HUH728080AL4200 8001 HDD VLH7U1KV 7200 SAS3008(0):3#21 multipath/disk6 OPTIMAL
multipath/disk7p2 gptid/45078510-47bf-11e7-af51-0007433c9d20 datos da39,da15 HGST HUH728080AL4200 8001 HDD VLHJDH8V 7200 SAS3008(0):3#15 multipath/disk7 OPTIMAL
multipath/disk9p2 gptid/45e345bc-47bf-11e7-af51-0007433c9d20 datos da27,da3 HGST HUH728080AL4200 8001 HDD VLHE11MV 7200 SAS3008(0):3#3 multipath/disk9 OPTIMAL
multipath/disk10p2 gptid/46512b37-47bf-11e7-af51-0007433c9d20 datos da46,da22 HGST HUH728080AL4200 8001 HDD VLHJDP4V 7200 SAS3008(0):3#22 multipath/disk10 OPTIMAL
multipath/disk11p2 gptid/46c03cba-47bf-11e7-af51-0007433c9d20 datos da40,da16 HGST HUH728080AL4200 8001 HDD VLJ5PJ8V 7200 SAS3008(0):3#16 multipath/disk11 OPTIMAL
multipath/disk12p2 gptid/4728a4ee-47bf-11e7-af51-0007433c9d20 datos da31,da7 HGST HUH728080AL4200 8001 HDD VLJ4Y0AV 7200 SAS3008(0):3#7 multipath/disk12 OPTIMAL
multipath/disk13p2 gptid/4799e412-47bf-11e7-af51-0007433c9d20 datos da25,da1 HGST HUH728080AL4200 8001 HDD VLJ5PDEV 7200 SAS3008(0):3#1 multipath/disk13 OPTIMAL
multipath/disk14p2 gptid/3129c309-9728-11e7-b00d-0007433c9d20 datos da44,da20 HGST HUH728080AL4200 8001 HDD VLH961TV 7200 SAS3008(0):3#20 multipath/disk14 OPTIMAL
multipath/disk15p2 gptid/bf445c67-47bf-11e7-af51-0007433c9d20 datos da38,da14 HGST HUH728080AL4200 8001 HDD VLHJDRPV 7200 SAS3008(0):3#14 multipath/disk15 OPTIMAL
multipath/disk16p2 gptid/bfb100c9-47bf-11e7-af51-0007433c9d20 datos da32,da8 HGST HUH728080AL4200 8001 HDD VLJ3WBMV 7200 SAS3008(0):3#8 multipath/disk16 OPTIMAL
multipath/disk17p2 gptid/c643dd7f-47bf-11e7-af51-0007433c9d20 datos da26,da2 HGST HUH728080AL4200 8001 HDD VLH6TE1V 7200 SAS3008(0):3#2 multipath/disk17 OPTIMAL
multipath/disk18p2 gptid/c6afeca0-47bf-11e7-af51-0007433c9d20 datos da42,da18 HGST HUH728080AL4200 8001 HDD VLHE0VKV 7200 SAS3008(0):3#18 multipath/disk18 OPTIMAL
multipath/disk19p2 gptid/cd711e67-47bf-11e7-af51-0007433c9d20 datos da36,da12 HGST HUH728080AL4200 8001 HDD VLHE12WV 7200 SAS3008(0):3#12 multipath/disk19 OPTIMAL
multipath/disk20p2 gptid/cdda6714-47bf-11e7-af51-0007433c9d20 datos da30,da6 HGST HUH728080AL4200 8001 HDD VLHE3HRV 7200 SAS3008(0):3#6 multipath/disk20 OPTIMAL
multipath/disk21p2 gptid/2066e757-47c0-11e7-af51-0007433c9d20 datos da24,da0 HGST HUH728080AL4200 8001 HDD VLH85Z3V 7200 SAS3008(0):3#0 multipath/disk21 OPTIMAL
multipath/disk22p2 gptid/20d14e0e-47c0-11e7-af51-0007433c9d20 datos da43,da19 HGST HUH728080AL4200 8001 HDD VLH977VV 7200 SAS3008(0):3#19 multipath/disk22 OPTIMAL
multipath/disk23p2 gptid/5afa7c7a-47c0-11e7-af51-0007433c9d20 datos da37,da13 HGST HUH728080AL4200 8001 HDD VLHA85NV 7200 SAS3008(0):3#13 multipath/disk23 OPTIMAL
multipath/disk24p2 gptid/b8eafac2-4a16-11e7-b7f6-0007433c9d20 datos da47,da23 HGST HUH728080AL4200 8001 HDD VLH9E7EV 7200 SAS3008(0):3#23 multipath/disk24 OPTIMAL
ada2p2 gptid/ae84054e-8937-11e8-97ea-d050995af9dc freenas-boot ada2 32GB SATA Flash Drive 32 SSD E011824150000000077F 0
ada3p2 gptid/ae794bd1-8937-11e8-97ea-d050995af9dc freenas-boot ada3 32GB SATA Flash Drive 32 SSD E011824150000000074A 0
27 selected disk(s)
`
The absent disk is multipath/disk8 associated to da9/da33
We've tried with -all and other arguments, also trying to identify the disk by it's device number but is not shown. For example here we requested to show da34 and it shows ok, but not for da33:
multipath/disk1p2 gptid/4267f34f-47bf-11e7-af51-0007433c9d20 datos da34,da10 HGST HUH728080AL4200 8001 HDD VLHE5MWV 7200 SAS3008(0):3#10 multipath/disk1 OPTIMAL
1 selected disk(s)
0 selected disk(s)
`
Appreciate if you have an idea on how to show that disk.
Thank you very much
even perl is in a different place. yay!
fails here
FreeBSD nas3.locodm 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 n245412-484f039b1d0 TRUENAS amd64
Error while accessing data for (owner=device, data=multipath)
Died at /usr/bin/zlist line 1503.
but works fine here
FreeBSD nas1.locodm 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 n245412-484f039b1d0 TRUENAS amd64
nas1% which zlist
/usr/bin/zlist
they should be basically the same. how can I figure out why they are different?
When specifying -long or H as a column entry it seems that the temperature is not being pulled.
I have a zpool that looks rather like this:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
mirror-0 ONLINE 0 0 0
gptid/8fc5dd7d-be79-11e6-8494-0cc47a4ea301 ONLINE 0 0 0
gptid/909da79e-be79-11e6-8494-0cc47a4ea301 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
gptid/f229d2ec-63e0-11e5-b699-0cc47a4ea301 ONLINE 0 0 0
gptid/f28f3a81-63e0-11e5-b699-0cc47a4ea301 ONLINE 0 0 0
mirror-2 ONLINE 0 0 0
gptid/9ed97edc-7ba2-11e6-90f6-0cc47a4ea301 ONLINE 0 0 0
gptid/154d64c8-e738-11e7-94cf-0cc47a4ea301 ONLINE 0 0 0
mirror-3 ONLINE 0 0 0
gptid/95f80d66-8b2d-11e7-94cf-0cc47a4ea301 ONLINE 0 0 0
gptid/15eb372c-e738-11e7-94cf-0cc47a4ea301 ONLINE 0 0 0
mirror-4 DEGRADED 0 0 0
gptid/eda97644-1a28-11e6-8f92-0cc47a4ea301 ONLINE 0 0 0
spare-1 DEGRADED 3 0 73
8089225215197255073 REMOVED 0 0 0 was /dev/gptid/d5c03bb1-5a67-11e7-939f-0cc47a4ea301
da10 ONLINE 0 0 143
mirror-5 ONLINE 0 0 0
gptid/5de5672f-3b5c-11e8-94cf-0cc47a4ea301 ONLINE 0 0 0
gptid/5e7e4e8f-3b5c-11e8-94cf-0cc47a4ea301 ONLINE 0 0 0
mirror-6 ONLINE 0 0 0
gptid/bbe1cab6-8018-11e8-8fc2-0cc47a4ea301 ONLINE 0 0 0
gptid/bc8a5117-8018-11e8-8fc2-0cc47a4ea301 ONLINE 0 0 0
spares
11840848322238565661 INUSE was /dev/da10
(you, uh, can probably see why I'm looking at hard drive information right now)
Here's a command I can run, which is somewhat useful:
root@deus:~ # ./disklist.pl -c:pldUz
partition label device size zpool
--------------------------------------------------------------------------
da1p2 gptid/f229d2ec-63e0-11e5-b699-0cc47a4ea301 da1 5000 tank
da2p2 gptid/f28f3a81-63e0-11e5-b699-0cc47a4ea301 da2 5000 tank
da3p2 gptid/eda97644-1a28-11e6-8f92-0cc47a4ea301 da3 5000 tank
da4p2 gptid/9ed97edc-7ba2-11e6-90f6-0cc47a4ea301 da4 6001 tank
da5p2 gptid/95f80d66-8b2d-11e7-94cf-0cc47a4ea301 da5 6001 tank
da6p2 gptid/8fc5dd7d-be79-11e6-8494-0cc47a4ea301 da6 6001 tank
da7p2 gptid/909da79e-be79-11e6-8494-0cc47a4ea301 da7 6001 tank
da8p2 gptid/154d64c8-e738-11e7-94cf-0cc47a4ea301 da8 6001 tank
da9p2 gptid/15eb372c-e738-11e7-94cf-0cc47a4ea301 da9 8001 tank
da11p2 gptid/5de5672f-3b5c-11e8-94cf-0cc47a4ea301 da11 8001 tank
da12p2 gptid/5e7e4e8f-3b5c-11e8-94cf-0cc47a4ea301 da12 8001 tank
da13p2 gptid/bbe1cab6-8018-11e8-8fc2-0cc47a4ea301 da13 8001 tank
da14p2 gptid/bc8a5117-8018-11e8-8fc2-0cc47a4ea301 da14 8001 tank
ada0 120
da0 8001
da10 8001
da15 8001
Here's a command I'd like to be able to run:
root@deus:~ # ./disklist.pl -c:pldUZ
partition label device size zpoolpath
--------------------------------------------------------------------------
da1p2 gptid/f229d2ec-63e0-11e5-b699-0cc47a4ea301 da1 5000 tank/mirror-1
da2p2 gptid/f28f3a81-63e0-11e5-b699-0cc47a4ea301 da2 5000 tank/mirror-1
da3p2 gptid/eda97644-1a28-11e6-8f92-0cc47a4ea301 da3 5000 tank/mirror-4
da4p2 gptid/9ed97edc-7ba2-11e6-90f6-0cc47a4ea301 da4 6001 tank/mirror-2
da5p2 gptid/95f80d66-8b2d-11e7-94cf-0cc47a4ea301 da5 6001 tank/mirror-3
da6p2 gptid/8fc5dd7d-be79-11e6-8494-0cc47a4ea301 da6 6001 tank/mirror-0
da7p2 gptid/909da79e-be79-11e6-8494-0cc47a4ea301 da7 6001 tank/mirror-0
da8p2 gptid/154d64c8-e738-11e7-94cf-0cc47a4ea301 da8 6001 tank/mirror-2
da9p2 gptid/15eb372c-e738-11e7-94cf-0cc47a4ea301 da9 8001 tank/mirror-3
da11p2 gptid/5de5672f-3b5c-11e8-94cf-0cc47a4ea301 da11 8001 tank/mirror-5
da12p2 gptid/5e7e4e8f-3b5c-11e8-94cf-0cc47a4ea301 da12 8001 tank/mirror-5
da13p2 gptid/bbe1cab6-8018-11e8-8fc2-0cc47a4ea301 da13 8001 tank/mirror-6
da14p2 gptid/bc8a5117-8018-11e8-8fc2-0cc47a4ea301 da14 8001 tank/mirror-6
ada0 120
da0 8001
da10 8001 tank/spares
da15 8001
I'd implement this myself but I know nothing about perl, so I'm going to leave it here as a request.
Morning @nephri !!
I was wondering if you would consider adding a column for drive temperature? If I had that I could use your script to replace a ton that I currently use to collect data.
Thanks in advance for your consideration.
Suddenly now when running the script my system crashes. Anyone having the same issue?
I've noticed on my system that Western Digital drives were not getting their corresponding slot in the output. I traced it down to a hyphen in the serial number. When enumerating disks, the script loads in the serial numbers from the output as:
WD-WMC1T1234567
However, when it enumerates the SAS backplane, the serial numbers lack the dash:
WDWMC1T1234567
Because they're not identical, they don't line up as a match when generating the output table.
I fixed this locally by removing the dash when saving the serial to the disk information; however, I don't know that this is a proper long term fix.
diff --git a/disklist.pl b/disklist.pl
index 1cac05b..758ebe9 100644
--- a/disklist.pl
+++ b/disklist.pl
@@ -178,6 +178,7 @@ sub parseDisks {
if ( $line =~ m/^[\s]*ident:/ ) {
$serial = $line;
$serial =~ s/^.*:[\s]*(.*)[\s]*$/$1/;
+ $serial =~ s/\-//g;
if ( $device ne "" ) { $disk->{ 'serial' } = $serial; }
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.