fix node status monitoring with RMC

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1735 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2008-06-21 21:12:33 +00:00
parent e6ff6eca90
commit b9db7b0b46
3 changed files with 18 additions and 9 deletions

View File

@ -342,9 +342,9 @@ sub saveRMCNodeStatusToxCAT {
#get all the node status from mn's children
my $result;
if ($node) {
$result=`lsrsrc-api -s IBM.MngNode::::Name::Status 2>&1`;
$result=`CT_MANAGEMENT_SCOPE=4 /usr/bin/lsrsrc-api -o IBM.MngNode::::$node::Name::Status 2>&1`;
} else {
$result=`lsrsrc-api -s IBM.MngNode::::Name::Status 2>&1`;
$result=`CT_MANAGEMENT_SCOPE=1 /usr/bin/lsrsrc-api -s IBM.MngNode::::Name::Status 2>&1`;
}
if ($?) {
$retcode=$?;

View File

@ -39,9 +39,10 @@ if [ $ADD -eq 1 ]; then
#define resource in IBM.MCP class on node
result1=`/usr/bin/mkrsrc-api IBM.MCP::MNName::"$NODE"::KeyToken::"$MASTER_NAME"::IPAddresses::"$MASTER_IPS"::NodeID::$MASTER_NODEID 2>&1`
if [ $? -gt 0 ]; then
logger xCAT "Define resource in IBM.MCP class on node $NODE. result=$result1" }
logger xCAT "Define resource in IBM.MCP class on node $NODE. result=$result1"
exit 1
fi
#TODO: create predefined sensors
else
#remove resource in IBM.MCP class on the node

View File

@ -4,6 +4,10 @@
# This script is used by UpdatexCATNodeStatus event response to handle the node
# status changes from the condition NodeReachability and NodeReachability_H
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use strict;
use Getopt::Std;
@ -53,15 +57,19 @@ if ($cond_name eq "NodeReachability") {
if ($attrName eq '"Status"') { $status = $attrValue; }
}
} else {
print "this script does not handle condition $cond_name\n";
`logger xCAT "[mon]: updatexcatnodestatus: This script does not handle condition $cond_name"`;
exit 1;
}
my $status_string;
if ($status == 1) { $status_string="active"; }
else { $status_string="inactive"; }
open(CMD, "| wall") || die "Error: can not start wall command.\n";
print CMD "node=$node status=$status\n";
close(CMD);
my $result=`$::XCATROOT/bin/nodech $node nodelist.status=$status_string 2>&1`;
my $code=$?;
if ($code) {
`logger xCAT "[mon]: Error saving node status ($node,$status_string) to xCAT:$result"`;
exit $code;
}
exit 0