Storage
enclosure LED Monitoring utility (ledmon) and LED
Control (ledctl) utility are Linux user space
applications that use a broad range of interfaces and protocols to control
storage enclosure LEDs. The primary usage is to visualize the status of
Linux MD software RAID devices created with the mdadm utility. The
ledmon daemon monitors the status
of the drive array and updates the status of the drive LEDs. The ledctl
utility allows you to set LED patterns for specified devices.
These LED utilities use the SGPIO (Serial General Purpose Input/Output) specification (Small Form Factor (SFF) 8485) and the SCSI Enclosure Services (SES) 2 protocol to control LEDs. They implement the International Blinking Pattern Interpretation (IBPI) patterns of the SFF-8489 specification for SGPIO. The IBPI defines how the SGPIO standards are interpreted as states for drives and slots on a backplane and how the backplane should visualize the states with LEDs.
Some storage enclosures do not adhere strictly to the SFF-8489 specification. An enclosure processor might accept an IBPI pattern but not blink the LEDs according to the SFF-8489 specification, or the processor might support only a limited number of the IBPI patterns.
LED management (AHCI) and SAF-TE protocols are not supported by the
ledmon and ledctl utilities.
The ledmon and
ledctl applications have been verified to work with
Intel storage controllers such as the Intel AHCI controller and Intel SAS
controller. They also support PCIe-SSD (solid state disk) enclosure LEDs
to control the storage enclosure status (OK, Fail, Rebuilding) LEDs of
PCIe-SSD devices that are part of an MD software RAID volume. The
applications might also work with the IBPI-compliant storage controllers
of other vendors (especially SAS/SCSI controllers); however, other
vendors’ controllers have not been tested.
ledmon and
ledctl are part of the ledmon package, which is not installed by
default. Run sudo zypper in ledmon to install it.
The ledmon application is a daemon
process that constantly monitors the state of MD software RAID devices or
the state of block devices in a storage enclosure or drive bay. Only a
single instance of the daemon should be running at a time. The ledmon daemon is part of Intel Enclosure LED
Utilities.
The state is visualized on LEDs associated with each slot in a storage array enclosure or a drive bay. The application monitors all software RAID devices and visualizes their state. It does not provide a way to monitor only selected software RAID volumes.
The ledmon daemon supports two
types of LED systems: A two-LED system (Activity LED and Status LED) and a
three-LED system (Activity LED, Locate LED, and Fail LED). This tool has
the highest priority when accessing the LEDs.
To start ledmon, enter
sudo ledmon [options]
where [options] is one or more of the following:
ledmon #
The configuration is read from ~/.ledctl or from
/etc/ledcfg.conf if existing. Use this option to
specify an alternative configuration file.
Currently this option has no effect, since support for configuration
files has not been implemented yet. See man 5
ledctl.conf for details.
Sets a path to local log file. If this user-defined file is specified,
the global log file /var/log/ledmon.log is not
used.
Sets the time interval between scans of sysfs.
The value is given in seconds. The minimum is 5 seconds. The maximum
is not specified.
Specifies the verbosity level. The level options are specified in the order of no information to the most information. Use the --quiet option for no logging. Use the --all option to log everything. If you specify more then one verbose option, the last option in the command applies.
Prints the command information to the console, then exits.
Displays version of ledmon and information about
the license, then exits.
The ledmon daemon does not recognize the PFA
(Predicted Failure Analysis) state from the SFF-8489 specification.
Thus, the PFA pattern is not visualized.
The Enclosure LED Application (ledctl) is a user
space application that controls LEDs associated with each slot in a
storage enclosure or a drive bay. The ledctl
application is a part of Intel Enclosure LED Utilities.
When you issue the command, the LEDs of the specified devices are set to a
specified pattern and all other LEDs are turned off. This application
needs to be run with root privileges. Because the ledmon application has the highest priority
when accessing LEDs, some patterns set by ledctl might have no effect if
the ledmon daemon is running
(except for the Locate pattern).
The ledctl application supports two types of LED
systems: A two-LED system (Activity LED and Status LED) and a three-LED
system (Activity LED, Fail LED, and Locate LED).
To start ledctl, enter
sudo [options] pattern_name=list_of_devices
where [options] is one or more of the following:
Sets a path to local configuration file. If this option is specified, the global configuration file and user configuration file have no effect.
Sets a path to local log file. If this user-defined file is
specified, the global log file
/var/log/ledmon.log is not used.
Turns off all messages sent to stdout or
stderr out. The messages are still logged to
local file and the syslog facility.
Prints the command information to the console, then exits.
Displays version of ledctl and information about
the license, then exits.
The ledctl application accepts the following names
for argument, according to the SFF-8489
specification.
Turns on the Locate LED associated with the specified devices or empty slots. This state is used to identify a slot or drive.
Turns off the Locate LED associated with the specified devices or empty slots.
Turns off the Status LED, Failure LED, and Locate LED associated with the specified devices.
Turns off only the Status LED and Failure LED associated with the specified devices.
Visualizes the In a Critical Array pattern.
Visualizes the Rebuild pattern. This supports
both of the rebuild states for compatibility and legacy reasons.
Visualizes the In a Failed Array pattern.
Visualizes the Hotspare pattern.
Visualizes the Predicted Failure Analysis
pattern.
Visualizes the Failure pattern.
SES-2 R/R ABORT
SES-2 REBUILD/REMAP
SES-2 IN FAILED ARRAY
SES-2 IN CRITICAL ARRAY
SES-2 CONS CHECK
SES-2 HOTSPARE
SES-2 RSVD DEVICE
SES-2 OK
SES-2 IDENT
SES-2 REMOVE
SES-2 INSERT
SES-2 MISSING
SES-2 DO NOT REMOVE
SES-2 ACTIVE
SES-2 ENABLE BYP B
SES-2 ENABLE BYP A
SES-2 DEVICE OFF
SES-2 FAULT
When a non-SES-2 pattern is sent to a device in an enclosure, the pattern is automatically translated to the SCSI Enclosure Services (SES) 2 pattern as shown above.
|
Non-SES-2 Pattern |
SES-2 Pattern |
|---|---|
|
locate |
ses_ident |
|
locate_off |
ses_ident |
|
normal |
ses_ok |
|
off |
ses_ok |
|
ica |
ses_ica |
|
degraded |
ses_ica |
|
rebuild |
ses_rebuild |
|
rebuild_p |
ses_rebuild |
|
ifa |
ses_ifa |
|
failed_array |
ses_ifa |
|
hotspare |
ses_hotspare |
|
pfa |
ses_rsvd_dev |
|
failure |
ses_fault |
|
disk_failed |
ses_fault |
When you issue the ledctl command, the LEDs of the
specified devices are set to the specified pattern and all other LEDs
are turned off. The list of devices can be provided in one of two
formats:
A list of devices separated by a comma and no spaces
A list in curly braces with devices separated by a space
If you specify multiple patterns in the same command, the device list for each pattern can use the same or different format. For examples that show the two list formats, see Section 11.2.3, “Examples”.
A device is a path to file in the /dev directory
or in the /sys/block directory. The path can
identify a block device, an MD software RAID device, or a container
device. For a software RAID device or a container device, the reported
LED state is set for all of the associated block devices.
The LEDs of devices listed in list_of_devices are set to the given pattern pattern_name and all other LEDs are turned off.
To locate a single block device:
sudo ledctl locate=/dev/sda
To turn off the Locate LED for a single block device:
sudo ledctl locate_off=/dev/sda
To locate disks of an MD software RAID device and to set a rebuild pattern for two of its block devices at the same time:
sudo ledctl locate=/dev/md127 rebuild={ /sys/block/sd[a-b] }To turn off the Status LED and Failure LED for the specified devices:
sudo ledctl off={ /dev/sda /dev/sdb }To locate three block devices run one of the following commends (both are equivalent):
sudo ledctl locate=/dev/sda,/dev/sdb,/dev/sdc
sudo ledctl locate={ /dev/sda /dev/sdb /dev/sdc }See the following resources for details about the LED patterns and monitoring tools: