From 8e707770d42c954df950481ff362dde68acec348 Mon Sep 17 00:00:00 2001 From: Bertrand Cournaud Date: Tue, 11 Jul 2017 11:03:08 +0200 Subject: [PATCH] Fix Map 4 plugin The mode gate was not working anymore due to some changes in Map server --- apps/centreon/map/jmx/mode/gates.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/centreon/map/jmx/mode/gates.pm b/apps/centreon/map/jmx/mode/gates.pm index b70a32f56..9291f8491 100644 --- a/apps/centreon/map/jmx/mode/gates.pm +++ b/apps/centreon/map/jmx/mode/gates.pm @@ -58,22 +58,22 @@ sub run { $self->{connector} = $options{custom}; $self->{request} = [ - { mbean => "com.centreon.studio.map:name=BusinessGate,type=repo" } + { mbean => "com.centreon.studio.map:name=statistics,type=context" } ]; my $result = $self->{connector}->get_attributes(request => $self->{request}, nothing_quit => 1); - my $gates = $result->{"com.centreon.studio.map:name=BusinessGate,type=repo"}->{LoadedModelCount}; + my $gates = $result->{"com.centreon.studio.map:name=statistics,type=context"}->{OpenContextCount}; my $exit = $self->{perfdata}->threshold_check(value => $gates, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning'} ]); $self->{output}->output_add(severity => $exit, short_msg => sprintf("Business gates opened : %d", - $result->{"com.centreon.studio.map:name=BusinessGate,type=repo"}->{LoadedModelCount})); + $result->{"com.centreon.studio.map:name=statistics,type=context"}->{OpenContextCount})); $self->{output}->perfdata_add(label => 'gates', - value => $result->{"com.centreon.studio.map:name=BusinessGate,type=repo"}->{LoadedModelCount}, + value => $result->{"com.centreon.studio.map:name=statistics,type=context"}->{OpenContextCount}, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), min => 0);