mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-30 00:55:18 +02:00
Ctor 1019 plugin centreon plugin applications databases postgresql modes hitratio and backends exclude option is behaving the opposite way more like a filter (#5262)
CTOR-1019 fix(plugin): fix option exclude
This commit is contained in:
parent
938557e2fd
commit
39d6d4bbf9
@ -89,7 +89,7 @@ sub run {
|
||||
my $result = $options{sql}->fetchall_arrayref();
|
||||
|
||||
foreach my $row (@{$result}) {
|
||||
if (defined($self->{option_results}->{exclude}) && $$row[2] !~ /$self->{option_results}->{exclude}/) {
|
||||
if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $$row[2] =~ /$self->{option_results}->{exclude}/) {
|
||||
$self->{output}->output_add(long_msg => "Skipping database '" . $$row[2] . '"');
|
||||
next;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ sub run {
|
||||
$new_datas->{$row->[2] . '_blks_hit'} = $row->[0];
|
||||
$new_datas->{$row->[2] . '_blks_read'} = $row->[1];
|
||||
|
||||
if (defined($self->{option_results}->{exclude}) && $row->[2] !~ /$self->{option_results}->{exclude}/) {
|
||||
if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $row->[2] =~ /$self->{option_results}->{exclude}/) {
|
||||
$self->{output}->output_add(long_msg => "Skipping database '" . $row->[2] . '"');
|
||||
next;
|
||||
}
|
||||
@ -165,7 +165,7 @@ __END__
|
||||
|
||||
=head1 MODE
|
||||
|
||||
Check hitratio (in buffer cache) for databases.
|
||||
Check hit ratio (in buffer cache) for databases.
|
||||
|
||||
=over 8
|
||||
|
||||
|
@ -53,7 +53,7 @@ sub manage_selection {
|
||||
);
|
||||
$self->{list_db} = [];
|
||||
while ((my $row = $self->{sql}->fetchrow_hashref())) {
|
||||
if (defined($self->{option_results}->{exclude}) && $row->{datname} !~ /$self->{option_results}->{exclude}/) {
|
||||
if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $row->{datname} =~ /$self->{option_results}->{exclude}/) {
|
||||
$self->{output}->output_add(long_msg => "Skipping database '" . $row->{datname} . "': no matching filter name");
|
||||
next;
|
||||
}
|
||||
|
@ -87,9 +87,7 @@ sub run {
|
||||
my $dblocks = {};
|
||||
foreach my $row (@{$result}) {
|
||||
my ($granted, $mode, $dbname) = ($$row[0], $$row[1], $$row[2]);
|
||||
if (defined($self->{option_results}->{exclude}) && $dbname !~ /$self->{option_results}->{exclude}/) {
|
||||
next;
|
||||
}
|
||||
next if (defined($self->{option_results}->{exclude}) && $self->{option_results}->{exclude} ne '' && $dbname =~ /$self->{option_results}->{exclude}/);
|
||||
|
||||
if (!defined($dblocks->{$dbname})) {
|
||||
$dblocks->{$dbname} = {total => 0, waiting => 0};
|
||||
@ -155,12 +153,12 @@ Check locks for one or more databases
|
||||
=item B<--warning>
|
||||
|
||||
Warning threshold. (example: "total=250,waiting=5,exclusive=20")
|
||||
'total', 'waiting', or the name of a lock type used by Postgres.
|
||||
'total', 'waiting', or the name of a lock type used by PostgreSQL.
|
||||
|
||||
=item B<--critical>
|
||||
|
||||
Critical threshold. (example: "total=250,waiting=5,exclusive=20")
|
||||
'total', 'waiting', or the name of a lock type used by Postgres.
|
||||
'total', 'waiting', or the name of a lock type used by PostgreSQL.
|
||||
|
||||
=item B<--exclude>
|
||||
|
||||
|
@ -98,6 +98,7 @@ ldap
|
||||
--legacy-api-beta
|
||||
license-instances-usage-prct
|
||||
Loggly
|
||||
--lookback
|
||||
--lookup-perfdatas-nagios
|
||||
machineaccount
|
||||
--map-speed-dsl
|
||||
@ -134,6 +135,7 @@ Netscaler
|
||||
net-snmp
|
||||
NLCapacity
|
||||
--noeventlog
|
||||
--noidle
|
||||
-NoLogo
|
||||
--nomachineaccount
|
||||
--ntlmv2
|
||||
|
Loading…
x
Reference in New Issue
Block a user