Page 1 of 2
PurgeWhenFull doesn't work
Posted: Tue Jan 15, 2008 11:34 pm
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.
Posted: Tue Jan 15, 2008 11:44 pm
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!
Posted: Wed Jan 16, 2008 2:20 am
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.
Posted: Wed Jan 16, 2008 1:30 pm
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:
Thank you very much!
Bye.
Posted: Thu Jan 17, 2008 12:45 am
by cordel
Run this query from the command line. Copy the ouput here.
mysql zm
select * from Filters where Name="PurgeWhenFull"
exit
Posted: Thu Jan 17, 2008 1:22 am
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
Posted: Thu Jan 17, 2008 1:31 am
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
Posted: Fri Jan 18, 2008 9:12 pm
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?
Posted: Fri Jan 18, 2008 11:27 pm
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.
Posted: Sat Jan 19, 2008 2:37 am
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!!
Posted: Sat Jan 19, 2008 12:10 pm
by jameswilson
thats the way just ensure you have set it to greater than 90% not less than
Posted: Sat Jan 19, 2008 1:19 pm
by decibel83
Could you check the configuration, please?
I'm not sure I setted up it correctly...
Thank you very much again!!
Bye.
Posted: Sun Jan 20, 2008 9:50 pm
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.
Posted: Thu Jan 24, 2008 4:08 pm
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.
Fix in new xPurgeWhenFull filter definition
Posted: Sat Feb 23, 2008 8:59 pm
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]