check_postgres icon indicating copy to clipboard operation
check_postgres copied to clipboard

check_disk_space section unable to find pg_logs

Open phinjensen opened this issue 12 years ago • 0 comments

ID: 94 Version: unspecified Date: 2011-12-09 19:56 EST Author: [email protected]


Great program!

I have installed the RHEL 6 rpm version (Version : 2.18.0) from the postgresql repository (From repo : pgdg91) and I am having a problem that unless I execute the program from the pg_hba directory it's unable to find the correct paths:

/usr/bin/check_postgres.pl -H localhost --dbuser=postgres --action disk_space ERROR: Invalid result from command "/bin/df -kP "../../pg_logs/instance1" 2>&1": /bin/df: `../../pg_logs/instance1': No such file or directory /bin/df: no file systems processed

however if I print out "$i{S}{data_directory}" the full data path is valid.

my case "/opt/postgresql/data/instance1."

So not sure what the right way of doing this is but my current workaround was to apply the following:

###############################################################################

*** /usr/bin/check_postgres.pl    2010-09-12 21:58:34.953908816 -0700
--- /usr/bin/check_postgres.pl.chg    2010-09-12 22:00:24.125192752 -0700
***************
*** 4206,4211 ****
--- 4206,4212 ----
              add_unknown msg('diskspace-nodata');
              next;
          }
+     chdir($i{S}{data_directory});
          my ($datadir,$logdir) =
($i{S}{data_directory},$i{S}{log_directory}||'');

          if (!exists $dir{$datadir}) {

###########################################################################

Please let me know if this is something that can be updated? Thank you-

phinjensen avatar Jun 19 '13 21:06 phinjensen