#
# Originally ibmbladecenter.dev.  RJG, 11/17/04
#
# Ref: Command-Line Interface Reference Guide for
#  IBM BladeCenter Management Module, BladeCenter T Management Module,
#  Advanced Management Module, BladeCenter T Advanced Management Module.
#
specification "ibmbladecenter" {
	timeout  	15
	plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" 
                    "10" "11" "12" "13" "14" "15" }

	script login {
		expect "username: "
		send "USERID\r\n"
		expect "password: "
		send "PASSW0RD\r\n"
		expect "system> "
		send "telnetcfg -t 0 -T mm[1]\r\n"
		expect "OK\r\nsystem> "
	}
	script logout {
		send "exit\r\n"
	}
	script status {
		send "power -state -T blade\[%s\]\r\n"
		expect "(On|Off)\r\nsystem> "	
		setplugstate $1 on="On" off="Off"
	}
	script on {
		send "power -on -T blade\[%s\]\r\n"
		delay 1 # settling time
		expect "OK\r\nsystem> "
	}
	script off {
		send "power -off -T blade\[%s\]\r\n"
		delay 5 # settling time
		expect "OK\r\nsystem> "
	}
	script cycle {
		send "power -off -T blade\[%s\]\r\n"
		expect "OK\r\nsystem> "
		delay 5 # settling time
		delay 4
		send "power -on -T blade\[%s\]\r\n"
		expect "OK\r\nsystem> "
	}
}
