more fix for RMC monitoring on AIX

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1795 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2008-06-27 04:26:52 +00:00
parent 4c6e7af13b
commit 13fa2a4a32
2 changed files with 31 additions and 9 deletions

View File

@ -551,9 +551,13 @@ sub addNodes_noChecking {
if($iphash{$node}) {
$mn_node_id=$ms_node_id;
} else {
$mn_node_id=`$::XCATROOT/bin/psh --nonodecheck $node /usr/sbin/rsct/bin/lsnodeid 2>&1`;
if ($^O =~ /^linux/i) {
$mn_node_id=`$::XCATROOT/bin/psh --nonodecheck $node /usr/sbin/rsct/bin/lsnodeid 2>&1`;
} else {
$mn_node_id=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node -t 30 /usr/sbin/rsct/bin/lsnodeid 2>&1`;
}
if ($?) {
xCAT::MsgUtils->message('SI', "[mon]: Cannot get NodeID for $node. $mn_node_id\n");
xCAT::MsgUtils->message('SI', "[mon]: Cannot get NodeID for $node. $mn_node_id\n");
next;
}
if ($mn_node_id =~ s/.*([0-9 a-g]{16}).*/$1/s) {;}
@ -585,13 +589,20 @@ sub addNodes_noChecking {
next;
}
} else {
$result=`scp $::XCATROOT/sbin/rmcmon/configrmcnode $node:/tmp 2>&1`;
if ($^O =~ /^linux/i) {
$result=`scp $::XCATROOT/sbin/rmcmon/configrmcnode $node:/tmp 2>&1`;
} else {
$result=`XCATBYPASS=Y $::XCATROOT/bin/xdcp $node $::XCATROOT/sbin/rmcmon/configrmcnode /tmp 2>&1`;
}
if ($?) {
xCAT::MsgUtils->message('SI', "[mon]: rmcmon:addNodes: cannot copy the file configrmcnode to node $node\n");
next;
}
$result=`$::XCATROOT/bin/psh --nonodecheck $node NODE=$node MONSERVER=$master MS_NODEID=$ms_node_id /tmp/configrmcnode 1 2>&1`;
if ($^O =~ /^linux/i) {
$result=`$::XCATROOT/bin/psh --nonodecheck $node NODE=$node MONSERVER=$master MS_NODEID=$ms_node_id /tmp/configrmcnode 1 2>&1`;
} else {
$result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node NODE=$node MONSERVER=$master MS_NODEID=$ms_node_id /tmp/configrmcnode 1 2>&1`;
}
if ($?) {
xCAT::MsgUtils->message('SI', "[mon]: $result\n");
}
@ -670,13 +681,21 @@ sub removeNodes_noChecking {
}
} else {
#copy the configuration script and run it locally
$result=`scp $::XCATROOT/sbin/rmcmon/configrmcnode $node:/tmp 2>&1 `;
if ($^O =~ /^linux/i) {
$result=`scp $::XCATROOT/sbin/rmcmon/configrmcnode $node:/tmp 2>&1 `;
} else {
$result=`XCATBYPASS=Y $::XCATROOT/bin/xdcp $node $::XCATROOT/sbin/rmcmon/configrmcnode /tmp 2>&1 `;
}
if ($?) {
xCAT::MsgUtils->message('SI', "[mon]: rmcmon:removeNodes: cannot copy the file configrmcnode to node $node\n");
next;
}
$result=`$::XCATROOT/bin/psh --nonodecheck $node NODE=$node /tmp/configrmcnode -1 2>&1`;
if ($^O =~ /^linux/i) {
$result=`$::XCATROOT/bin/psh --nonodecheck $node NODE=$node /tmp/configrmcnode -1 2>&1`;
} else {
$result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node NODE=$node /tmp/configrmcnode -1 2>&1`;
}
if ($?) {
xCAT::MsgUtils->message('SI', "[mon]: $result\n");
}

View File

@ -28,7 +28,6 @@ fi
#ask RMC take the new nodeid
if [[ $NODEID != "" ]]; then
/usr/sbin/rsct/bin/rmcctrl -z
if [ -e /var/ct/cfg/ct_node_id ]; then
sed -i s/^[^\#].*$/$NODEID/ /var/ct/cfg/ct_node_id
else
@ -67,7 +66,11 @@ if [ $ADD -eq 1 ]; then
if [ $? -eq 0 ]; then
index1=`expr index "$result" "\("`
index2=`expr index "$result" "\)"`
ms_ip=${result:$index1+1:$index2-$index1-2}
#ms_ip=${result:$index1+1:$index2-$index1-2}
pos=`expr $index1 + 1`
length=`expr $index2 - $index1`
length=`expr $length - 2`
ms_ip=`expr substr "$result" $pos $length`
else
logger xCAT "RMC setup on node $NODE:$result"
fi