Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pmp-check-lvm-snapshots
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ check_lvm_snapshot_fullness() {
local FILE="$1"
local FULL="$2"
awk -v full="$FULL" '
$1 != "LV" && $1 != "File" && $6 !~ /[^0-9.]/ && $6 > full {
$1 != "LV" && $1 != "File" && $6 !~ /[^0-9.,]/ && $6 > full {
print $2 "/" $1 "[" $5 "]=" $6 "%"
}' "${FILE}"
}
Expand Down Expand Up @@ -81,11 +81,11 @@ main() {
elif grep 'WARNING: Running as a non-root user' "${TEMP}" >/dev/null 2>&1; then
NOTE="UNK You must execute lvs with root privileges"
else
local VOLS=$(check_lvm_snapshot_fullness "${TEMP}" "${OPT_CRIT}")
local VOLS="$(check_lvm_snapshot_fullness "${TEMP}" "${OPT_CRIT}")"
if [ "${VOLS}" ]; then
NOTE="CRIT LVM snapshot volumes over ${OPT_CRIT}% full: ${VOLS}"
else
VOLS=$(check_lvm_snapshot_fullness "${TEMP}" "${OPT_WARN}")
VOLS="$(check_lvm_snapshot_fullness "${TEMP}" "${OPT_WARN}")"
if [ "${VOLS}" ]; then
NOTE="WARN LVM snapshot volumes over ${OPT_WARN}% full: ${VOLS}"
fi
Expand Down