PurgeWhenFull doesn't work

Support and queries relating to all previous versions of ZoneMinder
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

PurgeWhenFull doesn't work

Post by decibel83 »

Hi.

I configured the PurgeWhenFull filter on the "filter" window from the main
console to run in background and to automatically delete the oldest 200 events "asc" ordered by date/time.
I don't know if I setted up the filter correctly, because it doesn't work.
This evening I found the hard disk filled at 100%.

On the http://www.zoneminder.com/wiki/index.ph ... my_disk.3F page of your wiki I read that there is a way to configure the percentage full to be reached to let the filter to automatically executed, but I didn't found this feature.

I am using the latest 1.23.0 version of ZoneMinder.

Could you help me, please?

Thank you very much in advance!
Bye.
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

Post by decibel83 »

I forgot to tell you that I didn't see any error messages in the zmfilter.log file, only repeatedly these messages:

Code: Select all

01/16/08 00:15:23.997191 zmfilter[23848].DBG [Reloading filters]
01/16/08 00:15:23.997963 zmfilter[23848].DBG [Found filter 'PurgeWhenFull']
01/16/08 00:25:24.584834 zmfilter[24761].INF [Scanning for events]
01/16/08 00:25:29.627910 zmfilter[24761].DBG [Reloading filters]
01/16/08 00:25:29.628620 zmfilter[24761].DBG [Found filter 'PurgeWhenFull']
01/16/08 00:35:29.700633 zmfilter[25880].INF [Scanning for events]
01/16/08 00:35:34.716780 zmfilter[25880].DBG [Reloading filters]
01/16/08 00:35:34.717190 zmfilter[25880].DBG [Found filter 'PurgeWhenFull']
Bye!
electron
Posts: 37
Joined: Fri Aug 19, 2005 6:43 am

Post by electron »

You are misssing the small plus & minus symbols to click on to add or delete terms from the filter, they are supposed to appear in the upper right corner of the box, so you have a way to add a term, the default filter comes up with only 1 term & no + or - symbols. I didn't repeat the process enough to document exactly what I did to get the plus & minus symbols to appear, but once they appear, they will stay there. I haven't seen this behavior in prevease releases either. I think all I did was kept messing with saving & changing the "sort by" drop down to different options, then eventually the + - signs appear & you can add a second term to the filter, which you always choose archive status & set to unarchived only, then the other filter you want is Disk percent is greater than. I suggest set it at 50 % or less til you know all is well, then set it at 90 or whatever. Try setting it to archive status first, then save it, then see if they appear.
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

Post by decibel83 »

electron wrote:You are misssing the small plus & minus symbols to click on to add or delete terms from the filter, they are supposed to appear in the upper right corner of the box, so you have a way to add a term, the default filter comes up with only 1 term & no + or - symbols.
I'm sorry, but I don't have the plus and minus small symbols on that page.
I attach a screenshot for your reference:
Image

Thank you very much!
Bye.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Run this query from the command line. Copy the ouput here.

mysql zm
select * from Filters where Name="PurgeWhenFull"
exit
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

Post by decibel83 »

These are the values in the columns of the record.

Name: PurgeWhenFull
Query: a:3:{s:10:"sort_field";s:8:"DateTime";s:8:"sort_asc";s:1:"1";s:5:"limit";s:3:"200";}
AutoArchive: 0
AutoVideo: 0
AutoUpload: 0
AutoEmail: 0
AutoMessage: 0
AutoExecute: 0
AutoExecuteCmd:
AutoDelete: 1
Background: 1
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Query should be:

Code: Select all

trms=2&obr1=&cbr1=&attr1=Archived&op1==&val1=0&cnj2=and&obr2=&cbr2=&attr2=DiskPercent&op2=>=&val2=95&sort_field=Id&sort_asc=1&limit=5
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

Post by decibel83 »

I changed the value of the "query" item in the database for the "PurgeWhenFull" filter, but nothing changed.
I don't any new items in the filter configuration window for the "PurgeWhenFull" filter.

I realized that if I don't choose the "PurgeWhenFull" filter I see many other values for the filter's configuration, for example "Archive status", "Disk percent", "Disk blocks", "System load", etc.

How I can solve? Simply deleting the existing "PurgeWhenFull" filter and recreating?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

