Fix Map 4 plugin

The mode gate was not working anymore due to some changes in Map server
This commit is contained in:
Bertrand Cournaud 2017-07-11 11:03:08 +02:00 committed by GitHub
parent 8b8a6b4bbd
commit 8e707770d4
1 changed files with 4 additions and 4 deletions

View File

@ -58,22 +58,22 @@ sub run {
$self->{connector} = $options{custom}; $self->{connector} = $options{custom};
$self->{request} = [ $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 $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, my $exit = $self->{perfdata}->threshold_check(value => $gates,
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning'} ]); threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning'} ]);
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Business gates opened : %d", 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', $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'), warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0); min => 0);