Today I came across an issue where a Mac running OS X wouldn't sleep on power, but would sleep fine when on battery. The root cause was a stuck print job in the printer queue. Read on for instructions on how to troubleshoot power and sleep issues on OS X.
In OS X the pmset -g assertions command gives you a summary of the power management assertions in affect.
bob@mymac:~$ pmset -g assertions 22/04/12 12:13:18 PM AE Assertion status system-wide: ChargeInhibit 0 PreventUserIdleDisplaySleep 0 PreventUserIdleSystemSleep 0 NoRealPowerSources_debug 0 CPUBoundAssertion 0 EnableIdleSleep 1 PreventSystemSleep 1 ...