+ Update map 4 plugin with new mbeans name
This commit is contained in:
parent
ef5f5c298c
commit
792a6c5450
|
@ -59,20 +59,20 @@ sub run {
|
|||
$self->{connector} = $options{custom};
|
||||
|
||||
$self->{request} = [
|
||||
{ mbean => "com.merethis.studio:name=statistics,type=session" }
|
||||
{ mbean => "com.centreon.studio:name=statistics,type=session" }
|
||||
];
|
||||
|
||||
my $result = $self->{connector}->get_attributes(request => $self->{request}, nothing_quit => 0);
|
||||
|
||||
my $exit = $self->{perfdata}->threshold_check(value => $result->{"com.merethis.studio:name=statistics,type=session"}->{AverageEventQueueSize},
|
||||
my $exit = $self->{perfdata}->threshold_check(value => $result->{"com.centreon.studio:name=statistics,type=session"}->{AverageEventQueueSize},
|
||||
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning'} ]);
|
||||
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("Average event queue size : %d",
|
||||
$result->{"com.merethis.studio:name=statistics,type=session"}->{AverageEventQueueSize}));
|
||||
$result->{"com.centreon.studio:name=statistics,type=session"}->{AverageEventQueueSize}));
|
||||
|
||||
$self->{output}->perfdata_add(label => 'events',
|
||||
value => $result->{"com.merethis.studio:name=statistics,type=session"}->{AverageEventQueueSize},
|
||||
value => $result->{"com.centreon.studio:name=statistics,type=session"}->{AverageEventQueueSize},
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
||||
min => 0);
|
||||
|
|
|
@ -78,7 +78,7 @@ sub run {
|
|||
$self->{connector} = $options{custom};
|
||||
|
||||
$self->{request} = [
|
||||
{ mbean => "com.merethis.studio:name=statistics,type=whatsup" }
|
||||
{ mbean => "com.centreon.studio.map:name=statistics,type=whatsup" }
|
||||
];
|
||||
|
||||
my $result = $self->{connector}->get_attributes(request => $self->{request}, nothing_quit => 0);
|
||||
|
@ -94,10 +94,10 @@ sub run {
|
|||
}
|
||||
|
||||
foreach my $type ('EventCount', 'EventTypeCreate', 'EventTypeUpdate', 'EventTypeRemove') {
|
||||
$new_datas->{$type} = $result->{"com.merethis.studio:name=statistics,type=whatsup"}->{$type}->{andIncrement};
|
||||
$new_datas->{$type} = $result->{"com.centreon.studio.map:name=statistics,type=whatsup"}->{$type}->{andIncrement};
|
||||
my $old_val = $self->{statefile_cache}->get(name => $type);
|
||||
next if (!defined($old_val) || $result->{"com.merethis.studio:name=statistics,type=whatsup"}->{$type}->{andIncrement} < $old_val);
|
||||
my $value = int(($result->{"com.merethis.studio:name=statistics,type=whatsup"}->{$type}->{andIncrement} - $old_val) / ($new_datas->{last_timestamp} - $old_timestamp));
|
||||
next if (!defined($old_val) || $result->{"com.centreon.studio.map:name=statistics,type=whatsup"}->{$type}->{andIncrement} < $old_val);
|
||||
my $value = int(($result->{"com.centreon.studio.map:name=statistics,type=whatsup"}->{$type}->{andIncrement} - $old_val) / ($new_datas->{last_timestamp} - $old_timestamp));
|
||||
|
||||
$self->{output}->perfdata_add(label => $type,
|
||||
value => $value,
|
||||
|
|
|
@ -59,22 +59,22 @@ sub run {
|
|||
$self->{connector} = $options{custom};
|
||||
|
||||
$self->{request} = [
|
||||
{ mbean => "com.merethis.map:name=BusinessGate,type=repo" }
|
||||
{ mbean => "com.centreon.studio.map:name=BusinessGate,type=repo" }
|
||||
];
|
||||
|
||||
my $result = $self->{connector}->get_attributes(request => $self->{request}, nothing_quit => 1);
|
||||
|
||||
my $gates = $result->{"com.merethis.map:name=BusinessGate,type=repo"}->{LoadedModelCount};
|
||||
my $gates = $result->{"com.centreon.studio.map:name=BusinessGate,type=repo"}->{LoadedModelCount};
|
||||
|
||||
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.merethis.map:name=BusinessGate,type=repo"}->{LoadedModelCount}));
|
||||
$result->{"com.centreon.studio.map:name=BusinessGate,type=repo"}->{LoadedModelCount}));
|
||||
|
||||
$self->{output}->perfdata_add(label => 'gates',
|
||||
value => $result->{"com.merethis.map:name=BusinessGate,type=repo"}->{LoadedModelCount},
|
||||
value => $result->{"com.centreon.studio.map:name=BusinessGate,type=repo"}->{LoadedModelCount},
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
||||
min => 0);
|
||||
|
|
|
@ -59,20 +59,20 @@ sub run {
|
|||
$self->{connector} = $options{custom};
|
||||
|
||||
$self->{request} = [
|
||||
{ mbean => "com.merethis.studio:name=statistics,type=session" }
|
||||
{ mbean => "com.centreon.studio:name=statistics,type=session" }
|
||||
];
|
||||
|
||||
my $result = $self->{connector}->get_attributes(request => $self->{request}, nothing_quit => 0);
|
||||
|
||||
my $exit = $self->{perfdata}->threshold_check(value => $result->{"com.merethis.studio:name=statistics,type=session"}->{SessionCount},
|
||||
my $exit = $self->{perfdata}->threshold_check(value => $result->{"com.centreon.studio:name=statistics,type=session"}->{SessionCount},
|
||||
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning'} ]);
|
||||
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("Current sessions : %d",
|
||||
$result->{"com.merethis.studio:name=statistics,type=session"}->{SessionCount}));
|
||||
$result->{"com.centreon.studio:name=statistics,type=session"}->{SessionCount}));
|
||||
|
||||
$self->{output}->perfdata_add(label => 'sessions',
|
||||
value => $result->{"com.merethis.studio:name=statistics,type=session"}->{SessionCount},
|
||||
value => $result->{"com.centreon.studio:name=statistics,type=session"}->{SessionCount},
|
||||
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