We have moved at community.getvera.com

Author Topic: Logging engine restarts?  (Read 1597 times)

Offline JOD

  • Hero Member
  • *****
  • Posts: 1973
  • Karma: +4/-0
Logging engine restarts?
« 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.
I'm sorry, my responses are limited. You must ask the right questions.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Logging engine restarts? i
« Reply #1 on: October 04, 2011, 08:12:07 pm »
Create a plugin whose startup function writes the current time to a file ...

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Logging engine restarts?
« Reply #2 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()
Dezwaved at the moment...

Offline JOD

  • Hero Member
  • *****
  • Posts: 1973
  • Karma: +4/-0
Re: Logging engine restarts?
« Reply #3 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.
« Last Edit: October 15, 2011, 04:25:28 pm by JOD »
I'm sorry, my responses are limited. You must ask the right questions.