Purge disk when full 50/80/95% ?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
smokinjoe
Posts: 38
Joined: Wed Feb 03, 2021 12:45 am

Purge disk when full 50/80/95% ?

Post by smokinjoe »

Hi All,

I am running the zoneminder plugin 1.34.21 on TrueNAS Core 12.0-U2

Save JPEGs = Frames + Analysis images(if available)

and later I change to "Disabled" should I expect the 310,091 jpg files to get deleted or do I have to manually delete those?

I do have autit enabled, I do NOT have fast deletes turned on and I have 3 datasets linked in Zoneminder under /mnt so that I can slice a portion of the disks for video and if need be make the dataset larger or smaller. This means I depend on the filter "Purge when full" to actually run on my datasets as well as the default storage. I am betting that the "Purge when full" only looks at defaults or is not looking for the .jpg files.

List Matches in the GUI for the filter shows nothing, I think it should show the .jpg files

when I run the command I do not need to sudo in my jail as I am root:
root@zm:/mnt # /usr/local/bin/zmaudit.pl --force
02/18/2021 21:18:43.252548 zmaudit[83674].INF [main:199] [Auditing All Storage Areas]
Deleted 0 log table entries by time
root@zm:/mnt # find . | grep ".jpg" | wc -l
310094
root@zm:/mnt #

I do not know if I need the JPEG files or Analysis frames but for sure I need the purge when full to actually work. What should I try?

This seems like I am using cave man commands : find . -name "*.jpg" -type f -delete

Thanks,
Joe
smokinjoe
Posts: 38
Joined: Wed Feb 03, 2021 12:45 am

Re: Purge disk when full 50/80/95% ?

Post by smokinjoe »

find . -name "*.jpg" -type f -delete

took me from 58% of the volume full to 22%
User avatar
Andyrh
Posts: 245
Joined: Sat Oct 28, 2017 3:55 am

Re: Purge disk when full 50/80/95% ?

Post by Andyrh »

From my experience, the purge when full will delete all of the files for an event when the event gets purged. I was saving it all for a while, when I disabled saving the frames my event count started to rise because the older events were larger than the newer ones.

I have been running ZM for years and have not felt the need to manually delete anything.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
smokinjoe
Posts: 38
Joined: Wed Feb 03, 2021 12:45 am

Re: Purge disk when full 50/80/95% ?

Post by smokinjoe »

Hi Andy,

Well I am trying to NOT use the default location : /var/db/zoneminder/events

Silly me tried to make mount points:
/mnt/door1
/mnt/door2
/mnt/door3

The events do store in the new location and delete when I view an event and pick the "delete" button. I want to use a mount point so I can add and remove space from the mount point for some cameras and have the purge at 95% just do it's thing. Is there a "normal" place where zoneminder really wants me to make these mount points?

should I be making them at :
/var/db/zoneminder/events1
/var/db/zoneminder/events2
/var/db/zoneminder/events3

Thanks,
Joe
User avatar
Andyrh
Posts: 245
Joined: Sat Oct 28, 2017 3:55 am

Re: Purge disk when full 50/80/95% ?

Post by Andyrh »

My events are stored in /zm/store1 , /zm/store2 and /zm/store3 (I do not like typing long paths)
The store directories are mounted volumes.

I left the default location alone. It is /var/cache/zoneminder/events - this might be considered the normal place.

ZM is designed to allow you to write the events to any reasonable place.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
smokinjoe
Posts: 38
Joined: Wed Feb 03, 2021 12:45 am

Re: Purge disk when full 50/80/95% ?

Post by smokinjoe »

Andy,

I am going to rebuild this machine/jail as I had some issue with the volume and at boot have zfs metadata errors. I have no errors with a scrub or status -v but if the boot is unhappy I can re-install in a short time. This install was migrated from a laptop single disk and the laptop disk could have had some issues.

So after tonight we will see if the purge disk when full starts to work.

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

Re: Purge disk when full 50/80/95% ?

