Added "rspconfig ntp" command support - Line #1519

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1020 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sakolish 2008-04-11 14:14:56 +00:00
parent 1e5f60acb4
commit a21e6c902a

View File

@ -415,6 +415,11 @@ sub mpaconfig {
$assignment = 1;
($parameter,$value) = split /=/,$parameter,2;
}
if ($parameter =~ /^ntp$/) {
my $result = ntp($value);
push @cfgtext,@$result;
next;
}
if ($parameter =~ /^build$/) {
my $data = $session->get(['1.3.6.1.4.1.2.3.51.2.2.21.3.1.1.3',1]);
push @cfgtext,"Build ID: $data";
@ -1511,6 +1516,52 @@ sub sshcfg {
return(["SSH $value: OK"]);
}
sub ntp {
my $value = shift;
my @result;
my $data = $session->get(['1.3.6.1.4.1.2.3.51.2.4.9.3.8.1',0]);
if ($data =~ /NOSUCHOBJECT/) {
return(["NTP Not supported"]);
}
if ($value) {
my ($ntp,$ip,$f,$v3) = split /,/,$value;
if ($ntp) {
my $d = ($ntp =~ /^enable$/i) ? 1 : 0;
setoid('1.3.6.1.4.1.2.3.51.2.4.9.3.8.1',0,$d,'INTEGER');
push @result,"NTP: $ntp";
}
if ($ip) {
setoid('1.3.6.1.4.1.2.3.51.2.4.9.3.8.2',0,$ip,'OCTET');
push @result,"NTP Server: $ip";
}
if ($f) {
setoid('1.3.6.1.4.1.2.3.51.2.4.9.3.8.3',0,$f,'INTEGER');
push @result,"NTP Frequency: $f";
}
if ($v3) {
my $d = ($v3 =~ /^enable$/i) ? 1 : 0;
setoid('1.3.6.1.4.1.2.3.51.2.4.9.3.8.7',0,$d,'INTEGER');
push @result,"NTP v3: $v3";
}
return(\@result);
}
my $d = (!$data) ? "disabled" : "enabled";
push @result,"NTP: $d";
$data = $session->get(['1.3.6.1.4.1.2.3.51.2.4.9.3.8.2',0]);
push @result,"NTP Server: $data";
$data = $session->get(['1.3.6.1.4.1.2.3.51.2.4.9.3.8.3',0]);
push @result,"NTP Frequency: $data (minutes)";
$data = $session->get(['1.3.6.1.4.1.2.3.51.2.4.9.3.8.7',0]);
$d = (!$data) ? "disabled" : "enabled";
push @result,"NTP v3: $d";
return(\@result);
}
sub forward_data {
my $callback = shift;
@ -1620,3 +1671,4 @@ sub dompa {