Power Management - Scheduled actions
-
I’m using FOG Client 0.11.2 with FOG Trunk version 8355.
I’ve noticed that computers in my building are not turning off overnight. I had scheduled everything to turn off at 10 pm every day. I’ve deleted all those so I can test just my desktop.
I scheduled a shutdown at 8:30 this morning, it didn’t run. I noticed however the host time is incorrect, it’s behind by an hour. So I figured this may have caused the issue for the 8:30 shutdown. So I made another shutdown task for 7:40 - which then-would have been there in 10 minutes.
------------------------------------------------------------------------------ --------------------------------PowerManagement------------------------------- ------------------------------------------------------------------------------ 7/7/2016 7:40 AM Client-Info Client Version: 0.11.2 7/7/2016 7:40 AM Client-Info Client OS: Windows 7/7/2016 7:40 AM Client-Info Server Version: 7/7/2016 7:40 AM Middleware::Response Success 7/7/2016 7:40 AM PowerManagement Calculating tasks to unschedule 7/7/2016 7:40 AM PowerManagement Calculating tasks to schedule 7/7/2016 7:40 AM PowerManagement --> A shutdown at 40 7 * * * is already scheduled ------------------------------------------------------------------------------
However this task didn’t run. here’s the full client log:
0_1467899347434_fog.log -
Also just noticed that the server version isn’t reporting in the log file. It used to work on this client version - so that must be a server side issue @Tom-Elliott.
-
Issue confirmed and patched in nightlies. Fix will be available in v0.11.3 release.
-
0.11.3 has been released. Of course please keep us posted if this is still happening, or not.
-
This issue is fixed.
Although I should explain some of the things I learned when messing with it this morning.
If your time is off on the client, scheduled tasks won’t perform as expected. My time was off due to incorrect timezone. I fixed it by creating a batch script with this in it, and deployed it via snapins to the building:
%windir%\system32\tzutil /s "Central Standard Time"
After that ran, I noticed the system time was corrected - however the timestamps in the FOG Client (0.11.3) were still incorrect. It was still counting up using the old time. So I rebooted my computer to fix this, and then when it came back up the FOG Client started writing correct timestamps.
I tried a scheduled shutdown, and it appears to work.
-
@Senior-Developers I think this may not be fixed yet entirely.
I’m not sure what the problem is at this point - but I think it’s server side.
I set a power management setting to shut down all computers at 10 pm. It looks like this:
I’ve noticed computers are not shutting down, it’s been two days. time is correct on all computers now, and server time is correct.
I did some digging in the
powerManagement
table, in the fog db. A lot of strange stuff in there, I truncated the table to start fresh.I also updated to 8540, and then tried re-doing the power management settings for all hosts.
When I select all rows from
powerManagement
, this is what I’m seeing and it looks a whole lot better now:MariaDB [fog]> select * from powerManagement; +------+----------+-------+--------+-------+---------+-------+----------+------------+ | pmID | pmHostID | pmMin | pmHour | pmDom | pmMonth | pmDow | pmAction | pmOndemand | +------+----------+-------+--------+-------+---------+-------+----------+------------+ | 1 | 829 | 0 | 22 | * | * | * | shutdown | 0 | | 2 | 828 | 0 | 22 | * | * | * | shutdown | 0 | | 3 | 830 | 0 | 22 | * | * | * | shutdown | 0 | | 4 | 377 | 0 | 22 | * | * | * | shutdown | 0 | | 5 | 379 | 0 | 22 | * | * | * | shutdown | 0 | .... all the same. | 423 | 749 | 0 | 22 | * | * | * | shutdown | 0 | | 424 | 838 | 0 | 22 | * | * | * | shutdown | 0 | | 425 | 750 | 0 | 22 | * | * | * | shutdown | 0 | | 426 | 855 | 0 | 22 | * | * | * | shutdown | 0 | | 427 | 854 | 0 | 22 | * | * | * | shutdown | 0 | +------+----------+-------+--------+-------+---------+-------+----------+------------+ 427 rows in set (0.00 sec)
However, on my desktop the FOG Client (0.11.3) isn’t getting the settings for some reason:
------------------------------------------------------------------------------ --------------------------------PowerManagement------------------------------- ------------------------------------------------------------------------------ 7/13/2016 2:05 PM Client-Info Client Version: 0.11.3 7/13/2016 2:05 PM Client-Info Client OS: Windows 7/13/2016 2:05 PM Client-Info Server Version: 8540 7/13/2016 2:05 PM Middleware::Response Success 7/13/2016 2:05 PM PowerManagement Calculating tasks to unschedule 7/13/2016 2:05 PM PowerManagement Calculating tasks to schedule ------------------------------------------------------------------------------
Here is the entire log file: 0_1468436777369_fog.log
-
@Joe-Schmitt and I tested this today and we did not see any issues. I half wonder, (doubt it should matter much) if updating the minute field to 1 helps?
-
@Tom-Elliott I can try it.
Tomorrow I’m going to tell the building to reboot first thing in the morning, too - after I truncate the powerManagement table agian.
-
Found issue and fixed it. This was indeed happening due to the minute field being set to 0. The same would’ve also happened if the hour field was set to 0. Bad logic on my part (trying to use 0 as identifier returns as false in php).
-
Confirmed fixed, the client is now showing in the logs the scheduled power task.