Powerman RPC definition
Powerman specific configuration.
- Serial communications - Serial line settings used when the RPC is controlled through a serial port.
Properties
Powerman definition type
Choose where the Powerman device definition is loaded from.
Use a bundled file for a known supported RPC model. Use an inline definition when adding a custom Powerman script for a model or protocol that is not bundled.
| Option | Label | Description |
|---|---|---|
bundled-file | Bundled file | Load a Powerman definition supplied with the system. |
inline | Inline definition | Define the Powerman script directly in this configuration. |
- Data type: string select
- Default:
inline - Configuration
- Required
CLI: (cli)> config power rpc custom-definition <key> powerman type
Definition file
The Bundled powerman definition file name for this configuration
Enter the bundled Powerman definition filename that matches the RPC model and firmware you are connecting to.
- Data type: string
- Configuration
- Required
CLI: (cli)> config power rpc custom-definition <key> powerman file
Definition script
The Powerman definition script
The inline script tells Powerman how to log in to the device, discover outlet state, and run on, off, and cycle actions. The generated specification statement is added automatically.
- Data type: string
- Default: `# Custom Powerman RPC definition
This is example uses the snmppower helper, to connect via SNMPv2c
using the "private" community ID
Note that the "specification" statement is automatically generated
timeout 10 # about 5 sec for cycle command
plug name { "1" "2" "3" "4" "5" "6" "7" "8" }
script login {
# commands to log into the device
# Use "send" to send serial or helper text
# Use "expect" to check return text and capture output
expect "snmppower> "
send "start_v2c private\n"
expect "snmppower> "
}
script logout {
# commands to log out of the device
send "finish\n"
expect "snmppower> "
}
script status_all {
# commands to get the state of the outlets
# The example below gets a particular SNMP oid, uses expect to capture the outlet values
# And uses "setplugstate" to update powermans outlet state
send "get enterprises.4779.1.3.5.5.1.13.2.1\n"
expect "enterprises.4779.1.3.5.5.1.13.2.1: (0|1),(0|1),(0|1),(0|1),(0|1),(0|1),(0|1),(0|1)\n"
setplugstate "1" $1 off="0" on="1"
setplugstate "2" $2 off="0" on="1"
setplugstate "3" $3 off="0" on="1"
setplugstate "4" $4 off="0" on="1"
setplugstate "5" $5 off="0" on="1"
setplugstate "6" $6 off="0" on="1"
setplugstate "7" $7 off="0" on="1"
setplugstate "8" $8 off="0" on="1"
expect "snmppower> "
}
script on {
# commands to switch on an outlet. %s is the outlet name
send "set enterprises.4779.1.3.5.3.1.3.1.%s i 1\n"
expect "enterprises.4779.1.3.5.3.1.3.1.[1-8]: 1\n"
expect "snmppower> "
}
script off {
# commands to switch off an outlet. %s is the outlet name
send "set enterprises.4779.1.3.5.3.1.3.1.%s i 0\n"
expect "enterprises.4779.1.3.5.3.1.3.1.[1-8]: 0\n"
expect "snmppower> "
}
script cycle {
# Commands to cycle an outlet
send "set enterprises.4779.1.3.5.3.1.3.1.%s i 0\n"
expect "enterprises.4779.1.3.5.3.1.3.1.[1-8]: 0\n"
expect "snmppower> "
delay 5
send "set enterprises.4779.1.3.5.3.1.3.1.%s i 1\n"
expect "enterprises.4779.1.3.5.3.1.3.1.[1-8]: 1\n"
expect "snmppower> "
}`
- Configuration
- Required
CLI: (cli)> config power rpc custom-definition <key> powerman inline
Powerman interface
The interface Powerman uses to connect to the RPC.
Select the transport used by the Powerman helper or script. Serial requires an RPC-mode serial port; SNMP and HTTP require the network address of the power controller.
| Option | Label | Description |
|---|---|---|
serial | Connect via Serial Port | Control the RPC through a local serial connection. |
snmp | Connect via SNMP | Control the RPC using SNMP over the network. |
http | Connect via HTTP | Control the RPC using HTTP over the network. |
- Data type: string select
- Default:
snmp - Configuration
- Required
CLI: (cli)> config power rpc custom-definition <key> powerman interface
Definition name
The Powerman definition name used in the definition file
For inline definitions this name becomes the Powerman device specification name. Keep it stable so existing RPC connections continue to reference the same definition.
- Data type: string
- Default:
custom-rpc - Configuration
- Required
CLI: (cli)> config power rpc custom-definition <key> powerman name
