~ubuntu-branches/ubuntu/vivid/openipmi/vivid

1 by Noèl Köthe
Import upstream version 2.0.1
1
This is the OpenIPMI library, a library that makes simplifies building
2
complex IPMI management software.
3
4
What is IPMI?
5
=============
6
7
IPMI is a specification detailing how to detect and manage sensors in
8
a system.  It also specifies some chassis-level thing like power control,
9
reset, FRU (Field Replaceable Unit) information, and watchdogs.
10
11
However, IPMI has become much more than that.  Vendors have added
12
extensions to IPMI for doing many thing, including controlling LEDs,
13
relays, character displays, and managing hot-swapping components.  In
14
general, it has become the "standard" way to handle hardware
15
maintenance in a system.
16
17
IPMI specifies a set of interconnected intelligent Management
18
Controllers (MCs).  Each MC is a small CPU that manages a set of
19
sensors and/or output devices.  The "main" MC is called the Baseboard
20
Management Controller (BMC); it provides the external interfaces into
21
the system.
22
23
Each MC may have a set of Sensor Data Records (SDRs).  An SDR details
24
information about a sensor.  Some SDR records also have information
25
about entities, such as their name, the FRU information, and what
26
other entities they are contained in.
27
28
Entities are the physical objects in the system (boards, CPUs, fans,
29
power supplies, etc.)  A sensor is attached to the entity it monitors;
30
the SDR record tell what entity a sensor monitors.
31
32
IPMI specifies several external interfaces to the BMC.  One set is
33
local interfaces directly to a CPU, a local CPU connections is called
34
a system interface.  The other is external interfaces through a LAN,
35
serial port, or modem.  The external interfaces allow a system to be
36
managed even when it is turned off, since the BMC is always powered
37
when the system is plugged in.
38
39
IPMI has a strong bent toward complete "chassis" systems, basically a
40
box with one main board with CPUs; a BMC, and perhaps a few satellite
41
MCs in things like power supplies.  It is being rapidly adopted in
42
"shelf" systems, which has a set of slots where you can plug in
43
complete single-board computers.  In shelf systems, the BMC becomes a
44
central shelf manager that manages all the boards in the shelf.
45
Although IPMI was not designed for this, it does a pretty good job of
46
extending into this architecture.
47
48
49
What is OpenIPMI?
50
=================
51
52
Notice that in the description above, OpenIPMI was designed to aid
53
building "complex IPMI management software".  That's a carefully
54
chosen description.  
55
56
Most of the OpenIPMI library was designed for building complicated
57
systems that continuously monitor IPMI hardware.  It's not for little
58
things that simply want to get some information, do something, and
59
leave (unless that information is elaborate information).
60
61
OpenIPMI will connect with an IPMI controller, detect any management
62
controllers on the bus, get their SDRs, manage all the entities in the
63
system, manage the event log, and a host of other things.  As you
64
might imagine, that is a fairly lengthy process on a complex system.
65
66
OpenIPMI is also dynamic and event-driven.  It will come up and start
67
discovering things in the managed system.  As it discovers things, it
68
will report them to the software using it (assuming the software has
69
asked for this reporting).  This process of discovery is never done
70
from OpenIPMI's point of view; things can come and go in the system
71
and it will report these changes as it detects them.  This can be a
72
little confusing to people who want a static view of their system.
73
OpenIPMI has no static view (though it does have a current view).
74
When you make a connection, it will report when the connection is up;
75
but the system will be "empty".  You have to wait for OpenIPMI to
76
report the things it finds.
77
78
It is possible to use OpenIPMI's low-level connection code if you want
79
to do a direct connection to a BMC (through the LAN or system
80
interface).  You can see the code in sample/ipmicmd.c for an example
81
of how to do this.  Most of the other pieces of OpenIPMI are not
82
useful by themselves, though, because they are intrinsically tied
83
together.
84
85
86
Building and Configuring OpenIPMI
87
=================================
88
89
OpenIPMI is built with standard autoconf/automake.
90
91
You must configure OpenIPMI before you compile it.  To do this, change
92
to the main OpenIPMI directory and execute "./configure".  The
93
configure script will detect what is available in the system and
94
configure itself accordingly.
95
96
By default, the configure script will cause OpenIPMI to be installed
97
in the "/usr/local" prefix.  This means that the include files go into
98
/usr/local/include/OpenIPMI, the libraries go into /usr/local/lib, the
99
executables go into /usr/local/bin, etc. If you want to change the
100
prefix, use the "--prefix=<prefix>" option to configure.  For
101
instance, to install in /opt/OpenIPMI, you would do:
102
	  ./configure --prefix=/opt/OpenIPMI
