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