1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#
# $Id$
#
# PowerMan script for controlling another PowerMan daemon, e.g.
#
# device "cartman" "powerman" "cartman.llnl.gov:10101"
# node "b[1-4]" "cartman" "b[1-4]"
#
# N.B. master powerman.conf must contain the union of all slave
# powerman.conf plugs, or status_all script will not work.
#
specification "powerman" {
timeout 100.0
script login {
expect "powerman> "
send "exprange\r\n"
expect "105 Hostrange expansion ON\r\npowerman> "
}
script logout {
send "quit\r\n"
}
script status_all {
send "status\r\n"
foreachplug {
expect "303 ([^:]+): (off|on|unknown)\r\n"
setplugstate $1 $2 off="off" on="on"
}
expect "powerman> "
}
script on_ranged {
send "on %s\r\n"
expect "powerman> "
}
script off_ranged {
send "off %s\r\n"
expect "powerman> "
}
script cycle_ranged {
send "cycle %s\r\n"
expect "powerman> "
}
script reset_ranged {
send "reset %s\r\n"
expect "powerman> "
}
}
|