103
104
Note that OpenIPMI will attempt to detect and use either the NET SNMP
105
or UCD SNMP libraries.  Note that if your NET SNMP or UCD SNMP library
106
is in a non-standard location, you will need to use the
107
'--with-ucdsnmp=<path>' option with configure to specify the actual
108
path to your library.  You also *must* have the development system for
109
your SNMP library installed.  If you don't have the development system
110
installed, just the runtime libraries, OpenIPMI will not detect or use
111
the SNMP libraries.  If you do not want to use the SNMP libraries even
112
if they are installed, you can specify '--with-ucdsnmp=no' as a
113
configure option.
114
115
After you have configured OpenIPMI, type "make" to build it.  To
116
install it in the prefix you defined, do "make install".
117
118
OpenIPMI requires the following packages:
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
119
120
  * popt
121
  * curses, ncurses or termcap
122
123
OpenIPMI can use, but does not require, the following packages:
124
125
  * netsnmp or ucdsnmp - netsnmp is the preferred SNMP package, but
126
    it will use either of these.  Without this, the sample programs
127
    will not be able to receive SNMP traps, but there is no functional
128
    change to the library.
129
  * openssl - This is required for IPMI 2.0 RMCP+ encryption and
130
    authentication support.  See FAQ item 2.22 for details.
1.1.3 by Noèl Köthe
Import upstream version 2.0.11
131
  * glib (along with pkgconfig) - glib 2.0 is preferred, but glib 1.2
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
132
    will be used if 2.0 is not available.  This is simply an OS handler
133
    for glib and it not used for anything else in OpenIPMI itself, but
134
    is useful for users using glib.  Note that OpenIPMI will be able to
135
    use both glib 1.2 an glib 2.0 at the same time, but this is difficult
136
    and not recommended.
137
  * swig 1.3.21 or later - This is required for perl and python language
138
    support.  Without it, perl, python, and the GUI will not work.
139
  * perl - Support for writing scripts in the perl language that use
140
    the OpenIPMI library.
141
  * python - Support for writing scripts in the python language that use
142
    the OpenIPMI library.
143
  * Tcl/Tk - There is no Tcl language support (someone may contribute
144
    that, though).  However, A Tcl OS handler is provided so that
145
    Perl and Python may use the Tk widgets.  Without this, the GUI will
146
    not work.  Note that getting Tcl/Tk to work right can be difficult,
147
    see below for more details.
148
  * Tkinter/Tix - Python GUI libraries.  Required for the GUI to work.
149
  * gdbm - This is used on *nix for local SDR caching.  This is not
150
    required, but it *really* speeds up startup.
151
152
Note you need to install the development packages (generally ending in
153
-dev) of most of these for OpenIPMI to pick it up.  You can examine
154
the output of configure to make sure they are properly discovered.
155
156
157
Getting Tcl/Tk to work
158
======================
159
160
Tcl is installed in various places, and the configure script probably
161
won't find it.  If it doesn't, you must specify the install location
162
for Tcl by adding:
163
  --with-tclcflags=flags --with-tcllibs=lib
