The Vera Community forums have moved!

Advanced => Programming => Scene Scripting => Topic started by: JOD on October 04, 2011, 11:20:01 am

Title: Logging engine restarts?
Post by: JOD on October 04, 2011, 11:20:01 am
Is it possible to log an engine restart the same way the reboots can be logged?

Reboot logging:
Code: [Select]
local filename = '/etc/cmh/uptimes.log'

local outf = io.open(filename, 'a')

outf:write(os.date('%Y-%m-%d %H:%M:%S '..os.time()..' '))

outf:close()

os.execute('uptime >> '..filename )

I have one scene that does not run consistantly through a 24 hr period using "Every 120 minute" as the timer. I'm suspecting an engine restart but I can't confirm it.

JOD.
Title: Re: Logging engine restarts? i
Post by: Ap15e on October 04, 2011, 08:12:07 pm
Create a plugin whose startup function writes the current time to a file ...
Title: Re: Logging engine restarts?
Post by: oTi@ on October 15, 2011, 11:45:36 am
Is it possible to log an engine restart the same way the reboots can be logged?
Possibly, for temporary diagnostics, add something (untested) like the following in the Mios Developers > Edit Startup Lua?
(Obviously the file will grow forever, etc.)

Code: [Select]
local filename = '/etc/cmh/restarts.log'
local outf = io.open(filename, 'a')
outf:write(os.date('%Y-%m-%d %H:%M:%S '..os.time()..' '))
outf:close()
Title: Re: Logging engine restarts?
Post by: JOD on October 15, 2011, 02:12:27 pm
:D Thank you oTi@!!  

You know, It's tools like this that should be provided by MCV to help with diagnoses during beta testing.
I'm still suffering from scenes not starting or failing to complete and I can see I am still getting reboots, now I can monitor the restarts.
When I've power cycled Vera, I go into the log and make a note that I did it.
I see the log entry now for a manual "Reload" so I can do the same thing there too. Perfect.

Thanks again.
JOD.