mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
parent
c3100644a0
commit
08c9d63ca0
@ -80,7 +80,6 @@ sub new {
|
|||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"exclude:s" => { name => 'exclude', },
|
|
||||||
});
|
});
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
||||||
@ -152,7 +151,6 @@ sub run {
|
|||||||
my @exits;
|
my @exits;
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
||||||
next if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $_ =~ /$self->{option_results}->{exclude}/);
|
|
||||||
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != 0) {
|
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != 0) {
|
||||||
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_}*$maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_}*$maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
||||||
}
|
}
|
||||||
@ -166,8 +164,7 @@ sub run {
|
|||||||
my $str_output = "Group '$instance_output' ";
|
my $str_output = "Group '$instance_output' ";
|
||||||
my $str_append = '';
|
my $str_append = '';
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
next if (!defined($self->{counters_value}->{$instance}->{$_}));
|
next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} == 0);
|
||||||
next if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $_ =~ /$self->{option_results}->{exclude}/);
|
|
||||||
|
|
||||||
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
||||||
$str_append = ', ';
|
$str_append = ', ';
|
||||||
@ -210,12 +207,6 @@ Can be: 'voltage', 'current', 'power'.
|
|||||||
Threshold critical.
|
Threshold critical.
|
||||||
Can be: 'voltage', 'current', 'power'.
|
Can be: 'voltage', 'current', 'power'.
|
||||||
|
|
||||||
=item B<--exclude>
|
|
||||||
|
|
||||||
Metrics excluded.
|
|
||||||
Can be: 'voltage', 'current', 'power'.
|
|
||||||
Use | if you want to exclude two or more metrics.
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@ -80,7 +80,6 @@ sub new {
|
|||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
"exclude:s" => { name => 'exclude', },
|
|
||||||
});
|
});
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
||||||
@ -156,7 +155,6 @@ sub run {
|
|||||||
my @exits;
|
my @exits;
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
foreach my $name (keys %{$maps_counters->{$_}->{thresholds}}) {
|
||||||
next if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $_ =~ /$self->{option_results}->{exclude}/);
|
|
||||||
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != 0) {
|
if (defined($self->{counters_value}->{$instance}->{$_}) && $self->{counters_value}->{$instance}->{$_} != 0) {
|
||||||
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_}*$maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
push @exits, $self->{perfdata}->threshold_check(value => $self->{counters_value}->{$instance}->{$_}*$maps_counters->{$_}->{factor}, threshold => [ { label => $maps_counters->{$_}->{thresholds}->{$name}->{label}, 'exit_litteral' => $maps_counters->{$_}->{thresholds}->{$name}->{exit_value} }]);
|
||||||
}
|
}
|
||||||
@ -170,9 +168,7 @@ sub run {
|
|||||||
my $str_output = "Outlet '$instance_output' ";
|
my $str_output = "Outlet '$instance_output' ";
|
||||||
my $str_append = '';
|
my $str_append = '';
|
||||||
foreach (keys %{$maps_counters}) {
|
foreach (keys %{$maps_counters}) {
|
||||||
#next if (!defined($self->{counters_value}->{$instance}->{$_}) || $self->{counters_value}->{$instance}->{$_} == 0);
|
next if (!defined($self->{counters_value}->{$instance}->{$_})) || $self->{counters_value}->{$instance}->{$_} == 0);
|
||||||
next if (!defined($self->{counters_value}->{$instance}->{$_}));
|
|
||||||
next if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $_ =~ /$self->{option_results}->{exclude}/);
|
|
||||||
|
|
||||||
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
$str_output .= $str_append . sprintf($maps_counters->{$_}->{output_msg}, $self->{counters_value}->{$instance}->{$_} * $maps_counters->{$_}->{factor});
|
||||||
$str_append = ', ';
|
$str_append = ', ';
|
||||||
@ -215,12 +211,6 @@ Can be: 'voltage', 'current', 'power'.
|
|||||||
Threshold critical.
|
Threshold critical.
|
||||||
Can be: 'voltage', 'current', 'power'.
|
Can be: 'voltage', 'current', 'power'.
|
||||||
|
|
||||||
=item B<--exclude>
|
|
||||||
|
|
||||||
Metrics excluded.
|
|
||||||
Can be: 'voltage', 'current', 'power'.
|
|
||||||
Use | if you want to exclude two or more metrics.
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user