Post by burger »

smokinjoe wrote: Tue Feb 23, 2021 12:03 pm Is there a "normal" place where zoneminder really wants me to make these mount points?
See: 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
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Purge disk when full 50/80/95% ?

Post by bbunge »

smokinjoe wrote: Tue Feb 23, 2021 12:03 pm Is there a "normal" place where zoneminder really wants me to make these mount points?
Quick answer - No

However, the "mount points" need to be within the OS file system and have read write permission for www-data (Ubuntu/Debian based systems). For other distros the web server, Apache2, user need to have those permissions.

I have several systems set up with an SSD for the OS and a "spinning rust" hard drive for events. When I set up the OS I set the hard drive to mount in /zmevents and then create another directory /zmevents/events and set this up as storage in Zoneminder. When you add a monitor you must remember to set the storage other than default. I also turn the Purge When Full down to 85% or so as I have had infrequent issues with the purge not working right. But that has not happened in a long time. I also have a 30 day purge to get rid of old events.

Interesting concept to set up event directories for individual monitors. Really is not necessary, though as the events will be placed in sub directories under /zmevents/events in my case. Might also be a maintenance headache...

bb
smokinjoe
Posts: 38
Joined: Wed Feb 03, 2021 12:45 am

Re: Purge disk when full 50/80/95% ?

Post by smokinjoe »

my mount points work fine, I can view and remove events with no issues. The issue is that the purge when full is not getting those other locations. I am wondering if the purge when full ONLY looks at /var/db/zoneminder/events

and not at my other mount points /mnt/doorX to see if they are 95% full
User avatar
Andyrh
Posts: 245
Joined: Sat Oct 28, 2017 3:55 am

Re: Purge disk when full 50/80/95% ?

Post by Andyrh »

Purge when full filters need 3 conditions. The 3rd one that is not there by default is the storage pool to purge.
Took me a bit of time to figure it out.
PurgeWhenFullFilter.JPG
PurgeWhenFullFilter.JPG (51.77 KiB) Viewed 5632 times
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Purge disk when full 50/80/95% ?

Post by burger »

I see three options:
1) the default filter should be edited to include the storage area, so that it's intuitive for new users.
2) it should search all storage areas mounts by default.
3) if a new storage mount is created, then a new purgewhenfull filter is generated for that mount.

It's somewhat of a trap as it is, right now. I'd go with #3. This way you can retain existing functionality and also allow different quotas for each.
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
jperkins
Posts: 50
Joined: Sat Jan 23, 2021 11:08 am

Re: Purge disk when full 50/80/95% ?

Post by jperkins »

Andyrh wrote: Thu Feb 25, 2021 6:59 pm Purge when full filters need 3 conditions. The 3rd one that is not there by default is the storage pool to purge.
Took me a bit of time to figure it out.

PurgeWhenFullFilter.JPG
yes. this is what worked for me as I have my storage on a separate (virtual ) hard drive
smokinjoe
Posts: 38
Joined: Wed Feb 03, 2021 12:45 am

Re: Purge disk when full 50/80/95% ?

Post by smokinjoe »

Yes Andy that did it, not very intuitiave and I assume it is documented that purge when full does not work unless you point to a storage location.
dougmccrary
Posts: 1210
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Purge disk when full 50/80/95% ?

Post by dougmccrary »

I find that the default filter defaults to "default" storage.
Screenshot from 2021-07-15 18-55-53.png
Screenshot from 2021-07-15 18-55-53.png (26.66 KiB) Viewed 4567 times
Anywhere else needs:
Screenshot from 2021-07-15 18-56-36.png
Screenshot from 2021-07-15 18-56-36.png (34.6 KiB) Viewed 4567 times
And yet Update DiskSpace appears to operate everywhere, evidenced by this:
Screenshot from 2021-07-15 18-57-55.png
Screenshot from 2021-07-15 18-57-55.png (29.06 KiB) Viewed 4567 times
It's certainly true it's not obvious.
Post Reply