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