Store logs USB

From MiOS
(Difference between revisions)
Jump to: navigation, search
(Minor edits to simplify and standardize the page)
Line 1: Line 1:
'[[Category:User Instructions]]
+
[[Category:User Instructions]]
[[Category:How_To]]
+
[[Category:How To]]
'''HOWTO get your vera log an attached USB drive.'''
+
'''HOWTO get your Vera log an attached USB drive.'''
  
==Prerequisits==
+
==Introduction==
This wil work for:
+
On larger Vera deployments, with large numbers of Z-Wave Devices, Plugins or Scenes, it may be necessary to move the Vera log files to external storage to free-up space for Vera to function correctly.
  
* VERA 2 only
+
MiOS Version 1.1.1245 introduced an option to let users attach a standard USB drive to offload Vera's log files, the details are in the MiOS [[Release Notes]], inlined here:
  
* Firmware 1.1.1245 and above
+
:''2. There is an option with Vera2 on Advanced, Logs to enable logging to a USB drive. This frees up quite a bit of memory, so if you have a lot of devices or plugins and your Vera is running slow or crashing because it's running out of memory, this is a solution. Note that after you check the box it can take up to 30 minutes to format the USB drive, and bootup will take a couple minutes longer with the USB drive installed. It will continue to boot up fine without the USB drive connected, just don't remove it while Vera is running. ''
  
==Intro==
+
:''IMPORTANT: Use a new USB drive that hasn't already been formatted. In particular, don't use a USB drive that is already formatted for Mac''
  
First of all, the release notes for version 1.1.1245 state:
+
This [[:Category:How To|How To]] note shows you how to enable this option, how to validate that it's been enabled, and provides pointers to further reading.
  
"2. There is an option with Vera2 (Currently not working with Vera1) on Advanced, Logs to enable logging to a USB stick. This frees up quite a bit of memory, so if you have a lot of devices or plugins and your Vera is running slow or crashing because it's running out of memory, this is a solution. Note that after you check the box it can take up to 30 minutes to format the USB drive, and bootup will take a couple minutes longer with the USB drive installed. It will continue to boot up fine without the USB drive connected, just don't remove it while Vera is running. IMPORTANT: Use a new USB drive that hasn't already been formatted. In particular, don't use a USB drive that is already formatted for Mac."
+
==Prerequisites==
 
+
This solution will requires:
This is true so if youre new to all of this and want to avoid headaches, follow the advice and get an NEW usb drive.
+
* Vera 2 Hardware ''only''
I recommend it being not smaller than 512Mb and not much bigger than 1Gb. Vera will create its own partition on it which will be 512Mb in size and use that to write logfiles to it.
+
* Firmware 1.1.1245 and above
 
+
* A ''new'' USB Drive
For the less feintharted amongst us, if you DO want to use a drive that you have lying around, i suggest you clean it (backup and remove your files) and reformat it using a standard FAT partition before you go ahead.
+
** Drive should be between 512Mb and 1Gb
 
+
** Vera will create its own partition on it which will be 512Mb in size and use that to write logfiles to it.
==Link to forum==
+
** Experienced users only: a ''newly'' FAT-formatted ''existing'' USB drive may work. The jury is out on this one.
please find more info here [http://forum.micasaverde.com/index.php?topic=6439.msg40790]
+
  
 
==Instructions==
 
==Instructions==
  
1. After you got your usb-drive connected to the USB port on the backside of your vera.
+
* After you got your usb-drive connected to the USB port on the backside of your Vera.<br />Please be patient, it might not work the first time, but it will work. DO NOT REMOVE THE DRIVE while Vera boots/reboots or during power-cycle operations.
  Please be patient, it might not work the first time, but it will work. And very important, DO NOT REMOVE THE DRIVE WHILE VERA boots/reboots or powercycles.
+
* Log into the UI
2. Log into the UI
+
* Select "Advanced" on the sop right (next to "MiOS developers" in the toolbox)
3. Select "advanced" on the sop right (next to "Mios developers" in the toolbox)
+
* Select the "Logs"tab
4. Select the "Logs"tab
+
* Activate the "Store logs on USB device*" option and READ the text there:
5. Activate the "Store logs on USB device*" option and READ the text there:
+
: ''Please connect an USB drive first then check the checkbox.''
  [quote[
+
: ''WARNING: The USB drive will be erased. Wait 20 minutes after clicking OK.''
  Please connect an USB drive first then check the checkbox.
+
: ''Status''
  WARNING: The usb drive will be erased. Wait 20 minutes after clicking OK.
+
* Click the "OK" button.
  Status  
+
  [/quote]
+
6. Click the "OK" button.
+
  
 
Wait until vera reports progress.
 
Wait until vera reports progress.
  
If vera reports "FAILURE" go through step 2 through 6 again.
+
If MiOS reports "FAILURE", repeat the process.
If vera reports succes, you are done.
+
If MiOS reports Success, you are done.
  
==Make sure your drive works==
+
==Validation==
For thos who would like to check:
+
For those who would like to validate it's setup correctly, here are some detailed steps.
  
 
SSH into your vera (using Putty or any other SSH client)
 
SSH into your vera (using Putty or any other SSH client)
Login as root with the password thats on the back of your box.
+
Login as <tt>root</tt> with the password thats on the back of your box.
  
 
At the prompt type:
 
At the prompt type:
 
+
  root@MiOS_1xxxx:~# df -h
<df -h>
+
  
 
If you find something like:
 
If you find something like:
[quote]
+
  Filesystem                Size      Used Available Use% Mounted on
/dev/scsi/host0/bus0/target0/lun0/part1
+
  ...
                        503.9M     20.2M    458.2M   4% /tmp/log/cmh
+
    /dev/scsi/host0/bus0/target0/lun0/part1
[/quote]
+
                          506.2M     29.2M    451.3M   6% /tmp/log/cmh
 
+
  ...
Then your USB drive is used for storing logs.
+
  
==Advanced==
+
Then your USB drive is being used to storing MiOS log files.
For the enthousiasts, i stumbled on an older thread where @guessed and @Ap15e contributed here:
+
http://forum.micasaverde.com/index.php?topic=5405.0
+
  
Mixing the original code with some common sence gave me this:
+
==References==
[quote]
+
* USB Drive logging discussion [http://forum.micasaverde.com/index.php?topic=6439]
-- Code by Ap15e:
+
--
+
os.execute( 'uptime >> /tmp/log/cmh/LuaTerminated.log;'..
+
            'grep "LuaUPnP Terminated with"  /var/log/cmh/LuaUPnP.log >> /tmp/log/cmh/LuaTerminated.log;'..
+
            'cat /tmp/log/cmh/LuaTerminated.log | sort | uniq >/tmp/log/cmh/LuaTerminated.log')
+
--
+
-- logs uptime and Lua restarts to /tmp/log/cmh/LuaTerminated.log on the USB drive.
+
-- Just paste the code into the 'Luup' tab of a scene and set an appropriate timer.
+
[/quote]
+

Revision as of 02:11, 18 May 2011

HOWTO get your Vera log an attached USB drive.

Contents

Introduction

On larger Vera deployments, with large numbers of Z-Wave Devices, Plugins or Scenes, it may be necessary to move the Vera log files to external storage to free-up space for Vera to function correctly.

MiOS Version 1.1.1245 introduced an option to let users attach a standard USB drive to offload Vera's log files, the details are in the MiOS Release Notes, inlined here:

2. There is an option with Vera2 on Advanced, Logs to enable logging to a USB drive. This frees up quite a bit of memory, so if you have a lot of devices or plugins and your Vera is running slow or crashing because it's running out of memory, this is a solution. Note that after you check the box it can take up to 30 minutes to format the USB drive, and bootup will take a couple minutes longer with the USB drive installed. It will continue to boot up fine without the USB drive connected, just don't remove it while Vera is running.
IMPORTANT: Use a new USB drive that hasn't already been formatted. In particular, don't use a USB drive that is already formatted for Mac

This How To note shows you how to enable this option, how to validate that it's been enabled, and provides pointers to further reading.

Prerequisites

This solution will requires:

  • Vera 2 Hardware only
  • Firmware 1.1.1245 and above
  • A new USB Drive
    • Drive should be between 512Mb and 1Gb
    • Vera will create its own partition on it which will be 512Mb in size and use that to write logfiles to it.
    • Experienced users only: a newly FAT-formatted existing USB drive may work. The jury is out on this one.

Instructions

  • After you got your usb-drive connected to the USB port on the backside of your Vera.
    Please be patient, it might not work the first time, but it will work. DO NOT REMOVE THE DRIVE while Vera boots/reboots or during power-cycle operations.
  • Log into the UI
  • Select "Advanced" on the sop right (next to "MiOS developers" in the toolbox)
  • Select the "Logs"tab
  • Activate the "Store logs on USB device*" option and READ the text there:
Please connect an USB drive first then check the checkbox.
WARNING: The USB drive will be erased. Wait 20 minutes after clicking OK.
Status
  • Click the "OK" button.

Wait until vera reports progress.

If MiOS reports "FAILURE", repeat the process. If MiOS reports Success, you are done.

Validation

For those who would like to validate it's setup correctly, here are some detailed steps.

SSH into your vera (using Putty or any other SSH client) Login as root with the password thats on the back of your box.

At the prompt type:

 root@MiOS_1xxxx:~# df -h

If you find something like:

 Filesystem                Size      Used Available Use% Mounted on
 ...
   /dev/scsi/host0/bus0/target0/lun0/part1
                         506.2M     29.2M    451.3M   6% /tmp/log/cmh
 ...

Then your USB drive is being used to storing MiOS log files.

References

  • USB Drive logging discussion [1]
Personal tools