setting access type for snmp community in blade.pm

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@934 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2008-03-28 18:23:19 +00:00
parent 071172a47a
commit d68304896c
2 changed files with 6 additions and 5 deletions

View File

@ -425,6 +425,7 @@ sub mpaconfig {
my $dstindex = $1;
if ($assignment) {
setoid("1.3.6.1.4.1.2.3.51.2.4.9.3.1.4.1.1.".(2+$dstindex).".1",1,$value,'OCTET');
setoid("1.3.6.1.4.1.2.3.51.2.4.9.3.1.4.1.1.6.1",1,2,'INTEGER'); #access type: read-write-traps
}
my $data = $session->get(["1.3.6.1.4.1.2.3.51.2.4.9.3.1.4.1.1.".(2+$dstindex).".1.1"]);
push @cfgtext,"SP SNMP Destination $1: $data";
@ -440,13 +441,13 @@ sub mpaconfig {
}
if ($parameter =~ /^alert/i) {
if ($assignment) {
if ($value =~ /^enable/i or $value =~ /^on$/i) {
if ($value =~ /^enable/i or $value =~ /^en/i or $value =~ /^on$/i) {
setoid('1.3.6.1.4.1.2.3.51.2.4.1.3.1.1.4',12,'xCAT configured SNMP','OCTET'); #Set a description so the MM doesn't flip out
setoid('1.3.6.1.4.1.2.3.51.2.4.1.3.1.1.5',12,4); #Set Dest12 to SNMP
setoid('1.3.6.1.4.1.2.3.51.2.4.1.3.1.1.2',12,2); #enable dest12
setoid('1.3.6.1.4.1.2.3.51.2.4.9.3.1.3',0,0); #Enable SNMP traps
enabledefaultalerts();
} elsif ($value =~ /^disable/i or $value =~ /^off$/i) {
} elsif ($value =~ /^disable/i or $value =~ /^dis/i or $value =~ /^off$/i) {
setoid('1.3.6.1.4.1.2.3.51.2.4.1.3.1.1.2',12,0); #Disable alert dest 12
setoid('1.3.6.1.4.1.2.3.51.2.4.9.3.1.3',0,1); #Disable SNMP traps period
}
@ -1339,7 +1340,7 @@ sub dompa {
Retries => 2, # Give up sooner to make commands go smoother
Timeout=>1300000, #Beacon, for one, takes a bit over a second to return
PrivPass => $mpahash->{$mpa}->{password});
if ($session->{ErrorStr}) { return 1,$session->{ErrorStr}; }
if ($session->{ErrorStr}) {return 1,$session->{ErrorStr}; }
unless ($session and keys %$session) {
my %err=(node=>[]);
foreach (keys %{$mpahash{$mpa}->{nodes}}) {

View File

@ -811,10 +811,10 @@ sub setnetinfo {
unless(defined($argument)) {
return 0;
}
if ($subcommand eq "alert" and $argument eq "on" or $argument =~ /^en/) {
if ($subcommand eq "alert" and $argument eq "on" or $argument =~ /^en/ or $argument =~ /^enable/) {
$netfun = 0x10;
@cmd = (0x12,0x9,0x1,0x18,0x11,0x00);
} elsif ($subcommand eq "alert" and $argument eq "off" or $argument =~ /^dis/) {
} elsif ($subcommand eq "alert" and $argument eq "off" or $argument =~ /^dis/ or $argument =~ /^disable/) {
$netfun = 0x10;
@cmd = (0x12,0x9,0x1,0x10,0x11,0x00);
}