Filter is not working
Filter is not working
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?
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?
-
- Posts: 1373
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Filter is not working
zmfilter.pl -f PurgeWhenFull
Re: Filter is not working
zmfilter.pl -f PurgeWhenFull
In this case, I get return:
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
-
- Posts: 1373
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Filter is not working
Huh. Well this works for me:
sudo zmfilter.pl --filter=PurgeWhenFull
Seems there's a bug with [-f]
sudo zmfilter.pl --filter=PurgeWhenFull
Seems there's a bug with [-f]
Re: Filter is not working
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:
Now I get the output, but how do I understand why the filter is not working?
Here are my filter settings:

For example:
Code: Select all
zmfilter.pl --filter='Update DiskSpace'
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']

-
- Posts: 1373
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Filter is not working
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?
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?
Re: Filter is not working
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.
Yes, there is an option "Delete all matches" checked.
-
- Posts: 1373
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Filter is not working
Does this drive have reserved space? Default is 5%, so maybe the drive is really at 7%.
Re: Filter is not working
Yes, you are right. I reduced the threshold to 5% and the filter worked. Thank you.
-
- Posts: 1373
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Filter is not working

you may want to look into the tune2fs command, especially if hitachi is data only.
Re: Filter is not working
Great! I didn't know about that. It came in handy. Respect.
Set to 0% redundancy because this disk is only used for ZM
Set to 0% redundancy because this disk is only used for ZM
Code: Select all
tune2fs -m 0 /dev/sdb1
-
- Posts: 1373
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego