Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit 2917d9f

Browse files
committed
bugfix: Do not show log directory/file details if log_destination=syslog
1 parent 36238ff commit 2917d9f

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

resources/checks/A008_disk_usage_fstype.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,24 @@ PG_STATS_TEMP_DIR=$(${CHECK_HOST_CMD} "${_PSQL} -f -" <<EOF
2020
EOF
2121
)
2222

23-
PG_LOG_DIR=$(${CHECK_HOST_CMD} "${_PSQL} -f -" <<EOF
24-
show log_directory
23+
log_destination=$(${CHECK_HOST_CMD} "${_PSQL} -f -" <<EOF
24+
show log_destination
2525
EOF
2626
)
2727

28-
# process relative paths
29-
if ! [[ "${PG_LOG_DIR}" =~ ^/ ]]; then
30-
PG_LOG_DIR="${PG_DATA_DIR}/${PG_LOG_DIR}"
28+
if [[ "$log_destination" != "syslog" ]]; then
29+
PG_LOG_DIR=$(${CHECK_HOST_CMD} "${_PSQL} -f -" <<EOF
30+
show log_directory
31+
EOF
32+
)
33+
# process relative paths
34+
if ! [[ "${PG_LOG_DIR}" =~ ^/ ]]; then
35+
PG_LOG_DIR="${PG_DATA_DIR}/${PG_LOG_DIR}"
36+
fi
37+
else
38+
PG_LOG_DIR="syslog"
3139
fi
40+
3241
if ! [[ "${PG_STATS_TEMP_DIR}" =~ ^/ ]]; then
3342
PG_STATS_TEMP_DIR="${PG_DATA_DIR}/${PG_STATS_TEMP_DIR}"
3443
fi
@@ -113,6 +122,10 @@ if $(${CHECK_HOST_CMD} "sudo stat \"$PG_LOG_DIR\" >/dev/null 2>&1"); then
113122
echo ","
114123
echo "\"log_directory\":"
115124
print_df "$PG_LOG_DIR"
125+
elif [[ "$PG_LOG_DIR" == "syslog" ]]; then
126+
echo ","
127+
echo "\"log_directory\":"
128+
df_to_json "syslog" "" "" "" "" "" "" "" ""
116129
fi
117130

118131
echo "},"

0 commit comments

Comments
 (0)