X hits on this document

PDF document

February 10, 2006 - page 171 / 238

542 views

0 shares

0 downloads

0 comments

171 / 238

Appendix B

The Perl Interface

OpenIPMI has interface code that let’s Perl programs use OpenIPMI. The interface works much like the C interface. Some things are simplified, but in general it is very similar.

The interface uses object-oriented programming in Perl, so you must know how to do that in Perl. It’s pretty simple, really, but it’s somewhat strange if you already know another OO programming language.

As an example, to create a domain connection and read all the events, you might use the following code:

#!/usr/bin/perl

  • #

    get_events

#

  • #

    A sample perl program to get IPMI events from an BMC

#

  • #

    Author: MontaVista Software, Inc.

    • #

      Corey Minyard <minyard@mvista.com>

    • #

      source@mvista.com

#

  • #

    Copyright 2004 MontaVista Software Inc.

#

  • #

    This program is free software; you can redistribute it and/or

    • #

      modify it under the terms of the GNU Lesser General Public License

    • #

      as published by the Free Software Foundation; either version 2 of

    • #

      the License, or (at your option) any later version.

# #

  • #

    THIS SOFTWARE IS PROVIDED ‘‘AS IS’’ AND ANY EXPRESS OR IMPLIED

    • #

      WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

    • #

      MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

    • #

      IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,

    • #

      INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,

    • #

      BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS

    • #

      OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND

159

Document info
Document views542
Page views542
Page last viewedSun Dec 04 08:58:33 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments