+ protect more functions

This commit is contained in:
garnier-quentin 2015-10-05 16:52:24 +02:00
parent 6d4993dd5f
commit 9d861f8baf
2 changed files with 13 additions and 5 deletions

View File

@ -458,15 +458,19 @@ sub create_vsphere_child {
$self->{whoaim} = $options{vsphere_name};
$self->{centreon_vmware_config}->{vsphere_server}->{$self->{whoaim}}->{running} = 0;
$self->{centreon_vmware_config}->{vsphere_server}->{$self->{whoaim}}->{ready} = 0;
$self->{logger}->writeLogInfo("Create vsphere sub-process for '" . $options{vsphere_name} . "'");
$self->{logger}->writeLogInfo("Create vsphere sub-process for '" . $options{vsphere_name} . "'");
my $child_vpshere_pid = fork();
if (!defined($child_vpshere_pid)) {
$self->{logger}->writeLogError("Cannot fork for '" . $options{vsphere_name} . "': $!");
return -1;
}
if ($child_vpshere_pid == 0) {
my $connector = centreon::vmware::connector->new(name => $self->{whoaim},
modules_registry => $self->{modules_registry},
module_date_parse_loaded => $self->{module_date_parse_loaded},
config => $self->{centreon_vmware_config},
logger => $self->{logger});
modules_registry => $self->{modules_registry},
module_date_parse_loaded => $self->{module_date_parse_loaded},
config => $self->{centreon_vmware_config},
logger => $self->{logger});
$connector->run();
exit(0);
}

View File

@ -199,6 +199,10 @@ sub vsphere_event {
while (1) {
# Process all parts of the message
my $message = zmq_recvmsg($backend);
if (!defined($message)) {
$connector->{logger}->writeLogError("zmq_recvmsg error: $!");
last;
}
my $data = zmq_msg_data($message);
if ($data =~ /^REQCLIENT\s+(.*)$/msi) {