Merge pull request #703 from bcournaud/patch-1

Fix Map 4 plugin
This commit is contained in:
qgarnier 2017-07-11 11:07:10 +02:00 committed by GitHub
commit f4f2b79a5a
1 changed files with 4 additions and 4 deletions

View File

@ -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);