summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/ivymon22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/ivymon b/src/ivymon
index 8e584d1..4d7ccc5 100755
--- a/src/ivymon
+++ b/src/ivymon
@@ -1032,6 +1032,7 @@ sub removeIvyBinding {
# Functions related to connected applications management
#----------------------------------------------------------------------------------
sub checkClientsStatus {
+
my $appname = $_[3];
my $status = $_[4];
my $host;
@@ -1046,16 +1047,18 @@ sub checkClientsStatus {
$host = $_[5];
$regexp = $host;
}
+ $host =~ s/:.*//;
+ print "status=$status host=$host regexp=$regexp\n";
$appname =~ s/ /_/g;
if ($status eq 'died') {
&removeClient($appname, $host);
} elsif ($status eq 'new') {
&addClient($appname, $host);
} elsif ($status eq 'subscribing') {
- $clientsBindings{$appname}->{$host}++;
- &newBinding($regexp);
+ $clientsBindings{$appname}->{$regexp}++;
+ &addBindingAndMsgToSend($regexp);
} elsif ($status eq 'unsubscribing') {
- $clientsBindings{$appname}->{$host}--;
+ $clientsBindings{$appname}->{$regexp}--;
} else {
carp "In Ivymon, checkClientsStatus function, unknown status <$status>\n";
}
@@ -1239,7 +1242,7 @@ sub showClientBindings {
$t->tagConfigure('1', -background => '#e5e5e5');
my $i = 0;
for my $regexp (sort keys(%{$clientsBindings{$client}})) {
- print "client=$client regexp=$regexp\n";
+ #print "client=$client regexp=$regexp\n";
$t->insert('end', $regexp."\n", $i % 2)
if $clientsBindings{$client}->{$regexp} > 0;
$i++;
@@ -1515,7 +1518,7 @@ sub addBindingInList {
# add a binding in the bindings list and, after some modifications,
# add a new message in the list of messages to send.
-sub newBinding {
+sub addBindingAndMsgToSend {
my $regexp = shift;
return if $regexp eq '(.*)';
@@ -1567,8 +1570,15 @@ sub newBinding {
&addMsgToSend(undef, $msg);
}
-} # end newBinding
+} # end addBindingAndMsgToSend
+
+
+sub removeBindingAndMsgToSend {
+
+ my $regexp = shift;
+ my $host = shift;
+} # end removeBindingAndMsgToSend
sub selectBinding {