support xcatmon push model for HPC software.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8256 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sjing 2010-11-24 07:07:56 +00:00
parent a3de90b7df
commit dd4fd4b76b

View File

@ -51,7 +51,8 @@ sub handled_commands
{
return {
updatenode => "updatenode",
updatenodestat => "updatenode"
updatenodestat => "updatenode",
updatenodeappstat => "updatenode"
};
}
@ -84,6 +85,10 @@ sub preprocess_request
{
return [$request];
}
elsif ($command eq "updatenodeappstat")
{
return [$request];
}
else
{
my $rsp = {};
@ -127,6 +132,10 @@ sub process_request
{
return updatenodestat($request, $callback);
}
elsif ($command eq "updatenodeappstat")
{
return updatenodeappstat($request, $callback);
}
else
{
my $rsp = {};
@ -2525,3 +2534,54 @@ sub updateOS {
return;
}
#-------------------------------------------------------------------------------
=head3 updatenodeappstat
This subroutine is used to handle the messages reported by
HPCbootstatus postscript. Update appstatus node attribute.
Arguments:
Returns:
0 - for success.
1 - for error.
=cut
#-----------------------------------------------------------------------------
sub updatenodeappstat
{
my $request = shift;
my $callback = shift;
my @nodes = ();
my @args = ();
if (ref($request->{node}))
{
@nodes = @{$request->{node}};
}
else
{
if ($request->{node}) { @nodes = ($request->{node}); }
}
if (ref($request->{arg}))
{
@args = @{$request->{arg}};
}
else
{
@args = ($request->{arg});
}
if ((@nodes > 0) && (@args > 0))
{
# format: apps=status
my $appstat = $args[0];
my ($apps, $newstatus) = split(/=/,$appstat);
xCAT::Utils->setAppStatus(\@nodes, $apps, $newstatus);
}
return 0;
}