Fix method to retrieve and compute real used pages (used - free pages)
This commit is contained in:
parent
4cf080a81d
commit
1cb03a2fad
1 changed files with 6 additions and 2 deletions
|
@ -90,7 +90,7 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
CMD="$MDB_STAT -e $DB_PATH"
|
||||
CMD="$MDB_STAT -ef $DB_PATH"
|
||||
debug "mdb_stat command = '$CMD'"
|
||||
|
||||
if [ -n "$SUDO_USER" ]
|
||||
|
@ -111,8 +111,12 @@ then
|
|||
exit 3
|
||||
fi
|
||||
|
||||
raw_used_pages=$( echo -e "$OUTPUT"|grep -E '^ +Number of pages used: '|sed 's/^ \+Number of pages used: \([0-9]\+\)$/\1/' )
|
||||
free_pages=$( echo -e "$OUTPUT"|grep -E '^ +Free pages: '|sed 's/^ \+Free pages: \([0-9]\+\)$/\1/' )
|
||||
let used_pages=raw_used_pages-free_pages
|
||||
debug "Used/free pages: $raw_used_pages / $free_pages. Real used pages: $used_pages"
|
||||
|
||||
max_pages=$( echo -e "$OUTPUT"|grep -E '^ +Max pages: '|sed 's/^ \+Max pages: \([0-9]\+\)$/\1/' )
|
||||
used_pages=$( echo -e "$OUTPUT"|grep -E '^ +Number of pages used: '|sed 's/^ \+Number of pages used: \([0-9]\+\)$/\1/' )
|
||||
let perc_used=$used_pages*100/$max_pages
|
||||
debug "Used/max pages: $used_pages / $max_pages ($perc_used%)"
|
||||
|
||||
|
|
Loading…
Reference in a new issue