Commit 07aa90ae authored by mac's avatar mac
Browse files

power: Turned on taint checking, made interaction with snmpit more robust.

-First part of a major reorganization/rewrite.
-Added checks for node ownership before changing port values and adding or
  removing VLANs.
-Translation tables (mac<->tbxxMM:N,tbxxMM:N<->switch:port,port<->ifIndex) are
  now global and get initialized whenever necessary.
-Made port config changes work for ciscos. (speed and duplex)
-Added ability to specify ports as tbxxMM:N for cisco port config changes.
-Some general cleanup/reorg/rewrite of old ugly code.
parent f82374a8
#!/usr/local/bin/perl -w
#!/usr/local/bin/perl -wT
# Testbed Power Control script
......@@ -38,6 +38,9 @@ die("Syntax:\npower on <machine> <machine> ...\n",
#Read in ARGV
$op = shift (@ARGV);
if ($op =~ /^(on|off|cycle)$/) {
$op = $1;
} else { die("Invalid command '$op'\n"); }
if ($op eq "cycle") { $op = "cyc"; }
$op = '-'.$op;
@machines = @ARGV;
......@@ -115,10 +118,10 @@ foreach $node ( sort @machines) {
open(OUT,$cmd." |");
while (<OUT>) {
if (/was outlet(.*)/) {
if (/was outlet(O[nf]*)/) {
print "$node was $1";
if (/to outlet(.*)/) {
if (/to outlet(O[nf]*)/) {
print " ... $node now $1";
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment