Difference between revisions of "Ipmitool"

From Nuclear Physics Group Documentation Pages
Jump to navigationJump to search
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
ipmitool is a Linux command line utility for controlling [[ipmi]] interfaces.  
+
ipmitool is a Linux command line utility for sending commands to remote [[IPMI]] interfaces.
 +
 
 +
= Installing ipmitool =
 +
 
 +
Currently ipmitool is installed on [[Gourd]], [[Pumpkin]], [[Taro]], and [[benfranklin]].
 +
 
 +
Use this command if you want to install ipmitool on a Redhat or Fedora machine:
 +
 
 +
$ sudo yum install OpenIPMI-tools
  
 
= Using ipmitool =
 
= Using ipmitool =
Line 11: Line 19:
 
== Usage ==  
 
== Usage ==  
  
=== Options ===
+
=== ipmitool Options ===
 +
 
 +
;-a : Prompts for a password.
 +
 
 +
;-H <address> : Address of the remote server. This can be either a hostname or IP address, but because the IPMI cards are on the farm network and don't have hostnames attached to them you will need to use the appropriate IP address.
 +
 
 +
;-U <username> : IPMI username. Currently the ADMIN account is configured and will allow access to all IPMI commands.
 +
 
 +
=== IPMI Commands ===
 +
 
 +
==== Chassis ====
 +
 
 +
;poh : Returns the power-on hours counter.
 +
 
 +
;restart_cause : Queries for the cause of the last system restart.
 +
 
 +
;policy : Sets the system's policy regarding power failures. Options are as follows:
 +
 
 +
::'''''list''''':  Returns a list of supported policies.
 +
 
 +
::'''''always-on''''': Turns system on when power is restored.
 +
 
 +
::'''''previous''''': Returns to the previous state when power is restored.
  
These are the options that will most likely be needed to work with IPMI. Further details are in the manual.
+
::'''''always-off''''': Stays off when power is restored.  
  
;-a : Prompts for the ipmi password.
+
;power : Allows the user to view and change the current power state.
  
;-H <address> : Address of the remote server. This can be either a hostname or IP address, but because the IPMI cards on our network use internal addressing and therefore do not have host names you will need to use the appropriate IP address.
+
::'''''status''''': Returns the current power state.
  
;-U <username> : IPMI username. In most cases it should be ADMIN.
+
::'''''on''''': Power on.
  
=== IPMI Commands ===
+
::'''''off''''': Powers off. '''WARNING''': Does not cleanly shutdown the system.
 +
 
 +
::'''''cycle''''': Cycles the power state off for one second.
  
 +
::'''''reset''''': Performs a hard reset.
  
 +
::'''''soft''''': Soft shutdown of the OS via ACPI
  
  
 
== Sample Commands ==
 
== Sample Commands ==
  
To check the power status of [[Taro]] you would use this command:  
+
The following commands can be used from the command line to control IPMI enabled machines. Make sure to replace <ip address> with the IPMI address of the machine you want to access.
 +
 
 +
To check the power status of an IPMI enabled machine you would use this command, which will prompt for a password:
 +
 
 +
ipmitool -U ADMIN -H <ip address> -a chassis power status
 +
 
 +
To remotely power on an IPMI enabled machine:
 +
 
 +
  ipmitool -U ADMIN -H <ip address> -a chassis power on
 +
 
 +
To remotely perform a hard reset of an IPMI enabled machine:
 +
 
 +
  ipmitool -U ADMIN -H <ip address> -a chassis power reset
 +
 
 +
To query the current Power-On Hours Counter for an IPMI enabled machine:
 +
 
 +
  ipmitool -U ADMIN -H <ip address> -a chassis poh
  
ipmitool -U ADMIN -H 10.0.0.147 -a chassis power status
+
To instruct an IPMI enabled machine to stay off in the event of a power outage:
  
The chassis command also has the ability to change the server's power status.
+
ipmitool -U ADMIN -H <ip addresss> -a chassis policy always-off

Latest revision as of 19:53, 22 June 2010

ipmitool is a Linux command line utility for sending commands to remote IPMI interfaces.

Installing ipmitool

Currently ipmitool is installed on Gourd, Pumpkin, Taro, and benfranklin.

Use this command if you want to install ipmitool on a Redhat or Fedora machine:

$ sudo yum install OpenIPMI-tools

Using ipmitool

The basic syntax for ipmitool is:

ipmitool [option] <command>

For a full list of commands and options see the ipmitool ipmitool Man page.

Usage

ipmitool Options

-a
Prompts for a password.
-H <address>
Address of the remote server. This can be either a hostname or IP address, but because the IPMI cards are on the farm network and don't have hostnames attached to them you will need to use the appropriate IP address.
-U <username>
IPMI username. Currently the ADMIN account is configured and will allow access to all IPMI commands.

IPMI Commands

Chassis

poh
Returns the power-on hours counter.
restart_cause
Queries for the cause of the last system restart.
policy
Sets the system's policy regarding power failures. Options are as follows:
list: Returns a list of supported policies.
always-on: Turns system on when power is restored.
previous: Returns to the previous state when power is restored.
always-off: Stays off when power is restored.
power
Allows the user to view and change the current power state.
status: Returns the current power state.
on: Power on.
off: Powers off. WARNING: Does not cleanly shutdown the system.
cycle: Cycles the power state off for one second.
reset: Performs a hard reset.
soft: Soft shutdown of the OS via ACPI


Sample Commands

The following commands can be used from the command line to control IPMI enabled machines. Make sure to replace <ip address> with the IPMI address of the machine you want to access.

To check the power status of an IPMI enabled machine you would use this command, which will prompt for a password:

ipmitool -U ADMIN -H <ip address> -a chassis power status

To remotely power on an IPMI enabled machine:

 ipmitool -U ADMIN -H <ip address> -a chassis power on

To remotely perform a hard reset of an IPMI enabled machine:

 ipmitool -U ADMIN -H <ip address> -a chassis power reset

To query the current Power-On Hours Counter for an IPMI enabled machine:

 ipmitool -U ADMIN -H <ip address> -a chassis poh

To instruct an IPMI enabled machine to stay off in the event of a power outage:

ipmitool -U ADMIN -H <ip addresss> -a chassis policy always-off