Is it Possible to get the Output of Storage: View Disks Into a Flat File?

Status
Not open for further replies.

bollar

Patron
Joined
Oct 28, 2012
Messages
411
The title asks the question. I'd like to simply get the list of drives, serial numbers and descriptions into a database of my own.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You can get all of the information by using the 'smartctl' command. It won't give you a pretty output you can copy/paste into a database. But you could definitely create it in whatever format and information you want.

If you are using a hardware RAID then you'll have to use whatever CLI the card has. If it has none you may be screwed.
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
Yes, I have that and actually I can parse it using gsmartctl, but I made the mistake of using the "description" field to identify which bay each drive is in, as well as other info like the date it went into service and when the warranty expires. It would would be so much easier if I could just dump that page into a file (or even cut and paste it).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You can dump the output of any command by using the '>'.

For instance:

smartctl -a da0 > /tmp/da0.txt

Will give you a text file output.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Code:
sqlite3 /data/freenas-v1.db 'select * from storage_disk'


Columns are:

Code:
disk_enabled|disk_acousticlevel|disk_hddstandby|disk_serial|disk_multipath_name|disk_identifier|disk_togglesmart|disk_advpowermgmt|disk_transfermode|disk_multipath_member|disk_description|disk_smartoptions|id|disk_name


Also look at camcontrol:

Code:
camcontrol devlist
camcontrol identify ada0
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411

bollar

Patron
Joined
Oct 28, 2012
Messages
411
Fantastic! Now I have my list and the system admin knows a bit about the disks through the FreeNAS GUI.
Code:
1	Disabled	5	6XW03GKY		{serial}6XW03GKY	1	1	Auto		A1 In Warranty   Expiration 22-Mar-2013	5	da0
1	Disabled	5	6XW04J6F		{serial}6XW04J6F	1	1	Auto		A2 Out of Warranty	2	da1
1	Disabled	5	6XW1EL0G		{serial}6XW1EL0G	1	1	Auto		A3 Installed 121103-1412 In Warranty   Expiration 02-Apr-2013	3	da2
1	Disabled	5	9XW09T3E		{serial}9XW09T3E	1	1	Auto		A4 In Warranty   Expiration 29-Jul-2014	1	da3
1	Disabled	5	9XW0BFYF		{serial}9XW0BFYF	1	1	Auto		B1 In Warranty   Expiration 05-Apr-2013	9	da4
1	Disabled	5	5XW1NJF1		{serial}5XW1NJF1	1	1	Auto		B1 Installed 121111-0624 In Warranty   Expiration 24-Mar-2013	23	da7
1	Disabled	5	5YD65VXM		{serial}5YD65VXM	1	1	Auto		B3 In Warranty   Expiration 15-Mar-2013	8	da5
1	Disabled	5	W1F0WE74		{serial}W1F0WE74	1	1	Auto		B4 In Warranty   Expiration 22-Mar-2013	6	da6
1	Disabled	5	W1F0XAJQ		{serial}W1F0XAJQ	1	1	Auto		C1 2013-12-30	17	da8
1	Disabled	5	MK0311YHG4SBDA		{serial}MK0311YHG4SBDA	1	1	Auto		C2 2013-12-31	18	da9
1	Disabled	5	MK0351YHGBP1RA		{serial}MK0351YHGBP1RA	1	1	Auto		C3 In Warranty   Expiration 09-Jan-2014	15	da10
1	Disabled	5	MK0311YHG1G6ZA		{serial}MK0311YHG1G6ZA	1	1	Auto		C4 In Warranty   Expiration 09-Jan-2014	16	da11
1	Disabled	5	MK0331YHGY4U2A		{serial}MK0331YHGY4U2A	1	1	Auto		D1 2014-09-15	20	da12
1	Disabled	5	MK0311YHG53GSA		{serial}MK0311YHG53GSA	1	1	Auto		D2 2014-02-08	19	da13
1	Disabled	5	MK0311YHG63BVA		{serial}MK0311YHG63BVA	1	1	Auto		D3 2014-02-08	22	da14
1	Disabled	5	5YD77HND		{serial}5YD77HND	1	1	Auto		D4 2013-12-30	21	da15
 

c4rp3d13m

Dabbler
Joined
Nov 18, 2012
Messages
12
thank you... i needed that too. :cool:
 
Status
Not open for further replies.
Top