Hello,
please see screenshot.
I have a 4 TB second drive "ExternalUSB" and want to fill it up to 80% with events.
Currently its about 9766 Events for the 48% used, each Event is about 60 MB in size.
But ZM keeps deleting everything down to 48%.
What is wrong with my filter?
Thank you for your help, I got stuck there.
Please help with Purge filter
Please help with Purge filter
- Attachments
-
- purge.png (43.33 KiB) Viewed 979 times
Re: Please help with Purge filter
"List Matches" gives always an empty List regardless the setting of the "disk Percentage"
"Export Matches" Gives always 100 Results, regardless the setting of the "disk Percentage"
"Debug" and execute the Query in PHPMyAdmin always has 100 Results, because it seems the disk percent is not used in the Query.
Assumption:
The "Disk Percent" is not taken from the "ExtremalUSB" but instead of the "Default" and then used in the Query.
So when Default hits 80%... it keeps deleting from "ExtermalUSB" until the Default is back below 70% (what is Random, because it is only the system drive.
So Question is:
How is "Disk Percent" determined, and from which drive the percent will taken? How To specify "If ExternlUSB > 80%" ?
"Export Matches" Gives always 100 Results, regardless the setting of the "disk Percentage"
"Debug" and execute the Query in PHPMyAdmin always has 100 Results, because it seems the disk percent is not used in the Query.
Assumption:
The "Disk Percent" is not taken from the "ExtremalUSB" but instead of the "Default" and then used in the Query.
So when Default hits 80%... it keeps deleting from "ExtermalUSB" until the Default is back below 70% (what is Random, because it is only the system drive.
So Question is:
How is "Disk Percent" determined, and from which drive the percent will taken? How To specify "If ExternlUSB > 80%" ?
Re: Please help with Purge filter
Found this snippet in Filter.php
case 'DiskPercent':
// Need to specify a storage area, so need to look through other terms looking for a storage area, else we default to ZM_EVENTS_PATH
if ( ! $StorageArea ) {
for ( $j = 0; $j < count($terms); $j++ ) {
if ( isset($terms[$j]['attr']) and $terms[$j]['attr'] == 'StorageId' and isset($terms[$j]['val']) ) {
$StorageArea = new Storage($terms[$j]['val']);
break;
}
} // end foreach remaining term
if ( ! $StorageArea ) $StorageArea = new Storage();
} // end no StorageArea found yet
$sqlValue = getDiskPercent($StorageArea);
break;
But I can not find a similar logig in .pl files used in "zmfilter.pl". Seems this is only implemented in the preview in PHP and not in the actual Filter execution cronjob?
case 'DiskPercent':
// Need to specify a storage area, so need to look through other terms looking for a storage area, else we default to ZM_EVENTS_PATH
if ( ! $StorageArea ) {
for ( $j = 0; $j < count($terms); $j++ ) {
if ( isset($terms[$j]['attr']) and $terms[$j]['attr'] == 'StorageId' and isset($terms[$j]['val']) ) {
$StorageArea = new Storage($terms[$j]['val']);
break;
}
} // end foreach remaining term
if ( ! $StorageArea ) $StorageArea = new Storage();
} // end no StorageArea found yet
$sqlValue = getDiskPercent($StorageArea);
break;
But I can not find a similar logig in .pl files used in "zmfilter.pl". Seems this is only implemented in the preview in PHP and not in the actual Filter execution cronjob?
-
- Posts: 1314
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Please help with Purge filter
What size does zm show in the options page for USB disk?
You're right, list matches doesn't work for purge filters.
What happens if you set the filter to 90?
What does your default filter look like? It must specify default.
You're right, list matches doesn't work for purge filters.
What happens if you set the filter to 90?
What does your default filter look like? It must specify default.
Re: Please help with Purge filter
Thank you for reading my issue.
>What size does zm show in the options page for USB disk?
2 ExternalUSB /var/usbplatte1/zoneminder local Medium 1.73TB of 3.58TB 9825 using 0.92TB
>What happens if you set the filter to 90?
I can try it, but it will take a few month to see the result.
>What does your default filter look like? It must specify default.
There is no other filer.
I have the default "Update DiskSpace" and changed the default "Purge when Full" to this new drive.
Only those two are there.
Re: Please help with Purge filter
Idea/Qustion:
Do I need to build a "Update DiskSpace" Filter also for each drive in order to work properly? Currently the "Update DiskSpace" is wihtout disk name. Is it then updating all or only default?
Do I need to build a "Update DiskSpace" Filter also for each drive in order to work properly? Currently the "Update DiskSpace" is wihtout disk name. Is it then updating all or only default?
-
- Posts: 1314
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Please help with Purge filter
Probably.
I have a purge filter and diskspace filter for each drive. Seems to be required, and I think is consistent with that code you found.
Your disk in Storage looks OK.
I have a purge filter and diskspace filter for each drive. Seems to be required, and I think is consistent with that code you found.
Your disk in Storage looks OK.
Re: Please help with Purge filter
You should not need a storage specification for update disk space. It cares not about the storage area.
-
- Posts: 1314
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Please help with Purge filter
And so it is. Just verified that one disk space filter does both my drives.