# # $Id: ipmipower.dev 1129 2009-04-24 00:00:11Z garlick $ # # This device configuration supports power control via the # 'ipmipower' utility. # # See powerman-devices(7) for more info on running ipmipower under # powerman. # # some IPMI devices require some time for the firmware to # reload/re-settle itself after a power-off. A delay of 5 seconds # seems to work fine pretty well. # # off,delay,on used in place of IPMI cycle to ensure full command # completion before returning to the user. # specification "ipmipower" { timeout 60 script login { expect "ipmipower> " } script logout { send "quit\n" } script status_all { send "stat\n" foreachnode { expect "([^\n:]+): ([^\n]+)\n" setplugstate $1 $2 on="on" off="off" } expect "ipmipower> " } script status_beacon_all { send "identify-status\n" foreachnode { expect "([^\n:]+): ([^\n]+)\n" setplugstate $1 $2 on="on" off="off" } expect "ipmipower> " } script on_ranged { send "on %s\n" expect "ipmipower> " } script off_ranged { send "off %s\n" expect "ipmipower> " } script cycle_ranged { send "off %s\n" expect "ipmipower> " delay 5 send "on %s\n" expect "ipmipower> " } script beacon_on_ranged { send "identify-on %s\n" expect "ipmipower> " } script beacon_off_ranged { send "identify-off %s\n" expect "ipmipower> " } }