A bash script for OS X that details information about sleep: why, why not, when and what's preventing sleep
More information about the script can be found here: http://cs.lth.se/peter-moller/script/sleep-info-en/
The command pmset
is used to gather information about sleep settings and also what prevents the computer form sleeping.
syslog
is used to gather information about when and why the computer fell asleep/woke up. This requires, however, that the user is in the group admin
or nothing will be found.