From 02c82d4a0411a7344a086114b4adeb4660ca8c39 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Mon, 7 Aug 2017 21:00:50 -0400 Subject: [PATCH 1/5] Support rspconfig command to change PDU's ip address, netmask and hostname --- xCAT-server/lib/xcat/plugins/pdu.pm | 97 ++++++++++++++++++- .../lib/xcat/plugins/switchdiscover.pm | 36 ++++++- 2 files changed, 129 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index c4e71ef96..2372152f5 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -177,6 +177,8 @@ sub process_request my $subcmd = $exargs[0]; if ($subcmd eq 'sshcfg') { process_sshcfg($noderange, $subcmd, $callback); + }elsif ($subcmd =~ /=/) { + process_netcfg($request, $subreq, $subcmd, $callback); } else { $callback->({ errorcode => [1],error => "The input $command $subcmd is not support for pdu"}); } @@ -467,6 +469,87 @@ sub connectTopdu { } +#------------------------------------------------------- + +=head3 process_netcfg + + Config hostname of PDU + Config ip/netmask of PDU via PduManager command + PduManager is a tool for CoralPdu to manager the PDU. + * /dev/shm/bin/PduManager -h + '-i' set PDU system IP + '-n' set system ip netmask. e.g.:PduManager -i xxx.xxx.xxx.xxx -n xxx.xxx.xxx.xxx + + example: rspconfig coralpdu hostname=coralpdu + rspconfig coralpdu ip=1.1.1.1,netmask=255.0.0.0 + +=cut + +#------------------------------------------------------- +sub process_netcfg { + my $request = shift; + my $subreq = shift; + my $subcmd = shift; + my $callback = shift; + my $hostname; + my $ip; + my $netmask; + my $args; + + my $nodes = $request->{node}; + my $rsp = {}; + + xCAT::MsgUtils->message("I", "set hostname "); + my @cmds = split(/,/,$subcmd); + foreach my $cmd (@cmds) { + my ($key, $value) = split(/=/, $cmd); + if ($key =~ /hostname/) { + $hostname = $value; + $args = "echo $hostname > /etc/hostname;/etc/init.d/hostname.sh"; + xCAT::Utils->runxcmd({ command => ['xdsh'], + node => $nodes, + arg => [ $args ] }, $subreq, 0, 1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->message("I", "xdsh command to set hostname failed"); + } + }elsif ($key =~ /ip/) { + $ip = $value; + } elsif ($key =~ /netmask/) { + $netmask = $value; + } else { + xCAT::MsgUtils->message("I", "rspconfig $cmd is not support yet"); + } + } + + $args = "/dev/shm/bin/PduManager "; + my $opt; + if ($ip) { + $opt = "-i $ip "; + } + if ($netmask) { + $opt = $opt . "-n $netmask"; + } + if ($opt) { + my $dshcmd = $args . $opt ; + #comment this for now, coralPDU on the lab is not support PduManager yet + my $output = xCAT::Utils->runxcmd({ command => ['xdsh'], node => $nodes, arg => [ $dshcmd ] }, $subreq, 0, 1); + if ($::RUNCMD_RC != 0) { + xCAT::SvrUtils::sendmsg("@$output", $callback); + } + } +} + +#------------------------------------------------------- + +=head3 process_sshcfg + + Config passwordless for coralpdu + + example: rspconfig coralpdu sshcfg + +=cut + +#------------------------------------------------------- sub process_sshcfg { my $noderange = shift; my $subcmd = shift; @@ -585,6 +668,18 @@ sub session_exec { return($mbmatch); } +#----------------------------------------------------------------- + +=head3 process_pdudiscover + + Discover the pdu for a given range of DHCP ip address + it will call switchdiscover command with -s snmp --pdu options + + example: pdudiscover --range iprange -w + +=cut + +#------------------------------------------------------------------ sub process_pdudiscover { my $request = shift; my $sub_req = shift; @@ -615,8 +710,6 @@ sub process_pdudiscover { my $rsp = {}; push @{ $rsp->{data} }, "$result"; xCAT::MsgUtils->message("I", $rsp, $callback); - - } diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index f39141092..a22b9d1a8 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -1404,15 +1404,18 @@ sub matchPredefineSwitch { } my $stype = get_switchtype($vendor); + if (exists($globalopt{pdu})) { + $stype="pdu"; + } send_msg($request, 0, "$device discovered and matched: $dswitch to $node" ); # only write to xcatdb if -w or --setup option specified if ( (exists($globalopt{w})) || (exists($globalopt{setup})) ) { if (exists($globalopt{pdu})) { - xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1); + xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","usercomment=$vendor"] }, $sub_req, 0, 1); } else { - xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","switchtype=$stype","usercomment=$vendor","switchtype=$stype"] }, $sub_req, 0, 1); + xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1); } } @@ -1436,6 +1439,35 @@ sub switchsetup { my $request = shift; my $sub_req = shift; if (exists($globalopt{pdu})) { + my $mytype = "pdu"; + my $nodetab = xCAT::Table->new('hosts'); + my $nodehash = $nodetab->getNodesAttribs(\@{${nodes_to_config}->{$mytype}},['ip','otherinterfaces']); + # get netmask from network table + my $nettab = xCAT::Table->new("networks"); + my @nets; + if ($nettab) { + @nets = $nettab->getAllAttribs('net','mask'); + } + + foreach my $pdu(@{${nodes_to_config}->{$mytype}}) { + my $cmd = "rspconfig $pdu sshcfg"; + xCAT::Utils->runcmd($cmd, 0); + my $ip = $nodehash->{$pdu}->[0]->{otherinterfaces}; + my $mask; + foreach my $net (@nets) { + if (xCAT::NetworkUtils::isInSameSubnet( $net->{'net'}, $ip, $net->{'mask'}, 0)) { + $mask=$net->{'mask'}; + } + } + $cmd = "rspconfig $pdu hostname=$pdu,ip=$otherinterfaces,netmask=$mask"; + xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC == 0) { + xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$pdu,"ip=$ip","otherinterfaces="] }, $sub_req, 0, 1); + } else { + send_msg($request, 0, "Failed to run rspconfig command to set ip/netmask\n"); + } + + } return; } From 9f2f40609a9da964bd04d92e6d01d96d768f6359 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 18 Aug 2017 09:49:36 -0400 Subject: [PATCH 2/5] change network command from "," to space --- xCAT-server/lib/xcat/plugins/pdu.pm | 19 ++++++++++++------- .../lib/xcat/plugins/switchdiscover.pm | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 2372152f5..5441b87e0 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -177,7 +177,7 @@ sub process_request my $subcmd = $exargs[0]; if ($subcmd eq 'sshcfg') { process_sshcfg($noderange, $subcmd, $callback); - }elsif ($subcmd =~ /=/) { + }elsif ($subcmd =~ /ip|netmask|hostname/) { process_netcfg($request, $subreq, $subcmd, $callback); } else { $callback->({ errorcode => [1],error => "The input $command $subcmd is not support for pdu"}); @@ -481,7 +481,7 @@ sub connectTopdu { '-n' set system ip netmask. e.g.:PduManager -i xxx.xxx.xxx.xxx -n xxx.xxx.xxx.xxx example: rspconfig coralpdu hostname=coralpdu - rspconfig coralpdu ip=1.1.1.1,netmask=255.0.0.0 + rspconfig coralpdu ip=1.1.1.1 netmask=255.0.0.0 =cut @@ -496,12 +496,16 @@ sub process_netcfg { my $netmask; my $args; + my $extrargs = $request->{arg}; + my @exargs = ($request->{arg}); + if (ref($extrargs)) { + @exargs = @$extrargs; + } + my $nodes = $request->{node}; my $rsp = {}; - xCAT::MsgUtils->message("I", "set hostname "); - my @cmds = split(/,/,$subcmd); - foreach my $cmd (@cmds) { + foreach my $cmd (@exargs) { my ($key, $value) = split(/=/, $cmd); if ($key =~ /hostname/) { $hostname = $value; @@ -510,14 +514,14 @@ sub process_netcfg { node => $nodes, arg => [ $args ] }, $subreq, 0, 1); if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("I", "xdsh command to set hostname failed"); + xCAT::SvrUtils::sendmsg("xdsh command to set hostname failed", $callback); } }elsif ($key =~ /ip/) { $ip = $value; } elsif ($key =~ /netmask/) { $netmask = $value; } else { - xCAT::MsgUtils->message("I", "rspconfig $cmd is not support yet"); + xCAT::SvrUtils::sendmsg("rspconfig $cmd is not support yet, ignored", $callback); } } @@ -531,6 +535,7 @@ sub process_netcfg { } if ($opt) { my $dshcmd = $args . $opt ; + xCAT::SvrUtils::sendmsg($dshcmd, $callback); #comment this for now, coralPDU on the lab is not support PduManager yet my $output = xCAT::Utils->runxcmd({ command => ['xdsh'], node => $nodes, arg => [ $dshcmd ] }, $subreq, 0, 1); if ($::RUNCMD_RC != 0) { diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index a22b9d1a8..d590d62ce 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -407,7 +407,7 @@ sub process_request { } if (!($result)) { - send_msg( \%request, 0, " No switch found "); + send_msg( \%request, 0, " No $device found "); return; } From 1ab961f083b3ad84b025f557d42c371d96658be5 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Mon, 28 Aug 2017 08:46:09 -0400 Subject: [PATCH 3/5] change rspconfig call in the switchdiscover.pm file --- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index d590d62ce..2bad5ccc8 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -1459,7 +1459,7 @@ sub switchsetup { $mask=$net->{'mask'}; } } - $cmd = "rspconfig $pdu hostname=$pdu,ip=$otherinterfaces,netmask=$mask"; + $cmd = "rspconfig $pdu hostname=$pdu ip=$otherinterfaces netmask=$mask"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC == 0) { xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$pdu,"ip=$ip","otherinterfaces="] }, $sub_req, 0, 1); From 555eef779406bf05e7fc9c99c7e7a4493f47aaf0 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 14 Sep 2017 09:50:44 -0400 Subject: [PATCH 4/5] modify netcfg and add rinv and rvitals command --- perl-xCAT/xCAT/Usage.pm | 4 +- xCAT-server/lib/xcat/plugins/pdu.pm | 171 ++++++++++++++---- .../lib/xcat/plugins/switchdiscover.pm | 4 +- 3 files changed, 140 insertions(+), 39 deletions(-) diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 871d3802b..77e0162b7 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -85,7 +85,9 @@ my %usage = ( OpenPOWER (OpenBMC) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all] MIC specific: - rvitals noderange {thermal|all}", + rvitals noderange {thermal|all}" + pdu specific: + rvitals noderange ", "reventlog" => "Usage: reventlog [all [-s]|clear| [-s]] [-V|--verbose] reventlog [-h|--help|-v|--version]", diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 5441b87e0..8fab55a0d 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -7,6 +7,7 @@ Supported command: rpower rinv + rvitals =cut @@ -63,6 +64,7 @@ sub handled_commands return { rpower => ["nodehm:mgt","pduoutlet:pdu=\.\*"], rinv => ["nodehm:mgt"], + rvitals => ["nodehm:mgt"], nodeset => ["nodehm:mgt"], rspconfig => ["nodehm:mgt"], pdudiscover => "pdu", @@ -138,11 +140,13 @@ sub process_request #fill in the total outlet count for each pdu $pdutab = xCAT::Table->new('pdu'); @pduents = $pdutab->getAllNodeAttribs(['node', 'outlet']); - fill_outletCount(\@pduents, $callback); + #fill_outletCount(\@pduents, $callback); if( $command eq "rinv") { #for higher performance, handle node in batch - return powerstat($noderange, $callback); + return showMFR($noderange, $callback); + }elsif ($command eq "rvitals") { + return showMonitorData($noderange, $callback); }elsif ($command eq "rpower") { my $subcmd = $exargs[0]; if (($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')|| ($subcmd eq 'pdureset') ){ @@ -178,6 +182,7 @@ sub process_request if ($subcmd eq 'sshcfg') { process_sshcfg($noderange, $subcmd, $callback); }elsif ($subcmd =~ /ip|netmask|hostname/) { + print "prcess_netcfg\n"; process_netcfg($request, $subreq, $subcmd, $callback); } else { $callback->({ errorcode => [1],error => "The input $command $subcmd is not support for pdu"}); @@ -495,6 +500,8 @@ sub process_netcfg { my $ip; my $netmask; my $args; + my $ret; + my $err; my $extrargs = $request->{arg}; my @exargs = ($request->{arg}); @@ -503,18 +510,24 @@ sub process_netcfg { } my $nodes = $request->{node}; + my $pdu = @$nodes; my $rsp = {}; + my $nodetab = xCAT::Table->new('hosts'); + my $nodehash = $nodetab->getNodesAttribs($nodes,['ip','otherinterfaces']); + + # connect to PDU + my $static_ip = $nodehash->{$pdu}->[0]->{ip}; + my $discover_ip = $nodehash->{$pdu}->[0]->{otherinterfaces}; + my ($exp, $errstr) = session_connect($static_ip, $discover_ip); + foreach my $cmd (@exargs) { my ($key, $value) = split(/=/, $cmd); if ($key =~ /hostname/) { $hostname = $value; - $args = "echo $hostname > /etc/hostname;/etc/init.d/hostname.sh"; - xCAT::Utils->runxcmd({ command => ['xdsh'], - node => $nodes, - arg => [ $args ] }, $subreq, 0, 1); - if ($::RUNCMD_RC != 0) { - xCAT::SvrUtils::sendmsg("xdsh command to set hostname failed", $callback); + ($ret, $err) = session_exec($exp, "echo $hostname > /etc/hostname;/etc/init.d/hostname.sh"); + if (defined $err) { + xCAT::SvrUtils::sendmsg("Failed to set hostname", $callback); } }elsif ($key =~ /ip/) { $ip = $value; @@ -537,11 +550,12 @@ sub process_netcfg { my $dshcmd = $args . $opt ; xCAT::SvrUtils::sendmsg($dshcmd, $callback); #comment this for now, coralPDU on the lab is not support PduManager yet - my $output = xCAT::Utils->runxcmd({ command => ['xdsh'], node => $nodes, arg => [ $dshcmd ] }, $subreq, 0, 1); - if ($::RUNCMD_RC != 0) { - xCAT::SvrUtils::sendmsg("@$output", $callback); + ($ret, $err) = session_exec($exp, $dshcmd); + if (defined $err) { + xCAT::SvrUtils::sendmsg("Failed to run $dshcmd", $callback); } } + $exp->hard_close(); } #------------------------------------------------------- @@ -560,6 +574,7 @@ sub process_sshcfg { my $subcmd = shift; my $callback = shift; + #this is default password for CoralPDU my $password = "password8"; my $userid = "root"; my $timeout = 10; @@ -580,20 +595,7 @@ sub process_sshcfg { my $static_ip = $nodehash->{$pdu}->[0]->{ip}; my $discover_ip = $nodehash->{$pdu}->[0]->{otherinterfaces}; - my $ssh_ip; - - my $p = Net::Ping->new(); - if ($p->ping($static_ip)) { - $ssh_ip = $static_ip; - } elsif ($p->ping($discover_ip)) { - $ssh_ip = $discover_ip; - } else { - $msg = " is not reachable"; - xCAT::SvrUtils::sendmsg($msg, $callback, $pdu, %allerrornodes); - next; - } - - my ($exp, $errstr) = session_connect($ssh_ip, $userid, $password, $timeout); + my ($exp, $errstr) = session_connect($static_ip, $discover_ip); if (!defined $exp) { $msg = " Failed to connect $errstr"; xCAT::SvrUtils::sendmsg($msg, $callback, $pdu, %allerrornodes); @@ -607,10 +609,6 @@ sub process_sshcfg { ($ret, $err) = session_exec($exp, "chmod 700 /home/root/.ssh"); ($ret, $err) = session_exec($exp, "echo \"$rootkey\" >/home/root/.ssh/authorized_keys"); ($ret, $err) = session_exec($exp, "chmod 644 /home/root/.ssh/authorized_keys"); - #config dhcp ip address to static - if ($ssh_ip eq $discover_ip) { - # ($ret, $err) = session_exec($exp, "ifconfig eth0 $static_ip"); - } $exp->hard_close(); } @@ -619,14 +617,27 @@ sub process_sshcfg { } sub session_connect { - my $server = shift; - my $userid = shift; - my $password = shift; - my $timeout = shift; + my $static_ip = shift; + my $discover_ip = shift; - my $ssh = Expect->new; - my $command = 'ssh'; - my @parameters = ($userid . "@" . $server); + #default password for coral pdu + my $password = "password8"; + my $userid = "root"; + my $timeout = 10; + + my $ssh_ip; + my $p = Net::Ping->new(); + if ($p->ping($static_ip)) { + $ssh_ip = $static_ip; + } elsif ($p->ping($discover_ip)) { + $ssh_ip = $discover_ip; + } else { + return(undef, " is not reachable\n"); + } + + my $ssh = Expect->new; + my $command = 'ssh'; + my @parameters = ($userid . "@" . $ssh_ip); $ssh->debug(0); $ssh->log_stdout(0); # suppress stdout output.. @@ -717,6 +728,94 @@ sub process_pdudiscover { xCAT::MsgUtils->message("I", $rsp, $callback); } +#------------------------------------------------------- + +=head3 showMFR + + show MFR information of PDU via PduManager command + PduManager is a tool for CoralPdu to manager the PDU. + * /dev/shm/bin/PduManager -h + '-m' show MFR info + + example: rinv coralpdu + +=cut + +#------------------------------------------------------- + +sub showMFR { + my $noderange = shift; + my $callback = shift; + my $output; + + my $nodetab = xCAT::Table->new('hosts'); + my $nodehash = $nodetab->getNodesAttribs($noderange,['ip','otherinterfaces']); + + foreach my $pdu (@$noderange) { + # connect to PDU + my $static_ip = $nodehash->{$pdu}->[0]->{ip}; + my $discover_ip = $nodehash->{$pdu}->[0]->{otherinterfaces}; + my ($exp, $errstr) = session_connect($static_ip, $discover_ip); + if (defined $errstr) { + xCAT::SvrUtils::sendmsg("Failed to connect: $errstr", $callback); + } + + my ($ret, $err) = session_exec($exp, "/dev/shm/bin/PduManager -m"); + if (defined $err) { + xCAT::SvrUtils::sendmsg("Failed to list MFR information: $err", $callback); + } + if (defined $ret) { + xCAT::SvrUtils::sendmsg("$ret", $callback); + } + + $exp->hard_close(); + } +} + + +#------------------------------------------------------- + +=head3 showMonitorData + + Show realtime monitor data(input voltage, current, power) + of PDU via PduManager command + PduManager is a tool for CoralPdu to manager the PDU. + * /dev/shm/bin/PduManager -h + '-d' show realtime monitor data(input voltage, current, power) + + example: rvitals coralpdu + +=cut + +#------------------------------------------------------- +sub showMonitorData { + my $noderange = shift; + my $callback = shift; + my $output; + + my $nodetab = xCAT::Table->new('hosts'); + my $nodehash = $nodetab->getNodesAttribs($noderange,['ip','otherinterfaces']); + + foreach my $pdu (@$noderange) { + # connect to PDU + my $static_ip = $nodehash->{$pdu}->[0]->{ip}; + my $discover_ip = $nodehash->{$pdu}->[0]->{otherinterfaces}; + my ($exp, $errstr) = session_connect($static_ip, $discover_ip); + + my $ret; + my $err; + + ($ret, $err) = session_exec($exp, "/dev/shm/bin/PduManager -d"); + if (defined $err) { + xCAT::SvrUtils::sendmsg("Failed to show monitor data: $err", $callback); + } + if (defined $ret) { + xCAT::SvrUtils::sendmsg("$ret", $callback,$pdu); + } + + $exp->hard_close(); + } +} 1; diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 2bad5ccc8..edf5ce5ae 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -1452,14 +1452,14 @@ sub switchsetup { foreach my $pdu(@{${nodes_to_config}->{$mytype}}) { my $cmd = "rspconfig $pdu sshcfg"; xCAT::Utils->runcmd($cmd, 0); - my $ip = $nodehash->{$pdu}->[0]->{otherinterfaces}; + my $ip = $nodehash->{$pdu}->[0]->{ip}; my $mask; foreach my $net (@nets) { if (xCAT::NetworkUtils::isInSameSubnet( $net->{'net'}, $ip, $net->{'mask'}, 0)) { $mask=$net->{'mask'}; } } - $cmd = "rspconfig $pdu hostname=$pdu ip=$otherinterfaces netmask=$mask"; + $cmd = "rspconfig $pdu hostname=$pdu ip=$ip netmask=$mask"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC == 0) { xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$pdu,"ip=$ip","otherinterfaces="] }, $sub_req, 0, 1); From f781063624f2f2423889d5af12e1b717be3fe728 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 14 Sep 2017 11:30:06 -0400 Subject: [PATCH 5/5] remove " in the Usage.pm for rvitals --- perl-xCAT/xCAT/Usage.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 77e0162b7..8b0f839c0 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -85,7 +85,7 @@ my %usage = ( OpenPOWER (OpenBMC) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all] MIC specific: - rvitals noderange {thermal|all}" + rvitals noderange {thermal|all} pdu specific: rvitals noderange ", "reventlog" =>