mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
Fix #1467
This commit is contained in:
parent
8f008705f8
commit
2b3ca0c834
@ -126,6 +126,7 @@ sub get {
|
|||||||
$self->settings();
|
$self->settings();
|
||||||
my $response = $self->{http}->request(url_path => '/storeonceservices' . $options{path},
|
my $response = $self->{http}->request(url_path => '/storeonceservices' . $options{path},
|
||||||
critical_status => '', warning_status => '');
|
critical_status => '', warning_status => '');
|
||||||
|
|
||||||
my $content;
|
my $content;
|
||||||
eval {
|
eval {
|
||||||
$content = XMLin($response, ForceArray => $options{ForceArray}, KeyAttr => []);
|
$content = XMLin($response, ForceArray => $options{ForceArray}, KeyAttr => []);
|
||||||
|
@ -148,8 +148,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
||||||
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
||||||
@ -194,15 +193,16 @@ sub manage_selection {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $total = (defined($entry->{properties}->{capacity})) ? $entry->{properties}->{capacity} * 1024 * 1024 * 1024 : $entry->{properties}->{localCapacityBytes};
|
my $total = defined($entry->{properties}->{capacity}) ? $entry->{properties}->{capacity} * 1024 * 1024 * 1024 : $entry->{properties}->{localCapacityBytes};
|
||||||
my $used = $total - (defined($entry->{properties}->{freeSpace})) ? $entry->{properties}->{freeSpace} * 1024 * 1024 * 1024 : $entry->{properties}->{localFreeBytes};
|
my $used = $total - (defined($entry->{properties}->{freeSpace}) ? $entry->{properties}->{freeSpace} * 1024 * 1024 * 1024 : $entry->{properties}->{localFreeBytes});
|
||||||
|
|
||||||
$self->{cluster}->{$entry->{properties}->{serialNumber}} = {
|
$self->{cluster}->{$entry->{properties}->{serialNumber}} = {
|
||||||
display => $entry->{properties}->{applianceName},
|
display => $entry->{properties}->{applianceName},
|
||||||
health => $mapping_health_level{$entry->{properties}->{healthLevel}},
|
health => $mapping_health_level{$entry->{properties}->{healthLevel}},
|
||||||
total => $total,
|
total => $total,
|
||||||
used => $used,
|
used => $used,
|
||||||
dedup => $entry->{properties}->{dedupeRatio} };
|
dedup => $entry->{properties}->{dedupeRatio}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,8 +95,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"warning-status:s" => { name => 'warning_status', default => '%{is_online} == 1 and %{health} =~ /warning/i' },
|
"warning-status:s" => { name => 'warning_status', default => '%{is_online} == 1 and %{health} =~ /warning/i' },
|
||||||
"critical-status:s" => { name => 'critical_status', default => '%{is_online} == 1 and %{health} =~ /critical/i' },
|
"critical-status:s" => { name => 'critical_status', default => '%{is_online} == 1 and %{health} =~ /critical/i' },
|
||||||
@ -155,7 +154,8 @@ sub manage_selection {
|
|||||||
is_online => $entry->{properties}->{isOnline} eq 'true' ? 1 : 0,
|
is_online => $entry->{properties}->{isOnline} eq 'true' ? 1 : 0,
|
||||||
used => $entry->{properties}->{diskBytes},
|
used => $entry->{properties}->{diskBytes},
|
||||||
dedup => $entry->{properties}->{dedupeRatio},
|
dedup => $entry->{properties}->{dedupeRatio},
|
||||||
num_items => $entry->{properties}->{numItems} };
|
num_items => $entry->{properties}->{numItems}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,8 +95,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"warning-nas-status:s" => { name => 'warning_nas_status', default => '%{health} =~ /warning/i' },
|
"warning-nas-status:s" => { name => 'warning_nas_status', default => '%{health} =~ /warning/i' },
|
||||||
"critical-nas-status:s" => { name => 'critical_nas_status', default => '%{health} =~ /critical/i' },
|
"critical-nas-status:s" => { name => 'critical_nas_status', default => '%{health} =~ /critical/i' },
|
||||||
|
@ -151,8 +151,7 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
"filter-name:s" => { name => 'filter_name' },
|
||||||
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
||||||
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
||||||
@ -204,7 +203,8 @@ sub manage_selection {
|
|||||||
replication_health => $mapping_health_level{$entry->{properties}->{repHealthLevel}},
|
replication_health => $mapping_health_level{$entry->{properties}->{repHealthLevel}},
|
||||||
total => $entry->{properties}->{capacityBytes},
|
total => $entry->{properties}->{capacityBytes},
|
||||||
used => $entry->{properties}->{capacityBytes} - $entry->{properties}->{freeBytes},
|
used => $entry->{properties}->{capacityBytes} - $entry->{properties}->{freeBytes},
|
||||||
dedup => $entry->{properties}->{dedupeRatio} };
|
dedup => $entry->{properties}->{dedupeRatio}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user