Filter is not working

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Andrey_bk
Posts: 7
Joined: Sun Jan 19, 2025 5:51 pm

Filter is not working

Post by Andrey_bk »

Run sudo zmfilter.pl -f <yourfiltername> from command line
zmfilter.pl -f <PurgeWhenFull>

The command line returns:
-bash: syntax error near unexpected token «newline»

Where can I find out more about why the filter doesn't work?
dougmccrary
Posts: 1373
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Filter is not working

Post by dougmccrary »

zmfilter.pl -f PurgeWhenFull
Andrey_bk
Posts: 7
Joined: Sun Jan 19, 2025 5:51 pm

Re: Filter is not working

Post by Andrey_bk »

zmfilter.pl -f PurgeWhenFull
In this case, I get return:

Code: Select all

Option f is ambiguous (filter, filter_id)
Usage:
    zmfilter.pl [-f <filter name>,--filter=<filter name>]
    [--filter_id=<filter id>] | -v, --version

Options:
    -f{filter name}, --filter={filter name} - The name of a specific filter
    to run --filter_id={filter id} - The id of a specific filter to run -v,
    --version - Print ZoneMinder version
dougmccrary
Posts: 1373
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Filter is not working

Post by dougmccrary »

Huh. Well this works for me:
sudo zmfilter.pl --filter=PurgeWhenFull

Seems there's a bug with [-f]
Andrey_bk
Posts: 7
Joined: Sun Jan 19, 2025 5:51 pm

Re: Filter is not working

Post by Andrey_bk »

Yes, thank you, it works. I also noticed that if there is a space in the filter name, it should be enclosed in single quotes ''.
For example:

Code: Select all

zmfilter.pl --filter='Update DiskSpace'
Now I get the output, but how do I understand why the filter is not working?

Code: Select all

root@DATASERVER:~# zmfilter.pl --filter=PurgeWhenFull-HDD-Hitachi
21.01.2025 10:34:25.247713 zmfilter[10377].INF [main:181] [Scanning for events using filter 'PurgeWhenFull-HDD-Hitachi']
Here are my filter settings:
Image
dougmccrary
Posts: 1373
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Filter is not working

Post by dougmccrary »

That looks good, assuming you've got "Delete all matches" checked.

I take it you've set disk percent at 10 for testing purposes?

You might not notice it working on a single pass - maybe try setting "Limit to first" at 1000 instead of 100?
Andrey_bk
Posts: 7
Joined: Sun Jan 19, 2025 5:51 pm

Re: Filter is not working

Post by Andrey_bk »

Yes, I set it to 10% for testing. The disk is 12% full and there are 288 events in the database. I expect 100 events to be deleted but it doesn't. And even if I run the filter manually from the terminal, nothing happens.
Yes, there is an option "Delete all matches" checked.
dougmccrary
Posts: 1373
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Filter is not working

Post by dougmccrary »

Does this drive have reserved space? Default is 5%, so maybe the drive is really at 7%.
Andrey_bk
Posts: 7
Joined: Sun Jan 19, 2025 5:51 pm

Re: Filter is not working

Post by Andrey_bk »

Yes, you are right. I reduced the threshold to 5% and the filter worked. Thank you.
dougmccrary
Posts: 1373
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Filter is not working

Post by dougmccrary »

:D
you may want to look into the tune2fs command, especially if hitachi is data only.
Andrey_bk
Posts: 7
Joined: Sun Jan 19, 2025 5:51 pm

Re: Filter is not working

Post by Andrey_bk »

Great! I didn't know about that. It came in handy. Respect.
Set to 0% redundancy because this disk is only used for ZM

Code: Select all

tune2fs -m 0 /dev/sdb1
dougmccrary
Posts: 1373
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Filter is not working

Post by dougmccrary »

😎
Post Reply