Fix Map 4 plugin
The mode gate was not working anymore due to some changes in Map server
This commit is contained in:
parent
8b8a6b4bbd
commit
8e707770d4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue