1SG_SES(8) SG3_UTILS SG_SES(8)
2
3
4
6 sg_ses - send controls and fetch status from a SCSI Enclosure Services
7 (SES) device
8
10 sg_ses [--byte1=B1] [--control] [--data=H,H...] [--filter] [--help]
11 [--hex] [--inner-hex] [--list] [--page=PG] [--raw] [--status] [--ver‐
12 bose] [--version] DEVICE
13
15 Send controls to a SES device (via a SCSI SEND DIAGNOSTIC command) or
16 fetches status (via a SCSI RECEIVE DIAGNOSTIC RESULTS command). The
17 DEVICE should be a SES device which may be a dedicated enclosure ser‐
18 vices processor (INQUIRY peripheral device type 0xd) or attached to
19 another type of SCSI device (e.g. a disk) in which case the EncServ bit
20 set in its INQUIRY response.
21
22 If no options are given (only the DEVICE argument) then all diagnostic
23 pages supported by the device (including SES pages) are listed.
24
26 Arguments to long options are mandatory for short options as well. The
27 options are arranged in alphabetical order based on the long option
28 name.
29
30 -b, --byte1=B1
31 some control pages need byte 1 (i.e. the second byte) of the cdb
32 set. Only required in rare cases when the --control option is
33 also set. Default is 0; B1 is in decimal unless it is prefixed
34 by '0x' or '0X' (or has a trailing 'h' or 'H').
35
36 -c, --control
37 will send control information to the DEVICE via a SCSI SEND
38 DIAGNOSTIC command. Cannot give both this option and --status.
39 The Enclosure control, String Out, Threshold Out, Array control
40 (obsolete in SES-2) and Subenclosure String Out diagnostic pages
41 can be set currently.
42
43 -d, --data=H,H...
44 permits a string of comma separated (ASCII) hex bytes to be
45 specified (limit 512). A (single) space separated string of hex
46 bytes is also allowed but the list needs to be in quotes. This
47 allows the parameters to a control diagnostic page to be speci‐
48 fied. The string given should not include the first 4 bytes
49 (i.e. page code and length). See next entry for using stdin.
50
51 -d, --data=-
52 reads a data string from stdin. Spaces, tabs and line feeds
53 additionally are permitted as separators.
54
55 -f, --filter
56 cuts down on the amount of output from the enclosure status
57 diagnostic page. When this option is given, any line which has
58 all its binary flags cleared (i.e. 0) is filtered out (i.e.
59 ignored). If a line has some other value on it (e.g. a tempera‐
60 ture) then it is output.
61
62 -h, --help
63 output the usage message then exit.
64
65 -H, --hex
66 output the response in hexadecimal.
67
68 -i, --inner-hex
69 the outer levels of a status diagnostic page are decoded and
70 printed out but the innermost level (e.g. the element status
71 descriptor) is output in hex. Implemented for the more complex
72 diagnostic pages.
73
74 -l, --list
75 list all known diagnostic page names and SES elements. DEVICE is
76 ignored and utility exits.
77
78 -p, --page=PG
79 where PG is a page code. Assumed to be in decimal unless pre‐
80 fixed by 0x for hex. Valid range is 0 to 255 (0x0 to 0xff)
81 inclusive. Default is page_code 0 (i.e. "Supported diagnostic
82 pages").
83
84 -r, --raw
85 outputs the chosen status page in (ASCII) hex in a format suit‐
86 able for a later invocation using the --data= option. A status
87 diagnostic page less its first 4 bytes (page code and length) is
88 output. When used twice (e.g. -rr) outputs full diagnostic page
89 in binary to stdout.
90
91 -s, --status
92 will fetch status diagnostic page from the DEVICE via a SCSI
93 RECEIVE DIAGNOSTIC RESULTS command. If this option is not given
94 and --control is not given then --status is assumed.
95
96 -v, --verbose
97 increase the level of verbosity, (i.e. debug output).
98
99 -V, --version
100 print the version string and then exit.
101
103 Currently all status pages, control pages and element types defined in
104 SES-2 revision 17 (14th May 2007) are decoded.
105
106 This utility can be used to fetch arbitrary (i.e. non SES) diagnostic
107 pages (using the SCSI READ DIAGNOSTIC command). To this end the
108 --page=PG and --hex options would be appropriate. Arbitrary diagnostic
109 pages can be sent to a device with the sg_senddiag utility.
110
111 There is a related command set called SAF-TE (SCSI attached fault-tol‐
112 erant enclosure) for enclosure (including RAID) status and control.
113 SCSI devices that support SAF-TE report "Processor" peripheral device
114 type (0x3) in their INQUIRY response. See the sg_safte utility in this
115 package or safte-monitor on the internet.
116
118 To view the supported pages:
119
120 sg_ses /dev/sda
121
122 To view the configuration page:
123
124 sg_ses --page=1 /dev/sda
125
126 To view the status page:
127
128 sg_ses --page=2 /dev/sda
129
130 Changing a temperature threshold is possible, if a little awkward. The
131 current thresholds can be shown with:
132
133 sg_ses --page=5 /dev/sda
134
135 The threshold to be changed can be chosen. Then output the threshold
136 page in hex (suitable for editing) with:
137
138 sg_ses --page=5 --raw /dev/sda > t
139
140 Then with the aid of the SES-2 document (in revision 9: section 6.1.8)
141 use your favourite editor to change t. The change can be sent to the
142 device with:
143
144 sg_ses --control --page=5 --data=- /dev/sda < t
145
146 If the above is successful, the threshold should have been changed. To
147 check try:
148
149 sg_ses --page=5 /dev/sda
150
151 again.
152
154 The exit status of sg_ses is 0 when it is successful. Otherwise see the
155 sg3_utils(8) man page.
156
158 Written by Douglas Gilbert.
159
161 Report bugs to <dgilbert at interlog dot com>.
162
164 Copyright © 2004-2009 Douglas Gilbert
165 This software is distributed under a FreeBSD license. There is NO war‐
166 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
167 POSE.
168
170 sg_inq, sg_safte, sg_senddiag (in sg3_utils package); safte-monitor
171 (internet)
172
173
174
175sg3_utils-1.27 April 2009 SG_SES(8)