Menu

#381 Log OS installation status as SEL events

version-1.8.16
closed-fixed
None
5
2015-07-25
2014-05-07
No

Further to Patch #92 (Bug #301), it would be useful to add support to Linux OS installers to use IPMI to set the installation status in the SEL.

Here is a script that makes it easy to set this status from within installation scripts.

For an example of where this can be used, see:
https://github.com/yast/yast-yast2/blob/master/library/general/doc/Hooks.md#file-name-format

1 Attachments

Discussion

  • Charles Rose

    Charles Rose - 2014-05-07

    Please ignore previous attachment. Consider this one.

     
    • Zdenek Styblik

      Zdenek Styblik - 2014-05-07

      Edit: missing 'ERROR:' string and something I can't remember right now.

       

      Last edit: Zdenek Styblik 2014-05-07
  • Zdenek Styblik

    Zdenek Styblik - 2014-05-23
    • status: open --> pending
     
  • Zdenek Styblik

    Zdenek Styblik - 2015-07-22

    Charles,

    here are my comments:

    IPMI_CMD="/usr/bin/ipmitool"
    

    I suggest:

    IPMI_CMD=$(which ipmitool | head -n1)
    

    EDIT: I admit that which doesn't have to be installed, so it's a bit tricky.

    Instead of:

    printf "0x04 %s 0x00 0x6f %s 0x00 0x00" ${type} ${status} > \
        ${tmpfile} && \
        ${IPMI_CMD} sel add ${tmpfile} > /dev/null 2>&1
    

    Try:

    printf "0x04 %s 0x00 0x6f %s 0x00 0x00" ${type} ${status} | \
        ${IPMI_CMD} sel add /dev/stdin > /dev/null 2>&1
    

    I haven't tested it with ipmitool itself, but it should work without any problems(99% confidence). No need for temp file.

    I'd write this:

        1) printf -- %s\\n "Usage: $0 <os_boot|os_shutdown|inst_start|inst_complete|inst_abort|inst_fail>" ;;
        2) printf -- %s\\n "failed to communicate with BMC." ;;
        3) printf -- %s\\n "error adding ipmi sel entry." ;;
    

    as:

        1) printf "Usage: %s <os_boot|os_shutdown|inst_start|inst_complete|inst_abort|inst_fail>\n" "${0}" ;;
        2) printf "failed to communicate with BMC.\n" ;;
        3) printf "error adding ipmi sel entry.\n" ;;
    

    There is no for %s and then string as params. Also, since 2 and 3 are errors, perhaps they should end up on STDERR(1>&2).

    All of the above are just suggestions and the scripts can be merged without those. It looks ok.

     

    Last edit: Zdenek Styblik 2015-07-22
  • Zdenek Styblik

    Zdenek Styblik - 2015-07-25

    Ticket moved from /p/ipmitool/patches/97/

     
  • Zdenek Styblik

    Zdenek Styblik - 2015-07-25
    • status: pending --> closed-fixed
    • assigned_to: Zdenek Styblik
    • Group: version-cvs --> version-1.8.16
     
  • Zdenek Styblik

    Zdenek Styblik - 2015-07-25

    I've committed it. If you want to implement changes I've suggested, please, open new ticket for those. Thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.