Is there an explanation of the filter conditions?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
cybersteel8
Posts: 7
Joined: Tue Nov 28, 2017 2:12 am

Is there an explanation of the filter conditions?

Post by cybersteel8 »

I am setting up some filters, and I believe there is no documentation regarding how to use many of the non-obvious conditions.

For example, "Disk Space". This is the one I want to use - my use case is that I have a 6TB hard disk, but I only want Zoneminder to occupy 1TB of it. So, I would like something along the lines of "If total event size is greater than or equal to 1TB". I used to use Disk Percentage, but Zoneminder reports the disk percentage of the entire disk, which is not a valid metric for this use case when I have other data in the rest of the 5TB.

However, Zoneminder does have the ability to aggregate the disk capacity used for all the events on a particular storage target, so this is the value I would like to leverage when writing my filter. On the Zoneminder Console, when I hover over the storage target percentage at the top of the screen, I see "x used by events" - this value is what I want my filter to look at, and run a purge if it exceeds 1TB.

Is this possible? Furthermore, this question comes from the very fact that there is zero documentation on the filter conditions, how they work and what are valid values to compare against. "Disk Space" is vague and I don't know if I have to write the value in human-readable way, or entirely in bytes, nor do I know if it represents the capacity of a disk, used space or free space.

Image
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Is there an explanation of the filter conditions?

Post by burger »

cybersteel8 wrote: Thu Nov 05, 2020 5:07 am I am setting up some filters, and I believe there is no documentation regarding how to use many of the non-obvious conditions.

For example, "Disk Space". This is the one I want to use - my use case is that I have a 6TB hard disk, but I only want Zoneminder to occupy 1TB of it. So, I would like something along the lines of "If total event size is greater than or equal to 1TB". I used to use Disk Percentage, but Zoneminder reports the disk percentage of the entire disk, which is not a valid metric for this use case when I have other data in the rest of the 5TB.
Make a 1TB partition: Problem solved. I've tried to put some example filters in https://wiki.zoneminder.com/Filters , but I can see there are only two at the moment. Make sure if you are doing purgewhenfull that you follow the instructions for additional HDDs here: https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Is there an explanation of the filter conditions?

Post by iconnor »

DiskSpace is the space taken up by a single event. Not the total. I've done some work to implement what you want but it is not finished.
There is DiskPercent which you could set to 17%.
There is DiskBlocks which you would have to figure out the value for.
cybersteel8
Posts: 7
Joined: Tue Nov 28, 2017 2:12 am

Re: Is there an explanation of the filter conditions?

Post by cybersteel8 »

burger wrote: Thu Nov 05, 2020 4:16 pm Make a 1TB partition: Problem solved. I've tried to put some example filters in https://wiki.zoneminder.com/Filters , but I can see there are only two at the moment. Make sure if you are doing purgewhenfull that you follow the instructions for additional HDDs here: https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive
My Zoneminder disk is a BTRFS subvolume - subvolumes are not registered as partitions in the system. I have configured a qgroup with a max capacity of that subvolume to 1TB, since other subvolumes are on this disk and require space too. I could in theory remove my quota limitation but that is not the problem here.

The issue is that the space taken up by Zoneminder events, while known by Zoneminder (you can see this on the Console screen when you hover over the percentage), is not a usable metric for a filter condition.
cybersteel8
Posts: 7
Joined: Tue Nov 28, 2017 2:12 am

Re: Is there an explanation of the filter conditions?

Post by cybersteel8 »

iconnor wrote: Thu Nov 05, 2020 5:50 pm DiskSpace is the space taken up by a single event. Not the total. I've done some work to implement what you want but it is not finished.
There is DiskPercent which you could set to 17%.
There is DiskBlocks which you would have to figure out the value for.
Thank you for working on this, I appreciate your attention! :D

I did try using Disk Percent, but it only works when there is no other data on the disk, because this value reports the entire data used on the disk. I plan on having other data on this disk, but I still have room in my 1TB allocation for more events, so events would get prematurely purged when the percentage goes up.

I would love more information to be documented about what valid values and units are used in the conditions when defining a filter condition. Is this accessible anywhere I haven't looked?
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Is there an explanation of the filter conditions?

Post by burger »

In the source code.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
Bluemax
Posts: 121
Joined: Wed Jun 12, 2019 5:15 pm

Re: Is there an explanation of the filter conditions?

Post by Bluemax »

That's Interesting as i planned to use something else than ext4 as well in the future.
Is there really no unified high-level free-space value on Linux that covers all filesystems? The necessity of an "application-level based block calculation algorithm" wouldn't let Linux shine all to bright in the place of modern operating systems.
Post Reply