## Command line options always overwrite these
## Format of these files is simply name=val
-my $rcfile;
-if (-e '.check_postgresrc') {
- $rcfile = '.check_postgresrc';
-}
-elsif (-e "$ENV{HOME}/.check_postgresrc") {
- $rcfile = "$ENV{HOME}/.check_postgresrc";
+## This option must come before the GetOptions call
+for my $arg (@ARGV) {
+ if ($arg eq '--no-check_postgresrc') {
+ $opt{'no-check_postgresrc'} = 1;
+ last;
+ }
}
-elsif (-e '/etc/check_postgresrc') {
- $rcfile = '/etc/check_postgresrc';
+
+my $rcfile;
+if (! $opt{'no-check_postgresrc'}) {
+ if (-e '.check_postgresrc') {
+ $rcfile = '.check_postgresrc';
+ }
+ elsif (-e "$ENV{HOME}/.check_postgresrc") {
+ $rcfile = "$ENV{HOME}/.check_postgresrc";
+ }
+ elsif (-e '/etc/check_postgresrc') {
+ $rcfile = '/etc/check_postgresrc';
+ }
}
if (defined $rcfile) {
open my $rc, '<', $rcfile or die qq{Could not open "$rcfile": $!\n};
'test',
'symlinks',
'debugoutput=s',
+ 'no-check_postgresrc',
'action=s',
'warning=s',
=over 4
+=item B<Version 2.11.0>
+
+ Add the --no-check_postgresrc flag.
+
=item B<Version 2.10.1>
Add Nagios perf output to the wal_files check (Cédric Villemain)