Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > db8d50b45fb15e865b7becf99650beea > files > 52

powerman-2.3.25-1.mga7.armv7hl.rpm

#
# Control POE on Cisco switches via rancid (http://www.shrubbery.net/rancid/)
#
#   device "cisco-switch" "rancid-cisco-poe" "/usr/lib/rancid/bin/clogin hostname |&"
#
# Plug names are the device interface name:
#   node "mydevice"		"cisco-switch" "Gi2/0/1"
#
# The user running the powerman must have a .cloginrc file in its home directory
# with an appropriate configuration to allow querying and setting PoE status
#
specification "rancid-cisco-poe" {
	timeout 	10

	script login {
		expect ".*#"
	}
	script logout {
		send "exit\n"
	}
	script status {
		send "show power inline %s | section (on|off) \n"
		expect "\r\n([^ ]+) +[^ ]+ +(on|off)"
		setplugstate $1 $2 off="off" on="on"
		expect ".*#"
	}
	script on {
		send "conf t\n"
		expect ".*\\(config\\)#"
		send "int %s\n"
		expect ".*\\(config-if\\)#"
		send "no power inline never\n"
		expect ".*\\(config-if\\)#"
		send "end\n"
		expect ".*#"
	}
	script off {
		send "conf t\n"
		expect ".*\\(config\\)#"
		send "int %s\n"
		expect ".*\\(config-if\\)#"
		send "power inline never\n"
		expect ".*\\(config-if\\)#"
		send "end\n"
		expect ".*#"
	}
	script cycle {
		send "conf t\n"
		expect ".*\\(config\\)#"
		send "int %s\n"
		expect ".*\\(config-if\\)#"
		send "power inline never\n"
		expect ".*\\(config-if\\)#"
		delay 4
		send "no power inline never\n"
		expect ".*\\(config-if\\)#"
		send "end\n"
		expect ".*#"
		send "off %s\n"
		expect ".*#"
	}
}