This commit is contained in:
garnier-quentin 2016-01-15 10:36:10 +01:00
parent 7993c47c50
commit 3118725303
2 changed files with 13 additions and 11 deletions

View File

@ -126,7 +126,7 @@ sub run {
my $entity = centreon::vmware::common::get_view($self->{connector}, $_->entity, ['name']); my $entity = centreon::vmware::common::get_view($self->{connector}, $_->entity, ['name']);
my $alarm = centreon::vmware::common::get_view($self->{connector}, $_->alarm, ['info']); my $alarm = centreon::vmware::common::get_view($self->{connector}, $_->alarm, ['info']);
$dc_alarms->{$datacenter_view->name}->{alarms}->{$_->key} = { type => $_->entity->type, name => $entity->name, $dc_alarms->{$datacenter_view->name}->{alarms}->{$_->key} = { type => $_->entity->type, entity_name => $entity->name,
time => $_->time, name => $alarm->info->name, time => $_->time, name => $alarm->info->name,
description => $alarm->info->description, description => $alarm->info->description,
status => $_->overallStatus->val}; status => $_->overallStatus->val};
@ -152,11 +152,12 @@ sub run {
$self->{manager}->{output}->output_add(long_msg => sprintf(" %s warn alarm(s) found(s) - %s critical alarm(s) found(s)", $self->{manager}->{output}->output_add(long_msg => sprintf(" %s warn alarm(s) found(s) - %s critical alarm(s) found(s)",
$dc_alarms->{$dc_name}->{yellow}, $dc_alarms->{$dc_name}->{red})); $dc_alarms->{$dc_name}->{yellow}, $dc_alarms->{$dc_name}->{red}));
foreach my $alert (keys %{$dc_alarms->{$dc_name}->{alarms}}) { foreach my $alert (keys %{$dc_alarms->{$dc_name}->{alarms}}) {
$self->{manager}->{output}->output_add(long_msg => sprintf(" [%s] [%s] [%s] [%s] %s", $self->{manager}->{output}->output_add(long_msg => sprintf(" [%s] [%s] [%s] [%s] %s/%s",
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{status}, $dc_alarms->{$dc_name}->{alarms}->{$alert}->{status},
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{name},
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{time},
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{type}, $dc_alarms->{$dc_name}->{alarms}->{$alert}->{type},
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{entity_name},
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{time},
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{name},
$dc_alarms->{$dc_name}->{alarms}->{$alert}->{description} $dc_alarms->{$dc_name}->{alarms}->{$alert}->{description}
)); ));
} }

View File

@ -125,10 +125,10 @@ sub run {
my $entity = centreon::vmware::common::get_view($self->{connector}, $_->entity, ['name']); my $entity = centreon::vmware::common::get_view($self->{connector}, $_->entity, ['name']);
my $alarm = centreon::vmware::common::get_view($self->{connector}, $_->alarm, ['info']); my $alarm = centreon::vmware::common::get_view($self->{connector}, $_->alarm, ['info']);
$host_alarms->{$host_view->name}->{alarms}->{$_->key} = { type => $_->entity->type, name => $entity->name, $host_alarms->{$host_view->name}->{alarms}->{$_->key} = { type => $_->entity->type, entity_name => $entity->name,
time => $_->time, name => $alarm->info->name, time => $_->time, name => $alarm->info->name,
description => $alarm->info->description, description => $alarm->info->description,
status => $_->overallStatus->val}; status => $_->overallStatus->val};
$host_alarms->{$host_view->name}->{$_->overallStatus->val}++; $host_alarms->{$host_view->name}->{$_->overallStatus->val}++;
$total_alarms->{$_->overallStatus->val}++; $total_alarms->{$_->overallStatus->val}++;
} }
@ -151,11 +151,12 @@ sub run {
$self->{manager}->{output}->output_add(long_msg => sprintf(" %s warn alarm(s) found(s) - %s critical alarm(s) found(s)", $self->{manager}->{output}->output_add(long_msg => sprintf(" %s warn alarm(s) found(s) - %s critical alarm(s) found(s)",
$host_alarms->{$host_name}->{yellow}, $host_alarms->{$host_name}->{red})); $host_alarms->{$host_name}->{yellow}, $host_alarms->{$host_name}->{red}));
foreach my $alert (keys %{$host_alarms->{$host_name}->{alarms}}) { foreach my $alert (keys %{$host_alarms->{$host_name}->{alarms}}) {
$self->{manager}->{output}->output_add(long_msg => sprintf(" [%s] [%s] [%s] [%s] %s", $self->{manager}->{output}->output_add(long_msg => sprintf(" [%s] [%s] [%s] [%s] %s/%s",
$host_alarms->{$host_name}->{alarms}->{$alert}->{status}, $host_alarms->{$host_name}->{alarms}->{$alert}->{status},
$host_alarms->{$host_name}->{alarms}->{$alert}->{name},
$host_alarms->{$host_name}->{alarms}->{$alert}->{time},
$host_alarms->{$host_name}->{alarms}->{$alert}->{type}, $host_alarms->{$host_name}->{alarms}->{$alert}->{type},
$host_alarms->{$host_name}->{alarms}->{$alert}->{entity_name},
$host_alarms->{$host_name}->{alarms}->{$alert}->{time},
$host_alarms->{$host_name}->{alarms}->{$alert}->{name},
$host_alarms->{$host_name}->{alarms}->{$alert}->{description} $host_alarms->{$host_name}->{alarms}->{$alert}->{description}
)); ));
} }