From a21e6c902ae145bbc66416a0d00f8461d1851ea3 Mon Sep 17 00:00:00 2001 From: sakolish Date: Fri, 11 Apr 2008 14:14:56 +0000 Subject: [PATCH] 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 --- xCAT-server-2.0/lib/xcat/plugins/blade.pm | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/xCAT-server-2.0/lib/xcat/plugins/blade.pm b/xCAT-server-2.0/lib/xcat/plugins/blade.pm index 93c382d4a..80f2fff71 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/blade.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/blade.pm @@ -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 { +