
Chapter 15: Advanced Configuration
724-746-5500 | blackbox.com
157
status
This
action
retrieves the current status of the device or outlet
Examples:
To turn outlet 4 of the power device connected to serial port 2 on:
# pmpower -l port02 -o 4 on
To turn an IPMI device off located at IP address 192.168.1.100 (where username is 'root' and password is 'calvin':
# pmpower -r 192.168.1.100 -u
root -p calvin off
Default system Power Device actions are specified in
/etc/powerstrips.xml
. Custom Power Devices can be added in
/etc/config/powerstrips.xml
. If an
action is attempted that has not been configured for a specific Power Device,
pmpower
will exit with an error.
There are a number of simple paths to adding support for new RPC devices.
The first is to have scripts to support the particular RPC included in either the open source
PowerMan
project
(
the open source
NUT UPS Tools
project. The
PowerMan
device specifications are rather
weird and it is suggested that you leave the actual writing of these scripts to the PowerMan authors. Documentation on how they work can be
found at
. The
Network UPS Tools (NUT)
project has recently moved on from its UPS management
origins to also cover SNMP PDUs (and embrace PowerMan). Black Box progressively includes the updated
PowerMan
and
NUT
build into the
console server
firmware releases.
The second path is to directly add support for the new RPC devices (or to customize the existing RPC device support) on your particular
console
server
. The
Manage: Power
page uses information contained in
/etc/powerstrips.xml
to configure and control devices attached to a serial port. The
configuration also looks for (and loads)
/etc/config/powerstrips.xml
if it exists.
The user can add his own support for more devices by putting definitions for them into
/etc/config/powerstrips.xml
. This file can be created on a
host system and copied to the Management Console device using
scp
. Alternatively, login to the Management Console and use
ftp
or
wget
to
transfer files.
Here is a brief description of the elements of the XML entries in
/etc/config/powerstrips.xml
.
<powerstrip>
<id>Name or ID of the device support</id>
<outlet port="port-id-1">Display Port 1 in menu</outlet>
<outlet port="port-id-2">Display Port 2 in menu</outlet>
...
<on>script
to
turn
power
on</on>
<off>script to power off</off>
<cycle>script
to
cycle
power</cycle>
<status>script to write power status to /var/run/power-status</status>
<speed>baud
rate</speed>
<charsize>character
size</charsize>
<stop>stop
bits</stop>
<parity>parity
setting</parity>
</powerstrip>
The
id
appears on the web page in the list of available device types to configure.
The outlets describe targets that the scripts can control. For example, a power control board may control several different outlets. The port-id is the
native name for identifying the outlet. This value will be passed to the scripts in the environment variable
outlet
, allowing the script to address the
correct outlet.
There are four possible scripts:
on, off, cycle
, and
status
.
When a script is run, its standard input and output is redirected to the appropriate serial port. The script receives the outlet and port in the
outlet
and
port
environment variables respectively.
The script can be anything that can be executed within the shell.
All of the existing scripts in
/etc/powerstrips.xml
use the
pmchat
utility.
pmchat
works just like the standard unix "chat" program, only it ensures interoperation with the port manager.
The final options,
speed, charsize, stop,
and
parity
define the recommended or default settings for the attached device.