Powerman RPC definition

Powerman specific configuration.

Properties

Powerman definition type

OptionLabel
bundled-fileBundled file
inlineInline definition
  • 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

  • Data type: string
  • Configuration
  • Required

CLI: (cli)> config power rpc custom-definition <key> powerman file

Definition script

The Powerman definition script

  • 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.

OptionLabel
serialConnect via Serial Port
snmpConnect via SNMP
httpConnect via HTTP
  • 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

  • Data type: string
  • Default: custom-rpc
  • Configuration
  • Required

CLI: (cli)> config power rpc custom-definition <key> powerman name