1ipmi_sim_cmd(5)           IPMI LAN Simulator commands          ipmi_sim_cmd(5)
2
3
4

DESCRIPTION

6       The  ipmi_sim  emulation  is  set up using these commands.  They can be
7       read from a command file, run from the command line, or executed inside
8       the simulator after it is started.
9
10       This  may be a little confusing, but the network interfaces are config‐
11       ured by the ipmi_lan configuration file,  and  the  various  management
12       controllers,  sensors,  etc. are specified using this file.  Plus, this
13       can be used to configure the simulator after it is up, set sensor  val‐
14       ues, inject events, and things of that nature.
15
16

GENERAL COMMANDS

18       Blank lines and lines starting with `#' are ignored.  Long lines may be
19       broken up by putting a '´ at the end of the line to be continued.
20
21
22       quit   Exit the simulator
23
24
25       include "file"
26              Include the given file.
27
28
29       define name "value"
30
31              Define the given name as a variable with the given value.   This
32              variable  may be used later by doing $name.  This cannot be used
33              in quotes, but quotes may be broken  up  and  the  variable  put
34              between them.  For instance, if you say:
35
36              define MCNUM "40"
37
38              you can use it later as in
39
40              mc_add $MCNUM 1 no-device-sdrs 00  00  00  0xc9  0x009000 0x0002
41
42              or
43
44              sensor_add    $MCNUM    0    21   12   0x6f   poll   1000   file
45              "/sys/dev/sens1-"$MCNUM"-1"
46
47
48       sleep time
49              Pause the command interface for the  given  number  of  seconds.
50              This does not affect the execution of the simulator.
51
52
53       debug options
54              Set the debugging output.  Valid options are:
55
56              msg Dump messages.
57
58              raw Dump raw I/O
59
60              Entering nothing turns of debugging.
61
62
63       read_cmds filename
64              Execute the commands in the given file.
65
66

MC COMMANDS

68       mc_add  IPMBAddress  DeviceID  HasDeviceSDRs  DeviceRevision MajorFWRev
69       MinorFWRev DeviceSupport ManufacturerID ProductID
70              Add an MC to the simulator.  All values are hexadecimal.   These
71              are  mostly  values  for  the ``Get Device ID'' command, see the
72              spec for details.  Note that the MC is not enabled  after  being
73              added, you must add it.
74
75              Note  that  some of these values control the capabilities of the
76              MC.  For instance, HasDeviceSDRs sets whether device SDR reposi‐
77              tory commands will work.
78
79              You may use has-device-sdrs or no-device-sdrs in the HasDeviceS‐
80              DRs field.
81
82
83       mc_add_fru_data mc-addr DeviceID FRUSize (data [byte1 [byte2 [...]]]  |
84       file offset filename)
85              Set the FRU data for a given MC and device id.  Data may be sup‐
86              plied directly here, or it may be given as a file.   The  offset
87              is  the  start  from the beginning of the file where the data is
88              kept.
89
90
91       mc_dump_fru_data mc-addr DeviceID
92              Dump the FRU data for a given MC and device id.
93
94
95       mc_delete mc-addr
96              Remove the MC from the system.
97
98
99       mc_disable mc-addr
100              Disable the MC, but don't remove it.
101
102
103       mc_enable mc-addr
104              Enable the given MC.
105
106
107       mc_setbmc mc-addr
108              Set the BMC's address.
109
110
111       mc_set_guid mc-addr guid
112              Set the GUID value.  The guid may be a string (in quotes)  or  a
113              hexadecimal string.
114
115
116       sel_enable mc-addr max-entries flags
117              Enable  the  System  Event  Log on the given MC.  The flags is a
118              byte this is returned from the ``Get SEL Info'' command; it con‐
119              trols various aspects of the SEL.  See the spec for details.
120
121
122       sel_add mc-addr RecordType byte1 byte2 ... byte13
123              Add an entry to the MC's SEL.
124
125
126       main_sdr_add mc-addr byte1 [byte2 [...]]
127              Add an entry to the main SDR of the MC.
128
129
130       device_sdr_add mc-addr LUN byte1 [byte2 [...]]
131              Add an entry to the device SDR of the MC.
132
133

SENSOR COMMANDS

135       sensor_add  mc-addr LUN sensor-num sensor-type event-reading-code [poll
136       poll_rate poll_type poll_type_options] [event-only]
137
138              Add a sensor to the given MC and LUN.  The type of sensor is set
139              by the event reading code.
140
141              If  poll  is specified, then the sensor will be polled for data.
142              Only the file poll type is currently supported.  The value is  a
143              number  read  from  a  file.   It has the following options, all
144              optional:
145
146              div=val will divide the read value by the given number.  This is
147              done after the multiply operation.
148
149              mult=val will multiply the read value by the given number.  This
150              is done after the subtraction.
151
152              sub=val will subtract the value by the given  number.   This  is
153              done after the mask.
154
155              mask=val will mask (bitwise and) the value by the given number.
156
157              base=value Specify the base of the value read from the file.  By
158              default this is zero, meaning "C" conventions are used.
159
160              initstate=value sets what the event state is initially  set  to.
161              This  is  useful for discrete sensors with bits that should nor‐
162              mally be set to "1", like a presence bit, to  keep  the  program
163              from issuing an event every time the program starts.
164
165              raw  specifies that the data from the file is a raw value.  Only
166              length bytes are read from offset.
167
168              ascii specifies that the data from the file is in  ASCII.   This
169              is the default.  The offset value is used, but no the length.
170
171              length=val  specifies  the  length  of the data to read from the
172              file.  The maximum value is 4,and this  is  only  used  for  raw
173              data.
174
175              depends=<mc_addr>,<lun>,<sensor_number>,<bit>  specifies  a dis‐
176              crete sensor bit that must be set to 1  for  the  sensor  to  be
177              active.  Generally, you use the presence bit of a sensor to mark
178              whether other sensors on the device are actually present.   Each
179              of  the  other  sensors  would have one of these pointing to the
180              presence bit.
181
182              event-only specifies that the sensor will not  be  readable,  it
183              will only generate events (specified with a type 3 SDR).
184
185
186       sensor_set_bit  mc-addr  LUN  sensor-num bit-to-set bit-value generate-
187       event
188              Set the given bit to bit-value (0 or 1) for the  sensor  by  bit
189              number,  either  the threshold for analog or the discrete sensor
190              bit.  If generate-event is non-zero and the  sensor  has  events
191              enabled for that bit, then generate an event.
192
193
194       sensor_set_bit_clr_rest  mc-addr  LUN  sensor-num  bit-to-set bit-value
195       generate-event
196              Like sensor_set_bit, but automatically clears all other bits.
197
198
199       sensor_set_value mc-addr LUN sensor-num value generate-event
200              Set the byte value for an analog sensor.  If the sensor  exceeds
201              a  threshold,  the sensor has events enabled, and generate-event
202              is non-zero, then generate an event for the condition.
203
204
205       sensor_set_hysteresis mc-addr LUN sensor-num support positive negative
206              Set the hysteresis capabilities of the sensor.  It  must  be  an
207              analog  sensor.  The support value is the hysteresis capability,
208              the same as the hysteresis support value in the sensor SDR.  The
209              positive  and  negative  hysteresis  values are also set by this
210              command.
211
212              The support value may also be none, readable, settable, or fixed
213              instead of the numbers.
214
215
216       sensor_set_threshold  mc-addr  LUN sensor-num threshold-support thresh‐
217       old-enabled [value5 [value4 [... [value0]]]]
218
219              Set the threshold support for a sensor.  It must  be  an  analog
220              sensor.   The threshold-support value is the same as the thresh‐
221              old access support value in  the  sensor  SDR.   The  threshold-
222              enabled  values  is  a string of ``0'' and ``1'' characters that
223              enable the 6 corresponding thresholds; the  rightmost  value  is
224              value  0,  the  leftmost  is value 5.  Optionally, the threshold
225              values may be specified as their byte values.
226
227              The threshold-support value may also  be  none,  readable,  set‐
228              table,  or fixed to make it a bit more readable.  The thresholds
229              are:
230
231              0 - lower non critical
232
233              1 - lower critical
234
235              2 - lower non recoverable
236
237              3 - upper non critical
238
239              4 - upper critical
240
241              5 - upper non recoverable
242
243
244       sensor_set_event_support mc-addr LUN sensor-num events-enable  scanning
245       event-support  assert-support deassert-support assert-enabled deassert-
246       enabled
247
248              Set the event support  of  a  sensor.   The  events-enable  will
249              enable  global  events on the sensor if non-zero, otherwise they
250              are disabled.  The scanning values set the  scanning  value  for
251              the sensor.  The event-support value sets the event capabilities
252              in the sensor, this is the same as the  ``sensor  event  message
253              control  support'' value in the sensor SDR.  The assert-support,
254              deassert-support, assert-enabled, and deassert-enabled  are  all
255              bitmasks (a string of ``0'' and ``1'' characters) that set their
256              corresponding sensor bit's capability to generate  events  (sup‐
257              port) and whether it will generate events now (enabled).
258
259              Note  that  all  bitmasks have the rightmost digit as the zeroth
260              bit, and the leftmost digit as the highest order bit.  Note that
261              you  must  specify  15  bits  here, even if you don't use all of
262              them.
263
264              Note that you may use enable or  disable  in  the  events-enable
265              field,  and  you may use scanning or no-scanning in the scanning
266              field.
267
268              For event-support, you may use per-state, entire-sensor,  global
269              or none instead of a number.
270
271              For a threshold sensor, the values are:
272
273              0
274               - lower non-critical going low
275
276              1
277               - lower non-critical going high
278
279              2
280               - lower critical going low
281
282              3
283               - lower critical going high
284
285              4
286               - lower non-recoverable going low
287
288              5
289               - lower non-recoverable going high
290
291              6
292               - upper non-critical going low
293
294              7
295               - upper non-critical going high
296
297              8
298               - upper critical going low
299
300              9
301               - upper critical going high
302
303              1
304               - upper non-recoverable going low
305
306              1
307               - upper non-recoverable going high
308
309              Note  that  the  "lower going high" and "upper going low" values
310              are not supported, since they are simply stupid.
311
312
313

ATCA OEM COMMANDS

315       These are for emulation of special ATCA capabilities.
316
317
318       atca_enable
319              The system is an ATCA system, enables the other  ATCA  capabili‐
320              ties.
321
322              Note  that  you  should  do this *before* creating any MCs (this
323              should really be first) because the MCs are set up a little dif‐
324              ferently  for ATCA mode.  This causes the MCs to be able to han‐
325              dle PICMG commands properly, sets up  2  LEDs  by  default,  and
326              enables  proper  hot-swap  handling, including the blue LED.  By
327              default the blue LED supports local control and the  other  LEDs
328              do not and are red.
329
330              In  ATCA  mode,  to drive the hot-swap state machine, you should
331              use sensor_set_bit_clr_rest to set the hot-swap state.
332
333
334       atca_set_site hardware-address site-type site-number
335              Sets the given values for an ATCA system, the values returned by
336              the get address commands.
337
338
339       mc_set_num_leds mc-addr count
340              Set the number of ATCA LEDs the MC has.
341
342
343       mc_set_power mc-addr power gen-event
344              Set  the ATCA power setting for the MC as its numeric value.  If
345              gen-event is non-zero, generate an event for the change.
346
347

FILES

349       /etc/ipmi/lan.conf
350
351

SEE ALSO

353       ipmi_sim(1)
354
355

KNOWN PROBLEMS

357       IPMI is unnecessarily complicated.  Hords of capabilities are  not  yet
358       implemented.
359
360

AUTHOR

362       Corey Minyard <cminyard@mvista.com>
363
364
365
366OpenIPMI                           06/26/12                    ipmi_sim_cmd(5)
Impressum