164
For instance, on my Debian Linux system, I have to specify:
165
  ./configure --with-tclcflags="-I /usr/include/tcl8.4" --with-tcllibs=-ltcl8.4
166
to make it work right.
167
168
If you don't get this right, you don't get a GUI!
169
170
1 by Noèl Köthe
Import upstream version 2.0.1
171
Using ipmish
172
============
173
174
ipmish is a command interpreter that lets you execute IPMI operations,
175
get the results, etc.  It gives you the full power of OpenIPMI.  It
176
can easily be driven with a TCL script or the like.  See the man page
177
for more details.
178
179
180
The OpenIPMI GUI
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
181
================
182
183
The GUI is cleverly named openipmigui and provides a GUI interface to
184
most of OpenIPMI.  It also has the standard command language (like
185
ipmish) available in a window, so it has all the power of ipmish.
186
187
To use the GUI, you have to have the following optional packages:
188
  * swig 1.3.21 or later
189
  * python
190
  * Tcl/Tk
191
  * Tkinter/Tix
192
193
The GUI is documented in the openipmigui man page.
194
195
196
Using ipmi_ui
1 by Noèl Köthe
Import upstream version 2.0.1
197
=============
198
199
ipmi_ui is a cheesy little tool that runs on top of the OpenIPMI
200
library.  It provides a command line and text-window based view into
201
an IPMI system.  A man page is included for it, if you want to know
202
more.
203
204
Note that ipmi_ui was written primarily for testing.  It does things
205
that users generally shouldn't do.  You can use it for examples, but
206
it touches things that are considered OpenIPMI internal, so be careful
207
what you use.  ipmish and the sample code is a much better example.
208
209
210
Perl/Python and OpenIPMI
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
211
========================
212
1 by Noèl Köthe
Import upstream version 2.0.1
213
OpenIPMI has perl and python bindings using swig.  The public
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
214
interface of OpenIPMI is available, but the private interfaces are not
215
(and a few other things like SNMP trap support).  It is fully
216
function.
217
1 by Noèl Köthe
Import upstream version 2.0.1
218
I was hoping that swig would generate documentation from the comments,
219
but it turns out that it does not do that.  You can look at
220
swig/OpenIPMI.i for the documentation on all the interfaces, and
221
swig/perl/sample and the gui in swig/python/openipmigui.py for a piece
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
222
of sample code that uses most of the interfaces.
223
1 by Noèl Köthe
Import upstream version 2.0.1
224
The interface is object-oriented, so you have to know how to do OO
225
Perl or Pythong to use this.  It is like this because that is the most
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
226
natural way to use SWIG (and it makes more OO languages like python
227
easier).
228
1 by Noèl Köthe
Import upstream version 2.0.1
229
230
OpenIPMI and SNMP
231
=================
232
233
The OpenIPMI ipmi_ui command has an optional trap handler.  It will
234
use incoming traps as an indication that something is waiting in the
235
SEL for it to fetch and immediately start a fetch.  You have to have
236
the UCD snmp library (or something compatible) installed for this to
237
work, and you have to start ipmi_ui with the '-snmp' option.  You must
238
do this as root, as the SNMP Trap port is 162.
239
240
You may ask why the trap is not directly used, why does it just
241
trigger an SEL fetch?  Well, that's because the IPMI trap does not
242
have enough information to determine the correct sensor (it's missing
243
the channel and LUN) and it does not have enough information to
244
correlate the SEL entries with the trap (It doesn't have the record ID
245
or necessarily the proper timestamp).
246
247
Also, OpenIPMI does not directly handle the traps.  Instead, it has an
248
interface to report a trap when it has been received.  OpenIPMI does
249
not want to assume the SNMP library being used; instead it lets the
250
user pick that library.  If you want an example of how to use the UCD
251
SNMP or NET SNMP libraries and hook them into OpenIPMI, the
252
ui/basic_ui.c file has an example of this.
253
254
255
What Else Comes with OpenIPMI?
256
==============================
257
258
It does include the utility "ipmicmd" which lets you do direct IPMI
259
commands to a connection.  ipmicmd can connect using the OpenIPMI
260
driver or via IPMI LAN.
261
262
OpenIPMI also includes a LAN to system interface converter, it can sit
263
on top of an OpenIPMI driver and supply a LAN connection to the BMC.
264
Note that to work the best, the LAN converter needs at least the v22
265
version of the OpenIPMI driver to support setting retries and timeouts
266
for messages.
267
268
Other sample code for using OpenIPMI is in the "samples" directory.
269
270
271
IPMI Documentation
272
==================
273
274
OpenIPMI includes a texinfo document in the "doc" directory.  It talks
275
a little about IPMI, must mostly about OpenIPMI.  It is required
276
reading for using OpenIPMI.  Read it carefully.
277
278
Unfortunately, the IPMI spec is also currently required reading for
279
using OpenIPMI.  Fortunately, you do not need to read the whole spec.
280
If you read the OpenIPMI document first, you can probably get by with
281
reading the following sections in the 1.5 spec:
282
 * 1.6 (overview)
