From 792a6c5450aafee8d0489fb14793374b103c124c Mon Sep 17 00:00:00 2001 From: Bertrand Cournaud Date: Thu, 1 Oct 2015 13:24:05 +0200 Subject: [PATCH] + Update map 4 plugin with new mbeans name --- apps/centreon/map/jmx/mode/eventqueue.pm | 8 ++++---- apps/centreon/map/jmx/mode/eventstatistics.pm | 8 ++++---- apps/centreon/map/jmx/mode/gates.pm | 8 ++++---- apps/centreon/map/jmx/mode/sessions.pm | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/centreon/map/jmx/mode/eventqueue.pm b/apps/centreon/map/jmx/mode/eventqueue.pm index ecab5277e..9cd6a8e00 100644 --- a/apps/centreon/map/jmx/mode/eventqueue.pm +++ b/apps/centreon/map/jmx/mode/eventqueue.pm @@ -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); diff --git a/apps/centreon/map/jmx/mode/eventstatistics.pm b/apps/centreon/map/jmx/mode/eventstatistics.pm index 80ce73119..494fb186d 100644 --- a/apps/centreon/map/jmx/mode/eventstatistics.pm +++ b/apps/centreon/map/jmx/mode/eventstatistics.pm @@ -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, diff --git a/apps/centreon/map/jmx/mode/gates.pm b/apps/centreon/map/jmx/mode/gates.pm index f9346482b..27d855c15 100644 --- a/apps/centreon/map/jmx/mode/gates.pm +++ b/apps/centreon/map/jmx/mode/gates.pm @@ -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); diff --git a/apps/centreon/map/jmx/mode/sessions.pm b/apps/centreon/map/jmx/mode/sessions.pm index 70749bb51..443bde899 100644 --- a/apps/centreon/map/jmx/mode/sessions.pm +++ b/apps/centreon/map/jmx/mode/sessions.pm @@ -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);