Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.
Closed
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 nagios/bin/pmp-check-lvm-snapshots
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ check_lvm_snapshot_fullness() {
local FILE="$1"
local FULL="$2"
awk -v full="$FULL" '
$1 != "LV" && $1 != "File" && $6 !~ /[^0-9.]/ && $6 > full {
print $2 "/" $1 "[" $5 "]=" $6 "%"
$1 != "LV" && $1 != "File" && $3 ~ /snapshot/ && $5 !~ /[^0-9.]/ && $5 > full {
print $2 "/" $1 "[" $4 "]=" $5 "%"
}' "${FILE}"
}

Expand Down Expand Up @@ -71,7 +71,7 @@ main() {
# the output of lvs.
PATH="$PATH:/usr/sbin:/sbin"
if [ -z "$1" ]; then
lvs > "${TEMP}" 2>&1
lvs --noheadings -o lv_name,vg_name,role,origin,snap_percent > "${TEMP}" 2>&1
else
cat "$1" > "${TEMP}" 2>/dev/null # For testing only
fi
Expand Down