ZM SQL file is a Whopping 44 GB!!!

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
scooty
Posts: 21
Joined: Thu May 28, 2020 8:35 am

ZM SQL file is a Whopping 44 GB!!!

Post by scooty »

Hi all,

My Ubuntu server stopped working as the HDD filled up. In fixing this I found that a main offender was Zoneminder's SQL file at: /var/lib/mysql/zm , but also the syslogs were huge.

Code: Select all

/var/lib/mysql$ sudo du
45249176	./zm
4016	./mysql
600	./sys
8	./performance_schema
Please can someone help me sort this out? Can the SQL database file be emptied/reset? I'm not fussed about keeping historic logs or capture info before today, will be happy to clear the lot if it helps, and if someone can help me do it.

I have issues with the recorded events, with images form yesterday being presented as part of today... I can't trust the times it says things happened. The summary does not present any captures from the last hour (all cameras show 0 in the hour column), even when I have been and jumped up and down in front of a camera. It's pot luck if I can find the event in the Day/Week/Month records too. The sever date/time is correct, but somehow ZM thinks captures are form a previous occasion in the past when they are not. Ie: could this be related to the SQL issue?

Cheers, Scott
Last edited by scooty on Fri Sep 13, 2024 12:50 pm, edited 1 time in total.
scooty
Posts: 21
Joined: Thu May 28, 2020 8:35 am

Re: ZM SQL file is a Whopping 44 GB!!!

Post by scooty »

Getting a lot of ZM errors in syslog, turns out it was ZM making my syslog files so big too, on top of the size of SQL database:

Example:

$ tail -f /var/log/syslog

Code: Select all

Sep 13 13:47:18 hal zmfilter_2[21476]: WAR [DiskSpace: Event does not exist at /mnt/cctv/4/2024-09-11/1770075:ZoneMinder::Event: AlarmFrames => 3 AvgScore => 6 Cause => Motion EndDateTime => 2024-09-12 14:11:51 Frames => 33 Height => 1920 Id => 1770075 Length => 54649.96 MaxScore => 7 MonitorId => 4 Name => Event-1770075 Notes => Motion: All Orientation => ROTATE_90 SaveJPEGs => 3 Scheme => Medium StartDateTime => 2024-09-11 23:01:01 StateId => 1 StorageId => 2 TotScore => 18 Width => 1080]
Sep 13 13:47:18 hal zmfilter_2[21476]: WAR [DiskSpace: Event does not exist at /mnt/cctv/4/2024-09-11/1770076:ZoneMinder::Event: Cause => Motion EndDateTime => 2024-09-11 23:01:01 Frames => 1 Height => 1920 Id => 1770076 Length => 0.00 MonitorId => 4 Name => Event-1770076 Notes => Motion: All Orientation => ROTATE_90 SaveJPEGs => 3 Scheme => Medium StartDateTime => 2024-09-11 23:01:01 StateId => 1 StorageId => 2 Width => 1080]
Sep 13 13:47:18 hal zmfilter_2[21476]: WAR [DiskSpace: Event does not exist at /mnt/cctv/4/2024-09-11/1770077:ZoneMinder::Event: Cause => Motion EndDateTime => 2024-09-12 14:12:03 Frames => 12 Height => 1920 Id => 1770077 Length => 54662.12 MonitorId => 4 Name => Event-1770077 Notes => Motion: All Orientation => ROTATE_90 SaveJPEGs => 3 Scheme => Medium StartDateTime => 2024-09-11 23:01:01 StateId => 1 StorageId => 2 Width => 1080]
scooty
Posts: 21
Joined: Thu May 28, 2020 8:35 am

Re: ZM SQL file is a Whopping 44 GB!!!

Post by scooty »

So, I set all logging to "none", and still my Ubuntu Sysylog file is outputting lots of ZM info:

Code: Select all

Sep 13 13:58:32 hal zmc_m6[2220]: INF [zmc_m6] [Cars: 804600 - Capturing at 16.05 fps, capturing bandwidth 145914bytes/sec Analysing at 16.05 fps]
Sep 13 13:58:34 hal zmc_m1[2207]: INF [zmc_m1] [Garage Door: 402200 - Capturing at 8.02 fps, capturing bandwidth 66803bytes/sec Analysing at 8.02 fps]
Sep 13 13:58:35 hal zmc_m4[2212]: INF [zmc_m4] [Front Door: 804600 - Capturing at 16.02 fps, capturing bandwidth 402759bytes/sec Analysing at 16.02 fps]
Sep 13 13:58:38 hal zmc_m6[2220]: INF [zmc_m6] [Cars: 804700 - Capturing at 16.05 fps, capturing bandwidth 146699bytes/sec Analysing at 16.05 fps]
Sep 13 13:58:40 hal zmc_m5[56805]: ERR [zmc_m5] [Unable to open input rtsp://192.168.1.55:554/cam/realmonitor?Channel=1&subtype=0?tcp due to: No route to host]
How can I stop ZM logging clogging up my server?
scooty
Posts: 21
Joined: Thu May 28, 2020 8:35 am

Re: ZM SQL file is a Whopping 44 GB!!!

Post by scooty »

Ok,

$ sudo service zoneminder stop
$ sudo service zoneminder start

seems to have made ZM pay attention to the log level settings I just chanegd.

But still my SQL database is massive and needs deleting and starting afresh.
scooty
Posts: 21
Joined: Thu May 28, 2020 8:35 am

Re: ZM SQL file is a Whopping 44 GB!!!

Post by scooty »

Well, ZM captures seem to be slowly sorting themselves out now I ave some space in the HDD.... I now have captures listed in the last hour!

The images are still really odd, I'll write a separate post in a couple of days once I understand what it is and isn't doing.

Still need to reduce the size of the SQL database, 44 GB is ridiculous!

Cheers, Scott
Post Reply