it look slike you havnt edited the purge when full filter, you need to set the disk % you want it to start working at. As you havnt it wont function as it has nothing to filter.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

Post by decibel83 »

Sorry, I didn't understand how to configure the filter.
I with the filter to activate itself when the hard disk reaches the 90% and to delete the oldest 200 or 300 events.
I tried to configure the filter but I deleted all the events.

Could you help me please?

Thank you very much again!!
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

thats the way just ensure you have set it to greater than 90% not less than
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

Post by decibel83 »

Could you check the configuration, please?
I'm not sure I setted up it correctly...

Image

Thank you very much again!!
Bye.
electron
Posts: 37
Joined: Fri Aug 19, 2005 6:43 am

Post by electron »

Click the plus sign under Chiudi in upper right corner of screen, add another term to sort by, you need these 2 for a purge when full filter to work, Archive Status, set to Unarchived only, and Disk Percent, set to 50 %. Set the limit to first 5, 10 or 15 results only, should be enough, you have it set way to high. If it works it will keep your disk at about 50 % full within a few percent, then when you see it working at 50 %, set it to higher percent, up to about 90 % is OK for most, I think.
MILxDOT
Posts: 64
Joined: Wed Mar 29, 2006 5:12 am

Post by MILxDOT »

I noticed that on my new ZM builds the default PurgeWhenFull filter doesn't give me the ability to choose the disk percent option either. I have to delete the default xPurgeWhenFull and then create a new PurgeWhenFull then life is good. Is this by design for some reason? Would it make more sense to ship ZM with a working PurgeWhenFull with a disk percent filter at 90 and 100 events setting? Might make it easier for people who are new to ZM.
Kushnirenko
Posts: 17
Joined: Mon Jun 25, 2007 6:29 pm

Fix in new xPurgeWhenFull filter definition

Post by Kushnirenko »

There is now serialize - unserialize module in use. And I think we have to change:
cordel wrote:Query should be:

Code: Select all

trms=2&obr1=&cbr1=&attr1=Archived&op1==&val1=0&cnj2=and&obr2=&cbr2=&attr2=DiskPercent&op2=>=&val2=95&sort_field=Id&sort_asc=1&limit=5
to

Code: Select all

a:4:{s:5:"terms";a:2:{i:0;a:3:{s:4:"attr";s:8:"Archived";s:2:"op";s:1:"=";s:3:"val";s:1:"0";}i:1;a:4:{s:3:"cnj";s:3:"and";s:4:"attr";s:11:"DiskPercent";s:2:"op";s:2:">=";s:3:"val";s:2:"95";}}s:10:"sort_field";s:8:"DateTime";s:8:"sort_asc";s:1:"1";s:5:"limit";s:1:"5";}
Change should go into upgrade scripts and zm_create.sql

Code: Select all

diff -urNad ZoneMinder-1.23.1~/db/zm_create.sql.in ZoneMinder-1.23.1/db/zm_create.sql.in
--- ZoneMinder-1.23.1~/db/zm_create.sql.in    2008-01-13 21:17:59.000000000 +0300
+++ ZoneMinder-1.23.1/db/zm_create.sql.in     2008-02-24 17:06:04.000000000 +0300
@@ -503,7 +503,7 @@
 --
 -- Add a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though
 --
-insert into Filters values ('xPurgeWhenFull','trms=2&obr1=&cbr1=&attr1=Archived&op1==&val1=0&cnj2=and&obr2=&cbr2=&attr2=DiskPercent&op2=>=&val2=95&sort_field=Id&sort_asc=1&limit=5',0,0,0,0,0,0,'',1,0);
+insert into Filters values 'xPurgeWhenFull','a:4:{s:5:"terms";a:2:{i:0;a:3:{s:4:"attr";s:8:"Archived";s:2:"op";s:1:"=";s:3:"val";s:1:"0";}i:1;a:4:{s:3:"cnj";s:3:"and";s:4:"attr";s:11:"DiskPercent";s:2:"op";s:2:">=";s:3:"val";s:2:"95";}}s:10:"sort_field";s:8:"DateTime";s:8:"sort_asc";s:1:"1";s:5:"limit";s:1:"5";}',0,0,0,0,0,0,'',1,0);
[/code]
Last edited by Kushnirenko on Mon Feb 25, 2008 10:48 am, edited 1 time in total.
Locked