I have been a little frustrated with the lack of flexibility in how Vera logging. However, for some reason I could never easily capture a log entry of a problem I am trying to troubleshoot even with USB logging since for some reason only 1 archive of the log is kept. ( If someone knows of a simple way to keep 10 archives of logs on USB, please share).
In searching forums, I could not find if others have shared this previously. Taking advantage of the complete lack of security with vera around this, I discovered an extremely simple way of capturing all of logs on my server vs sending to Vera. This basically tricks Vera in to thinking your FTP server is their own.
- Log in to your Vera and copy the FTP login credentials with the logs section of /etc/cmh/servers.conf
[code]root@MiOS_PRIVATE:/etc/cmh# more servers.conf | grep Log
Log
Server_Log=vera-us-oem-log11.mios.com
Server_Log_Alt=vera-us-oem-log12.mios.com
Use_Server_Log_Alt=0
Server_Log_User=logs
Server_Log_Pass=XXXX[/code]
Using whatever FTP server you want to use, create a login with user “logs” and password with whatever you found in the above file.
In the FTP root directory, create a subdirectory named the serial# of your Vera found in the Unit Settings section or from the home portal . The name should just be the serial#. Make sure this is writable by the “logs” user.
Back on the Vera, edit the /etc/hosts file and add entries for the log server names and use your server IP address as the destination. I also added the old names for good measure :
root@MiOS_PRIVATE:/etc# cat /etc/hosts
127.0.0.1 localhost
192.168.14.94 local.mios.com local.my.mios.com
192.168.1.5 logs1.mios.com
192.168.1.5 logs2.mios.com
192.168.1.5 vera-us-oem-log11.mios.com
192.168.1.5 vera-us-oem-log12.mios.com
root@MiOS_PRIVATE:/etc#
Next, if not already selected within the logs section of the Vera GUI, select “Archive old logs on MiOS (recommended)”
To test, force a log Rotate which should push logs to your server:
root@MiOS_PRIVATE:~# /usr/bin/Rotate_Logs.sh --force
=== Start rotating logs PID=8911, force rotate=1, free space=127232 KB, min=5000 KB, cmh logs size=40 KB, max=19154 KB, now=1459704372, last rotation=1459704355, diff=0 min 17 sec, max=12 hours ===
=== Successfully uploaded logs for serial=PRIVATE, version=1.7.1754, server=vera-us-oem-log11.mios.com, date=2016-04-03_10-26-12 ===
That is all. You will start seeing logs populate every few minutes within your FTP server. Since there is no true server authentication taking place, your Vera will happily send your logs to your own server.
Note: I doubt this will survive a firmware upgrade (I have not tested yet). After a firmware upgrade you may need to update your /etc/hosts file again to point to your own server. If you ever want to restore back and archive to Vera, just comment out the entries in the /etc/hosts file.
Hope this helps