Resource icon

Disk failure LEDs for Supermicro SAS backplanes 0.3

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
One thing I'm considering is whether to disable the notification email. FreeNAS will notify you anyway if you have email set up (and if you don't, you won't get the email from this script either), so it seems kind of redundant.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
One thing I'm considering is whether to disable the notification email. FreeNAS will notify you anyway if you have email set up (and if you don't, you won't get the email from this script either), so it seems kind of redundant.
I agree, you wouldn't want two emails about a drive failure.

Great work.

Thanks
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
danb35 submitted a new resource:

Disk failure LEDs for Supermicro SAS backplanes - Script to light up disk failure LEDs when disks fail

Many hot-swap backplanes have disk-failure LEDs that can be turned on when a disk fails. Unfortunately, there doesn't seem to be a standard mechanism to do this, and FreeNAS doesn't have any built-in support for this feature.

Using inspiration from a couple of other sources (and by inspiration, I mean I blatantly ripped off, and tweaked to work with FreeNAS), I've modified a script that will light up the disk-failure LEDs on, at least, Supermicro SAS2 expander backplanes. I don't have any...

Read more about this resource...
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Ok! A cron job with the mirror version works ok!

If I try it with a raidz2 the cron errors with the following
Code:
 rm: glabel-lookup.sed: No such file or directory
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
Curious--it seems to run without issue on my RAIDZ2 pool. What happens if you replace every instance in the script of glabel-lookup.sed with /tmp/glabel-lookup.sed? There should be six places to make this change.
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Curious--it seems to run without issue on my RAIDZ2 pool. What happens if you replace every instance in the script of glabel-lookup.sed with /tmp/glabel-lookup.sed? There should be six places to make this change.
I created another file and renamed zpscanz.sh ran it as cron job and it first failed with
Code:
/usr/local/bin/zpscanz.sh: line 26: [: missing `]' 

then I added a space in the offending line after "YES", ran the cron job again and it emails me but fails to locate the disk. If I run it in the shell it runs fine.

But... Here is why is not marking the disk
Code:
Sending email notification of degraded pool tank
Locating failed drives.
Locating: da2 5003048-0-006f-72ad
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

SAS2IRCU: No Controller Found at index 0.



here is the result of a zpool status if it helps somehow:
803fb91c6ed5481d269f424293860fe8.jpg
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Interesting. What's the output of sas2flash -listall?
thanks for checking it out! here is the output:
Code:
[root@m5_nas ~]#  sas2flash -listall																								
LSI Corporation SAS2 Flash Utility																								 
Version 16.00.00.00 (2013.03.01)																									
Copyright (c) 2008-2013 LSI Corporation. All rights reserved																		
																																	
		Adapter Selected is a LSI SAS: SAS2008(B2)																				 
																																	
Num   Ctlr			FW Ver		NVDATA		x86-BIOS		 PCI Addr														 
----------------------------------------------------------------------------														
																																	
0  SAS2008(B2)	 20.00.07.00	14.01.00.08	07.39.02.00	 00:01:00:00														
																																	
		Finished Processing Commands Successfully.																				 
		Exiting SAS2Flash.																										 
[root@m5_nas ~]#		 
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Hello Dan!
Updated the script with latest version, it runs flwaslesly in the shell and cron job with my mirror pool, but with my raidz2 pool as a cron job fails with:
Code:
rm: /tmp/glabel-lookup.sed: No such file or directory


here is some additional info:
the script is in /mnt/tank/scripts/
I applied the chmod +x zpscan.sh to the script inside that folder
in the cron job details, user as root, command bash /mnt/tank/scripts/zpscan.sh tank

the script runs works with the raidz2 pool in the shell, don't understand whats going on :(
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
in the cron details, user as root, command bash /mnt/tank/scripts/zpscan.sh tank
Shouldn't make a difference, but try taking "bash" out of that command--the script should run on its own.
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Does it run from the shell with just the script name/path? /path/to/zpscan.sh poolname?
Yes!
Code:
[root@m5_nas ~]# /mnt/tank/scripts/zpscan.sh little_tank						
Saving drive list.															 
[root@m5_nas ~]# /mnt/tank/scripts/zpscan.sh tank							   
Saving drive list.															 
[root@m5_nas ~]#


do the tmp dir needs to be created before hand?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
What happens when you try to run them from cron?
by disabling Redirect Stdout in the cron job details, here are each of the results received by email

mirror pool email subject:
Code:
Cron <root@m5_nas> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /mnt/tank/scripts/zpscan.sh little_tank

email contents:
Code:
Saving drive list.


raidz2 pool email subject:
Code:
Cron <root@m5_nas> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /mnt/tank/scripts/zpscan.sh tank

email contents:
Code:
Saving drive list.
rm: /tmp/glabel-lookup.sed: No such file or directory


it seems that the mirror pool is working now, but I had recieved before a:
mirror pool email subject:
Code:
Cron <root@m5_nas> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /mnt/tank/scripts/zpscan.sh little_tank > /dev/null

email contents:
Code:
rm: /tmp/glabel-lookup.sed: No such file or directory
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
What are the contents of /root/.sas2ircu/drives-tank?

Code:
[root@m5_nas ~/.sas2ircu]# cat drives-tank									 
da7 5003048-0-006f-72b2														 
da5 5003048-0-006f-72ac														 
da3 5003048-0-006f-72ae														 
da6 5003048-0-006f-72af														 
da4 5003048-0-006f-72b6														 
da2 5003048-0-006f-72ad														 
[root@m5_nas ~/.sas2ircu]#
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
What about drives-little_tank?

And also, what's the output of sas2ircu 0 display?

drives-little_tank:
Code:
[root@m5_nas ~/.sas2ircu]# cat drives-little_tank																				  
da1 5003048-0-006f-72b5 2:9																										
da8 5003048-0-006f-72b7 2:11																										
[root@m5_nas ~/.sas2ircu]#


sas2ircu 0 display
Code:
LSI Corporation SAS2 IR Configuration Utility.																					
Version 20.00.00.00 (2014.09.18)																								  
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.																	  
																																  
Read configuration has been initiated for controller 0																			
------------------------------------------------------------------------														  
Controller information																											
------------------------------------------------------------------------														  
  Controller type						 : SAS2008																				
  BIOS version							: 7.39.02.00																			
  Firmware version						: 20.00.07.00																			
  Channel description					 : 1 Serial Attached SCSI																
  Initiator ID							: 0																					  
  Maximum physical devices				: 255																					
  Concurrent commands supported		   : 3432																				  
  Slot									: 16																					
  Segment								 : 0																					  
  Bus									 : 1																					  
  Device								  : 0																					  
  Function								: 0																					  
  RAID Support							: No																					
------------------------------------------------------------------------														  
IR Volume information																											  
------------------------------------------------------------------------														  
------------------------------------------------------------------------														  
Physical device information																										
------------------------------------------------------------------------														  
Initiator at ID #0																												
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 0																					  
  SAS Address							 : 5003048-0-006f-72ac																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 2861588/5860533167																	
  Manufacturer							: ATA																					
  Model Number							: WDC WD30EFRX-68E																	  
  Firmware Revision					   : 0A80																				  
  Serial No							   : WDWCC4NPK6VYZE																		
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
																																  
Device is a Enclosure services device																							  
  Enclosure #							 : 2																					  
  Slot #								  : 0																					  
  SAS Address							 : 5003048-0-006f-72bd																	
  State								   : Standby (SBY)																		  
  Manufacturer							: LSI			  
   Model Number						   : SAS2X28																				
  Firmware Revision					   : 0e0b																				  
  Serial No							   : x365514110																			
  GUID									: N/A																					
  Protocol								: SAS																					
  Device Type							 : Enclosure services device															  
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 1																					  
  SAS Address							 : 5003048-0-006f-72ad																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 2861588/5860533167																	
  Manufacturer							: ATA																					
  Model Number							: WDC WD30EFRX-68E																	  
  Firmware Revision					   : 0A82																				  
  Serial No							   : WDWCC4N2DN6PFH																		
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 2																					  
  SAS Address							 : 5003048-0-006f-72ae																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 2861588/5860533167																	
  Manufacturer							: ATA																					
  Model Number							: WDC WD30EFRX-68E																	  
  Firmware Revision					   : 0A82																				  
  Serial No							   : WDWCC4NA78JFUH																		
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 3																					  
  SAS Address							 : 5003048-0-006f-72af																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 2861588/5860533167																	
  Manufacturer							: ATA																					
  Model Number							: ST3000DM001-1CH1																	  
  Firmware Revision					   : CC44																				  
  Serial No							   : Z1F21ZWR																			  
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD
																																	
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 6																					  
  SAS Address							 : 5003048-0-006f-72b2																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 2861588/5860533167																	
  Manufacturer							: ATA																					
  Model Number							: ST3000DM001-1E61																	  
  Firmware Revision					   : CC45																				  
  Serial No							   : Z1F295EB																			  
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 8																					  
  SAS Address							 : 5003048-0-006f-72b4																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 1907729/3907029167																	
  Manufacturer							: ATA																					
  Model Number							: ST2000DM001-9YN1																	  
  Firmware Revision					   : CC96																				  
  Serial No							   : W24004HR																			  
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 9																					  
  SAS Address							 : 5003048-0-006f-72b5																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 953869/1953525167																	  
  Manufacturer							: ATA																					
  Model Number							: WDC WD10EAVS-00D																	  
  Firmware Revision					   : 1A01																				  
  Serial No							   : WDWCAU43597367																		
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 10																					
  SAS Address							 : 5003048-0-006f-72b6																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 2861588/5860533167
  Manufacturer							: ATA																					
  Model Number							: WDC WD30EFRX-68E																	  
  Firmware Revision					   : 0A80																				  
  Serial No							   : WDWMC4N1866499																		
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
																																  
Device is a Hard disk																											  
  Enclosure #							 : 2																					  
  Slot #								  : 11																					
  SAS Address							 : 5003048-0-006f-72b7																	
  State								   : Ready (RDY)																			
  Size (in MB)/(in sectors)			   : 953869/1953525167																	  
  Manufacturer							: ATA																					
  Model Number							: APPLE HDD WD10EZ																	  
  Firmware Revision					   : 3D03																				  
  Serial No							   : WDWCC1S5966663																		
  GUID									: N/A																					
  Protocol								: SATA																				  
  Drive Type							  : SATA_HDD																			  
------------------------------------------------------------------------														  
Enclosure information																											  
------------------------------------------------------------------------														  
  Enclosure#							  : 1																					  
  Logical ID							  : 590b11c0:3dc9eb00																	  
  Numslots								: 8																					  
  StartSlot							   : 0																					  
  Enclosure#							  : 2																					  
  Logical ID							  : 50030480:006f72bf																	  
  Numslots								: 13																					
  StartSlot							   : 0																					  
------------------------------------------------------------------------														  
SAS2IRCU: Command DISPLAY Completed Successfully.																				  
SAS2IRCU: Utility Completed Successfully.																						  
[root@m5_nas ~/.sas2ircu]#
 
Top