import ssh.pxssh as pxssh
import ssh.pexpect as pexpect
import socket
+import moncommands
# Use our versions of telnetlib and pyssh
sys.path.insert(0, os.path.dirname(sys.argv[0]))
class IntelAMT(PCUControl):
def run(self, node_port, dryrun):
- import soltesz
- cmd = soltesz.CMD()
- cmd_str = "IntelAMTSDK/Samples/RemoteControl/remoteControl"
+ cmd = moncommands.CMD()
+ #[cmd_str = "IntelAMTSDK/Samples/RemoteControl/remoteControl"
+ cmd_str = "cmdamt/remoteControl"
if dryrun:
# NOTE: -p checks the power state of the host.
class HPiLOHttps(PCUControl):
def run(self, node_port, dryrun):
- import soltesz
- locfg = soltesz.CMD()
+ locfg = moncommands.CMD()
cmd = "cmdhttps/locfg.pl -s %s -f %s -u %s -p '%s' | grep 'MESSAGE' | grep -v 'No error'" % (
self.host, "iloxml/Get_Network.xml",
self.username, self.password)
return sout.strip()
if not dryrun:
- locfg = soltesz.CMD()
+ locfg = moncommands.CMD()
cmd = "cmdhttps/locfg.pl -s %s -f %s -u %s -p '%s' | grep 'MESSAGE' | grep -v 'No error'" % (
self.host, "iloxml/Reset_Server.xml",
self.username, self.password)
self.close()
return 0
+class CustomPCU(PCUControl):
+ def run(self, node_port, dryrun):
+ url = "https://www-itec.uni-klu.ac.at/plab-pcu/index.php"
+
+ if not dryrun:
+ # Turn host off, then on
+ formstr = "plab%s=off" % node_port
+ os.system("curl --user %s:%s --form '%s' --insecure %s" % (self.username, self.password, formstr, url))
+ time.sleep(5)
+ formstr = "plab%s=on" % node_port
+ os.system("curl --user %s:%s --form '%s' --insecure %s" % (self.username, self.password, formstr, url))
+ else:
+ os.system("curl --user %s:%s --insecure %s" % (self.username, self.password, url))
+
class ePowerSwitchOld(PCUControl):
def run(self, node_port, dryrun):
else:
return None
-import soltesz
-fb =soltesz.dbLoad("findbadpcus")
+import database
+fb =database.dbLoad("findbadpcus")
def get_pcu_values(pcu_id):
# TODO: obviously, this shouldn't be loaded each time...
eps = ePowerSwitchGood(values, verbose, ['80'])
rb_ret = eps.reboot(values[nodename], dryrun)
+ elif continue_probe and values['pcu_id'] in [1122]:
+ custom = CustomPCU(values, verbose, ['80', '443'])
+ custom.reboot(values[nodename], dryrun)
elif continue_probe:
rb_ret = "Unsupported_PCU"