283
 * 5.2 (for the error completion codes)
284
 * 33-36 (talking about sensors and entities)
285
 * 37.1 (talking about the main sensor SDR, mostly for learning about
286
   sensor capabilities).
287
OpenIPMI should hide the rest from you.
288
289
The OpenIPMI document is currently just an overview.  It should point
290
you in all the right directions, but it does not contain the actual
291
details of most OpenIPMI functions.  Those are currently documented in
292
the include files, so you will have to look through the include files
293
for how to use the functions.
294
295
296
OpenIPMI Source Structure
297
=========================
298
299
Note that parts of OpenIPMI could be used inside other systems.
300
However, the LGPL license may be a restriction.  If you are interested
301
in re-licensing parts of OpenIPMI, contact MontaVista software.
302
303
The source tree here consists of the following directories:
304
305
+---cmdlang - A command-line interpreter that gives access to the
1.2.1 by Noèl Köthe
Import upstream version 2.0.7
306
|             OpenIPMI library.  Includes a user interface named
307
|             openipmish that demonstrates how to use it.
308
|  
309
+--- doc - The main documentation for OpenIPMI
310
|
311
+---glib - A glib OS handler.
312
|  
313
+---include
314
|   +---linux - linux-specific include files
315
|   \---OpenIPMI - User-visible include files for OpenIPMI
316
|       \---internal - Internal include files, only for plugins
317
|
318
+---lanserv - Code to provide a LAN interface to an IPMI device and
319
|             to provide an IPMI simulator
320
|  
321
+---lib - The man OpenIPMI code.  This is where all the logic for the
322
|         handling of IPMI messages is.
323
|  
324
+---libedit - A readline replacement that provides cmdlang/openipmish
325
|   |         with command line editing.
326
|   \---editline - Include files for libedit
327
|
328
+---man - The man pages for the 
329
|
330
+---sample - Sample code and utilities that use the OpenIPMI library.
331
|  
332
+---swig - The main interpreter interface.  swig is a program that
333
|   |      takes a general description of a C/C++ interface and
334
|   |      provides the equivalent interface in various interpreters.
335
|   +---perl - Perl-specific code for swig, including sample code and
336
|   |          tests.
337
|   \---python - Python-specific code for swig.
338
|       \---openipmigui - A GUI for OpenIPMI, written in Python.
339
|
340
+---tcl - A TCL OS handler
341
|
342
+---ui - A depracated UI for OpenIPMI.
343
|  
344
+---unix - A POSIX OS handler, one for threaded and one for
345
|          non-threaded applications/
346
|  
347
\---utils - General utility code used by both the OpenIPMI library
348
            and by the lanserv code.
349
1 by Noèl Köthe
Import upstream version 2.0.1
350
351