diff --git a/tbsetup/snmpit.in b/tbsetup/snmpit.in index 1fc0d85e5626b09e45b2f3a637960c6ae1c529d6..c3e3d55bf8e45c2ee468c2e04300f6d648da98c1 100755 --- a/tbsetup/snmpit.in +++ b/tbsetup/snmpit.in @@ -123,6 +123,8 @@ Port Control: -U Turn off trunking for the given -b Print out port status for a set of ports -B Pass in a stat string from -b to restore status + -D Disable all control net ports for an experiment + -R (Re)enable all control net ports for an experiment More than one operation can be specified - However, beware that the order in which operations will occur is undefined, and some combinations of operations @@ -137,7 +139,7 @@ my %opt = (); Getopt::Long::Configure("no_ignore_case"); GetOptions(\%opt, 'a','c','d','e','b','B=s@','g','h','i=s@','l','m=s@','M','n', 'N=s@','o=s@','p=s','q','r','s', 'S=s@','t','E=s','T=s','u=s','U','v=s','w', - 'y=s','x=s','z=s','F','L=s','O'); + 'y=s','x=s','z=s','F','L=s','O', 'D', 'R'); # Unused: f,j if ($opt{h}) { @@ -179,7 +181,7 @@ if ($UID) { # Some operations have mandatory agruments - for others, make sure that # the user didn't give any extraneous arguments # -if ($opt{t} || $opt{r}) { +if ($opt{t} || $opt{r} || $opt{D} || $opt{R}) { # # Options that take 'pid eid' # @@ -253,6 +255,8 @@ if ($opt{F}) { push @commands, ["synchleader"]; } if ($opt{d}) { push @commands, ["portcontrol","disable"]; } if ($opt{e}) { push @commands, ["portcontrol","enable"]; } if ($opt{a}) { push @commands, ["portcontrol","auto"]; } +if ($opt{D}) { push @commands, ["expcnetcontrol", "disable"]; } +if ($opt{R}) { push @commands, ["expcnetcontrol", "enable"]; } if ($opt{T}) { push @commands, ["trunkenable", $opt{T}]; } # @@ -533,6 +537,10 @@ COMMAND: foreach my $command (@commands) { @supplied_switches : getDeviceNames(@ports); last; }; + (/expcnetcontrol/) && do { + @ports = getExperimentControlPorts($pid, $eid); + @devicenames = getDeviceNames(@ports); + }; (/recreate/) && do { # # Safety check - cannot be used with -i . We have to operate on @@ -724,6 +732,11 @@ COMMAND: foreach my $command (@commands) { $exitval += doPortControl(\@stacks,$portcommand,@ports); last; }; + /expcnetcontrol/ && do { + my ($portcommand) = @args; + $exitval += doPortControl(\@stacks,$portcommand,@ports); + last; + }; /recreate/ && do { $exitval += doRecreateVlans(\@stacks); last; diff --git a/tbsetup/snmpit_lib.pm b/tbsetup/snmpit_lib.pm index c8c8d824c77b843d3f978fcaa4e7f104fa22ad80..94a32cb63c72c582eca56991385df5e954b4fe30 100644 --- a/tbsetup/snmpit_lib.pm +++ b/tbsetup/snmpit_lib.pm @@ -303,6 +303,8 @@ sub getExperimentControlPorts ($$) { # my $exp = Experiment->Lookup($pid,$eid); my @nodes = $exp->NodeList(0,0); + # plab and related nodes are still in the list, so filter them out + @nodes = grep {$_->control_iface()} @nodes; # # Get control net interfaces