Skip to content

Instantly share code, notes, and snippets.

@xtha
Created February 1, 2019 09:16
Show Gist options
  • Save xtha/e0acb54846ec908c1929506fe3b06ff2 to your computer and use it in GitHub Desktop.
Save xtha/e0acb54846ec908c1929506fe3b06ff2 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
try:
from pyghmi.ipmi import command, fru, sdr, bmc
except ImportError:
command = None
ipmi_cmd = command.Command(
bmc='10.144.128.215', userid='admin', password='ohthai4o', port=623
)
ipmi = dict()
ipmi['asset_tag'] = ipmi_cmd.get_asset_tag()
ipmi['bootdev'] = ipmi_cmd.get_bootdev()
ipmi['power'] = ipmi_cmd.get_power()
ipmi['net_configuration'] = ipmi_cmd.get_net_configuration()
fru = fru.FRU(ipmicmd=ipmi_cmd).info
ipmi['fru'] = fru
import pprint
pprint.pprint(ipmi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment