+

Added perfomance data return

Benjamin Renard [2011-10-14 08:22:53]
Added perfomance data return
Filename
check_pg_restore
diff --git a/check_pg_restore b/check_pg_restore
index 8ca2d94..cf86da2 100755
--- a/check_pg_restore
+++ b/check_pg_restore
@@ -34,6 +34,8 @@ size=`du -sm $WAL|sed 's/\([0-9]*\).*/\1/g'`
 STATE=OK
 EXIT=0
 MSG="all files have been restored ($size MB - $nbnodel files not deleted)."
+
+PERF_DATA="size=${size}MB,not_deleted_files=$nbnodel,not_restored_files=$nb"
 if [ $nb -gt $CRIT -o $size -gt $CRIT_SIZE ]
 then
 	STATE="CRITICAL"
@@ -48,5 +50,5 @@ else
 	fi
 fi

-echo "PG RESTORE $STATE: $MSG"
+echo "PG RESTORE $STATE: $MSG | $PERF_DATA"
 exit $EXIT
ViewGit