diff --git a/src/database/postgres/mode/backends.pm b/src/database/postgres/mode/backends.pm index a847019ca..573902bd5 100644 --- a/src/database/postgres/mode/backends.pm +++ b/src/database/postgres/mode/backends.pm @@ -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; } diff --git a/src/database/postgres/mode/hitratio.pm b/src/database/postgres/mode/hitratio.pm index d2ac14804..32801ff67 100644 --- a/src/database/postgres/mode/hitratio.pm +++ b/src/database/postgres/mode/hitratio.pm @@ -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 diff --git a/src/database/postgres/mode/listdatabases.pm b/src/database/postgres/mode/listdatabases.pm index da7b618f6..a2d570845 100644 --- a/src/database/postgres/mode/listdatabases.pm +++ b/src/database/postgres/mode/listdatabases.pm @@ -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; } diff --git a/src/database/postgres/mode/locks.pm b/src/database/postgres/mode/locks.pm index 1c73d3f02..deb584a8d 100644 --- a/src/database/postgres/mode/locks.pm +++ b/src/database/postgres/mode/locks.pm @@ -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> diff --git a/tests/resources/spellcheck/stopwords.txt b/tests/resources/spellcheck/stopwords.txt index 38aceba5d..d7689ea9e 100644 --- a/tests/resources/spellcheck/stopwords.txt +++ b/tests/resources/spellcheck/stopwords.txt @@ -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