# ipmi_sim_cmd - man(5) - [phpMan]

[_ipmi_sim_cmd_(5)](https://www.chedong.com/phpMan.php/man/ipmisimcmd/5/markdown)                      IPMI LAN Simulator commands                     [_ipmi_sim_cmd_(5)](https://www.chedong.com/phpMan.php/man/ipmisimcmd/5/markdown)

## DESCRIPTION
       The **ipmi_sim **emulation is set up using these commands.  They can be read from a command file,
       run from the command line, or executed inside the simulator after it is started.

       This  may  be  a  little confusing, but the network interfaces are configured by the ipmi_lan
       configuration file, and the various management controllers, sensors, etc. are specified using
       this file.  Plus, this can be used to configure the simulator after it is up, set sensor val‐
       ues, inject events, and things of that nature.


## GENERAL COMMANDS
       Blank lines and lines starting with `#' are ignored.  Long lines may be broken up by  putting
       a '´ at the end of the line to be continued.


       **quit   **Exit the simulator


       **include _**"file"_
              Include the given file.


       **define _**name_ _"value"_

              Define  the  given name as a variable with the given value.  This variable may be used
              later by doing _$name_.  This cannot be used in quotes, but quotes may be broken up  and
              the variable put between them.  For instance, if you say:

              define MCNUM "40"

              you can use it later as in

              mc_add $MCNUM 1 no-device-sdrs 00  00  00  0xc9  0x009000 0x0002

              or

              sensor_add $MCNUM 0 21 12 0x6f poll 1000 file "/sys/dev/sens1-"$MCNUM"-1"


       **sleep _**time_
              Pause the command interface for the given number of seconds.  This does not affect the
              execution of the simulator.


       **debug _**options_
              Set the debugging output.  Valid options are:

              _msg_ Dump messages.

              _raw_ Dump raw I/O

              Entering nothing turns of debugging.


       **read_cmds _**filename_
              Execute the commands in the given file.


## MC COMMANDS
       **mc_add _**IPMBAddress_ _DeviceID_ _HasDeviceSDRs_ _DeviceRevision_ _MajorFWRev_ _MinorFWRev_ _DeviceSupport_
       _ManufacturerID_ _ProductID_
              Add  an MC to the simulator.  All values are hexadecimal.  These are mostly values for
              the ``Get Device ID'' command, see the spec for details.  Note that the MC is not  en‐
              abled after being added, you must add it.

              Note that some of these values control the capabilities of the MC.  For instance, Has‐
              DeviceSDRs sets whether device SDR repository commands will work.

              You may use has-device-sdrs or no-device-sdrs in the HasDeviceSDRs field.


       **mc_add_fru_data _**mc-addr_ _DeviceID_ _FRUSize_ (data [_byte1_ [_byte2_ [...]]] | _file_ _offset_ _filename)_
              Set the FRU data for a given MC and device id.  Data may be supplied directly here, or
              it  may  be  given  as a file.  The offset is the start from the beginning of the file
              where the data is kept.


       **mc_dump_fru_data _**mc-addr_ _DeviceID_
              Dump the FRU data for a given MC and device id.


       **mc_delete _**mc-addr_
              Remove the MC from the system.


       **mc_disable _**mc-addr_
              Disable the MC, but don't remove it.


       **mc_enable _**mc-addr_
              Enable the given MC.


       **mc_setbmc _**mc-addr_
              Set the BMC's address.


       **mc_set_guid _**mc-addr_ _guid_
              Set the GUID value.  The guid may be a string (in quotes) or a hexadecimal string.


       **sel_enable _**mc-addr_ _max-entries_ _flags_
              Enable the System Event Log on the given MC.  The flags is a  byte  this  is  returned
              from  the  ``Get  SEL Info'' command; it controls various aspects of the SEL.  See the
              spec for details.


       **sel_add _**mc-addr_ _RecordType_ _byte1_ _byte2_ ... _byte13_
              Add an entry to the MC's SEL.


       **main_sdr_add _**mc-addr_ _byte1_ [_byte2_ [...]]
              Add an entry to the main SDR of the MC.


       **device_sdr_add _**mc-addr_ _LUN_ _byte1_ [_byte2_ [...]]
              Add an entry to the device SDR of the MC.


## SENSOR COMMANDS
       **sensor_add _**mc-addr_ _LUN_ _sensor-num_ _sensor-type_ _event-reading-code_ [_poll_ _poll_rate_ _poll_type_
       _poll_type_options_] [event-only]

              Add a sensor to the given MC and LUN.  The type of sensor is set by the event  reading
              code.

              If  _poll_  is  specified,  then the sensor will be polled for data.  Only the _file_ poll
              type is currently supported.  The value is a number read from a file.  It has the fol‐
              lowing options, all optional:

              _div=val_ will divide the read value by the given number.  This is done after the multi‐
              ply operation.

              _mult=val_ will multiply the read value by the given number.  This  is  done  after  the
              subtraction.

              _sub=val_ will subtract the value by the given number.  This is done after the mask.

              _mask=val_ will mask (bitwise and) the value by the given number.

              _base=value_ Specify the base of the value read from the file.  By default this is zero,
              meaning "C" conventions are used.

              _initstate=value_  sets  what  the  event state is initially set to.  This is useful for
              discrete sensors with bits that should normally be set to "1", like a presence bit, to
              keep the program from issuing an event every time the program starts.

              _raw_ specifies that the data from the file is a raw value.  Only _length_ bytes are  read
              from _offset_.

              _ascii_  specifies  that  the data from the file is in ASCII.  This is the default.  The
              _offset_ value is used, but no the _length_.

              _length=val_ specifies the length of the data to read from the file.  The maximum  value
              is 4,and this is only used for raw data.

              _depends=<mc_addr>,<lun>,<sensor_number>,<bit>_  specifies  a  discrete  sensor bit that
              must be set to 1 for the sensor to be active.  Generally, you use the presence bit  of
              a  sensor  to  mark whether other sensors on the device are actually present.  Each of
              the other sensors would have one of these pointing to the presence bit.

              _event-only_ specifies that the sensor will not  be  readable,  it  will  only  generate
              events (specified with a type 3 SDR).


       **sensor_set_bit _**mc-addr_ _LUN_ _sensor-num_ _bit-to-set_ _bit-value_ _generate-event_
              Set  the  given  bit  to  bit-value  (0 or 1) for the sensor by bit number, either the
              threshold for analog or the discrete sensor bit.  If generate-event  is  non-zero  and
              the sensor has events enabled for that bit, then generate an event.


       **sensor_set_bit_clr_rest _**mc-addr_ _LUN_ _sensor-num_ _bit-to-set_ _bit-value_ _generate-event_
              Like sensor_set_bit, but automatically clears all other bits.


       **sensor_set_value _**mc-addr_ _LUN_ _sensor-num_ _value_ _generate-event_
              Set  the byte value for an analog sensor.  If the sensor exceeds a threshold, the sen‐
              sor has events enabled, and generate-event is non-zero, then generate an event for the
              condition.


       **sensor_set_hysteresis _**mc-addr_ _LUN_ _sensor-num_ _support_ _positive_ _negative_
              Set the hysteresis capabilities of the sensor.  It must be an analog sensor.  The sup‐
              port value is the hysteresis capability, the same as the hysteresis support  value  in
              the sensor SDR.  The positive and negative hysteresis values are also set by this com‐
              mand.

              The  support  value may also be none, readable, settable, or fixed instead of the num‐
              bers.


       **sensor_set_threshold _**mc-addr_ _LUN_ _sensor-num_ _threshold-support_ _threshold-enabled_ [_value5_
       [_value4_ [... [_value0_]]]]

              Set the threshold support for a sensor.  It must be an analog sensor.  The  threshold-
              support  value  is  the  same as the threshold access support value in the sensor SDR.
              The threshold-enabled values is a string of ``0'' and ``1'' characters that enable the
              6 corresponding thresholds; the rightmost value is value 0, the leftmost is  value  5.
              Optionally, the threshold values may be specified as their byte values.

              The  threshold-support value may also be none, readable, settable, or fixed to make it
              a bit more readable.  The thresholds are:

              _0_ - lower non critical

              _1_ - lower critical

              _2_ - lower non recoverable

              _3_ - upper non critical

              _4_ - upper critical

              _5_ - upper non recoverable


       **sensor_set_event_support _**mc-addr_ _LUN_ _sensor-num_ _events-enable_ _scanning_ _event-support_ _assert-_
       _support_ _deassert-support_ _assert-enabled_ _deassert-enabled_

              Set the event support of a sensor.  The events-enable will enable global events on the
              sensor if non-zero, otherwise they are disabled.  The scanning values set the scanning
              value for the sensor.  The event-support value sets the event capabilities in the sen‐
              sor, this is the same as the ``sensor event message control  support''  value  in  the
              sensor  SDR.   The  assert-support, deassert-support, assert-enabled, and deassert-en‐
              abled are all bitmasks (a string of ``0'' and ``1'' characters) that set their  corre‐
              sponding sensor bit's capability to generate events (support) and whether it will gen‐
              erate events now (enabled).

              Note  that  all  bitmasks have the rightmost digit as the zeroth bit, and the leftmost
              digit as the highest order bit.  Note that you must specify 15 bits here, even if  you
              don't use all of them.

              Note  that  you  may use enable or disable in the events-enable field, and you may use
              scanning or no-scanning in the scanning field.

              For event-support, you may use per-state, entire-sensor, global or none instead  of  a
              number.

              For a threshold sensor, the values are:

              _0_
               - lower non-critical going low

              _1_
               - lower non-critical going high

              _2_
               - lower critical going low

              _3_
               - lower critical going high

              _4_
               - lower non-recoverable going low

              _5_
               - lower non-recoverable going high

              _6_
               - upper non-critical going low

              _7_
               - upper non-critical going high

              _8_
               - upper critical going low

              _9_
               - upper critical going high

              _1_
               - upper non-recoverable going low

              _1_
               - upper non-recoverable going high

              Note that the "lower going high" and "upper going low" values are not supported, since
              they are simply stupid.



## ATCA OEM COMMANDS
       These are for emulation of special ATCA capabilities.


### atca_enable
              The system is an ATCA system, enables the other ATCA capabilities.

              Note  that  you should do this *before* creating any MCs (this should really be first)
              because the MCs are set up a little differently for ATCA mode.  This causes the MCs to
              be able to handle PICMG commands properly, sets up 2  LEDs  by  default,  and  enables
              proper  hot-swap  handling,  including the blue LED.  By default the blue LED supports
              local control and the other LEDs do not and are red.

              In  ATCA  mode,  to  drive  the  hot-swap  state  machine,   you   should   use   sen‐
              sor_set_bit_clr_rest to set the hot-swap state.


       **atca_set_site _**hardware-address_ _site-type_ _site-number_
              Sets  the given values for an ATCA system, the values returned by the get address com‐
              mands.


       **mc_set_num_leds _**mc-addr_ _count_
              Set the number of ATCA LEDs the MC has.


       **mc_set_power _**mc-addr_ _power_ _gen-event_
              Set the ATCA power setting for the MC as its numeric value.  If gen-event is non-zero,
              generate an event for the change.


## FILES
       /etc/ipmi/lan.conf


## SEE ALSO
       [**ipmi_sim**(1)](https://www.chedong.com/phpMan.php/man/ipmisim/1/markdown)


## KNOWN PROBLEMS
       IPMI is unnecessarily complicated.  Hords of capabilities are not yet implemented.


## AUTHOR
       Corey Minyard <<cminyard@mvista.com>>

OpenIPMI                                      06/26/12                               [_ipmi_sim_cmd_(5)](https://www.chedong.com/phpMan.php/man/ipmisimcmd/5/markdown)
