mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 16:14:21 +02:00
add ipc_file in config file
This commit is contained in:
parent
4ec0b5677d
commit
d5cde61230
@ -98,11 +98,11 @@ my @load_modules = (
|
|||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $self = $class->SUPER::new("centreon_vmware");
|
my $self = $class->SUPER::new('centreon_vmware');
|
||||||
|
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
$self->add_options(
|
$self->add_options(
|
||||||
"config-extra=s" => \$self->{opt_extra},
|
'config-extra=s' => \$self->{opt_extra},
|
||||||
);
|
);
|
||||||
|
|
||||||
%{$self->{centreon_vmware_default_config}} =
|
%{$self->{centreon_vmware_default_config}} =
|
||||||
@ -115,6 +115,7 @@ sub new {
|
|||||||
dynamic_timeout_kill => 86400,
|
dynamic_timeout_kill => 86400,
|
||||||
refresh_keeper_session => 15,
|
refresh_keeper_session => 15,
|
||||||
port => 5700,
|
port => 5700,
|
||||||
|
ipc_file => '/tmp/centreon_vmware/routing.ipc',
|
||||||
case_insensitive => 0,
|
case_insensitive => 0,
|
||||||
vsphere_server => {
|
vsphere_server => {
|
||||||
#'default' => {'url' => 'https://XXXXXX/sdk',
|
#'default' => {'url' => 'https://XXXXXX/sdk',
|
||||||
@ -545,7 +546,7 @@ sub run {
|
|||||||
|
|
||||||
zmq_setsockopt($frontend, ZMQ_LINGER, 0); # we discard
|
zmq_setsockopt($frontend, ZMQ_LINGER, 0); # we discard
|
||||||
zmq_bind($frontend, 'tcp://*:' . $centreon_vmware->{centreon_vmware_config}->{port});
|
zmq_bind($frontend, 'tcp://*:' . $centreon_vmware->{centreon_vmware_config}->{port});
|
||||||
$centreon_vmware->bind_ipc(socket => $frontend, ipc_file => '/tmp/centreon_vmware/routing.ipc');
|
$centreon_vmware->bind_ipc(socket => $frontend, ipc_file => $centreon_vmware->{centreon_vmware_config}->{ipc_file});
|
||||||
|
|
||||||
foreach (keys %{$centreon_vmware->{centreon_vmware_config}->{vsphere_server}}) {
|
foreach (keys %{$centreon_vmware->{centreon_vmware_config}->{vsphere_server}}) {
|
||||||
$centreon_vmware->{counter_stats}->{$_} = 0;
|
$centreon_vmware->{counter_stats}->{$_} = 0;
|
||||||
|
@ -54,6 +54,7 @@ sub new {
|
|||||||
$connector->{modules_registry} = $options{modules_registry};
|
$connector->{modules_registry} = $options{modules_registry};
|
||||||
$connector->{logger} = $options{logger};
|
$connector->{logger} = $options{logger};
|
||||||
$connector->{whoaim} = $options{name};
|
$connector->{whoaim} = $options{name};
|
||||||
|
$connector->{config_ipc_file} = $options{config}->{ipc_file};
|
||||||
$connector->{config_child_timeout} = $options{config}->{timeout};
|
$connector->{config_child_timeout} = $options{config}->{timeout};
|
||||||
$connector->{config_stop_child_timeout} = $options{config}->{timeout_kill};
|
$connector->{config_stop_child_timeout} = $options{config}->{timeout_kill};
|
||||||
$connector->{config_vsphere_session_heartbeat} = $options{config}->{refresh_keeper_session};
|
$connector->{config_vsphere_session_heartbeat} = $options{config}->{refresh_keeper_session};
|
||||||
@ -178,7 +179,7 @@ sub reqclient {
|
|||||||
$self->{modules_registry}->{$result->{command}}->initArgs(arguments => $result);
|
$self->{modules_registry}->{$result->{command}}->initArgs(arguments => $result);
|
||||||
$self->{modules_registry}->{$result->{command}}->run();
|
$self->{modules_registry}->{$result->{command}}->run();
|
||||||
|
|
||||||
centreon::vmware::common::response(token => 'RESPSERVER2', endpoint => $backend, reinit => 'ipc:///tmp/centreon_vmware/routing.ipc');
|
centreon::vmware::common::response(token => 'RESPSERVER2', endpoint => $backend, reinit => 'ipc://' . $self->{config_ipc_file});
|
||||||
zmq_close($backend);
|
zmq_close($backend);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
@ -219,7 +220,7 @@ sub run {
|
|||||||
$backend = zmq_socket($context, ZMQ_DEALER);
|
$backend = zmq_socket($context, ZMQ_DEALER);
|
||||||
zmq_setsockopt($backend, ZMQ_IDENTITY, "server-" . $connector->{whoaim});
|
zmq_setsockopt($backend, ZMQ_IDENTITY, "server-" . $connector->{whoaim});
|
||||||
zmq_setsockopt($backend, ZMQ_LINGER, 0); # we discard
|
zmq_setsockopt($backend, ZMQ_LINGER, 0); # we discard
|
||||||
zmq_connect($backend, 'ipc:///tmp/centreon_vmware/routing.ipc');
|
zmq_connect($backend, 'ipc://' . $connector->{config_ipc_file});
|
||||||
centreon::vmware::common::response(token => 'READY', endpoint => $backend, force_response => '');
|
centreon::vmware::common::response(token => 'READY', endpoint => $backend, force_response => '');
|
||||||
|
|
||||||
# Initialize poll set
|
# Initialize poll set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user