web/modules/dobby/scripts/check-oracle-space-usage.sh | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit d626641cef6324e0dbd6c870e6a5ddcc38c2b3a2
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Sep 1 14:25:10 2009 +0200
run db-control report only once
diff --git a/web/modules/dobby/scripts/check-oracle-space-usage.sh
b/web/modules/dobby/scripts/check-oracle-space-usage.sh
index 8600a37..71285d4 100755
--- a/web/modules/dobby/scripts/check-oracle-space-usage.sh
+++ b/web/modules/dobby/scripts/check-oracle-space-usage.sh
@@ -20,6 +20,8 @@ reportusage() {
}
mailitout() {
+ local reportusage=$1
+
#get Satellite email address
MAILADDRESS=$(spacewalk-cfg-get traceback_mail)
@@ -31,17 +33,18 @@ size of the tablespace before getting to 100% usage. Please consult
the Satellite documentation on using db-control to increase the size or
contact Red Hat Support for assistance."
- ( echo $BODY; echo ; reportusage ) | mail -s "$SUBJECT" $MAILADDRESS
+ echo -e "$BODY\n\n$reportusage" | mail -s "$SUBJECT" $MAILADDRESS
exit 0
}
#grab the usage numbers from the db-control report output
-NUMBERS=`reportusage | awk '{if (FNR > 1) {sub("%",""); print
$5}}'`
+REPORTUSAGE=$(reportusage)
+NUMBERS=$(echo "$REPORTUSAGE" | awk '{if (FNR > 1)
{sub("%",""); print $5}}')
# run db-control and then use awk and sed to get the % numbers
for num in $NUMBERS
do
# if number is over 90% then send warning email
if [ $num -gt 90 ]
- then mailitout
+ then mailitout "$REPORTUSAGE"
fi
done
exit 0
commit 1e9649e6ed001e30f826dfaff9097089e6aed40b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Sep 1 14:21:41 2009 +0200
488431 - don't report high usage on UNDO
diff --git a/web/modules/dobby/scripts/check-oracle-space-usage.sh
b/web/modules/dobby/scripts/check-oracle-space-usage.sh
index f0964c5..8600a37 100755
--- a/web/modules/dobby/scripts/check-oracle-space-usage.sh
+++ b/web/modules/dobby/scripts/check-oracle-space-usage.sh
@@ -15,7 +15,8 @@ PATH=/usr/bin:/bin
export PATH
reportusage() {
- /sbin/runuser oracle -c "db-control report"
+ # don't report UNDO usage
+ /sbin/runuser oracle -c "db-control report" | grep -v UNDO
}
mailitout() {
Show replies by date