Commit 687d7b78 authored by Dan Gebhardt's avatar Dan Gebhardt
Browse files

- Fixed problems with a command that specifies a bgmon expt that is

  different than tbres/pelabbgmon
- Added ability in manger.pl to kill a node's bgmon.
parent b640afe0
......@@ -130,6 +130,9 @@ sub sendcmd($$)
if( !defined $cmd{managerID} ){
$cmd{managerID} = "default";
}
if( !defined $cmd{expid} ){
$cmd{expid} = $expid;
}
my $sercmd = serialize_hash( \%cmd );
# print "sercmd=$sercmd\n";
......@@ -238,7 +241,7 @@ sub sendcmd_evsys($$$;$)
sub stopnode($$)
{
my ($node,$managerID) = @_;
my %cmd = ( expid => $expid,
my %cmd = (
managerID => $managerID,
cmdtype => "STOPALL" );
sendcmd($node,\%cmd);
......@@ -264,10 +267,11 @@ sub stopnode_evsys($$$)
}
sub killnode($)
sub killnode($$)
{
my ($node) = @_;
my %cmd = ( expid => $expid,
my ($node,$managerID) = @_;
my %cmd = (
managerID=> $managerID,
cmdtype => "DIE" );
sendcmd($node,\%cmd);
}
......
......@@ -7,13 +7,13 @@
use lib '/usr/testbed/lib';
use libtbdb;
use libwanetmon;
use event;
use Getopt::Std;
use strict;
use IO::Socket::INET;
use IO::Select;
#use lib '/q/proj/tbres/gebhardt/testbed/pelab/bgmon';
use libwanetmon;
#
# Turn off line buffering on output
......@@ -28,7 +28,8 @@ sub usage {
my $debug = 0;
my $impotent = 0;
my $evexpt = "__none";
my $bgmonexpt = "tbres/pelabbgmon";
my $bgmonexpt;
my $default_bgmonexpt = "tbres/pelabbgmon";
my ($server,$port,$cmdport);
my %opt = ();
if (!getopts("s:p:c:dih", \%opt)) {
......@@ -98,7 +99,7 @@ $sel->add($socket_cmd);
print "setting cmdport $cmdport and cmdexpt $bgmonexpt\n";
setcmdport($cmdport);
setexpid($bgmonexpt);
setexpid($default_bgmonexpt);
#main()
......@@ -148,6 +149,16 @@ sub callbackFunc($$$) {
my $objname = event_notification_get_objname($handle, $notification);
my $eventtype = event_notification_get_eventtype($handle,
$notification);
my $thisexpid = event_notification_get_string($handle,
$notification,
"expid");
if( defined $thisexpid && $thisexpid ne "" ){
setexpid($thisexpid);
$bgmonexpt = $thisexpid;
}else{
$bgmonexpt = $default_bgmonexpt;
}
# print "Event: $time $site $expt $group $host $objtype $objname " .
# "$eventtype\n";
......@@ -266,9 +277,16 @@ sub callbackFunc($$$) {
stopnode($srcnode, $managerID);
}
elsif( $eventtype eq "DIE" ){
#TODO!
}
my $node = event_notification_get_string($handle,
$notification,
"srcnode");
my $managerID = event_notification_get_string($handle,
$notification,
"managerID");
print "got $eventtype:$node,$managerID,$bgmonexpt\n";
killnode($node,$managerID);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment