Hi All,
ZM 1.30.4, Ubuntu Server 14.04 LTS (204 days uptime
Event storage to FreeNAS via NFS. Accessed over very slow DSL.
I'm doing a continuous record on a PTZ camera on "patrol". (1920x1080x10fps)
When I go to export a given 10min event (event details, frame details, image files) the export popup just does the travelling export thing (Exporting.......) but export never completes and nothing downloads.
It's working as expected on a local ZM server (zm 1.30.4, Ubuntu Server 16.04.3 LTS, local storage.
There are a number of things that could be causing it to fail/not complete; storage differences, local net vs vpn over dsl, version of server OS.
So I thought I'd ask the guru's if there was a command line or series of steps I could do on the console of the ZM server to step through and export and see what's going on.
BTW, I don't want video, I prefer the individual frames for forensic use; good on you all for making video record optional; it has it's place, but you can't beat the individual frames for clarity!
Thanks
Command Line Event Export
Re: Command Line Event Export
After reading my post, I thought I'd add some clarification... The DSL connection is a management connection, not the connection to the FreeNAS.
Is this one of those things where if I could read the code it would be obvious?
Thanks again
Is this one of those things where if I could read the code it would be obvious?
Thanks again
-
- Posts: 17
- Joined: Mon Sep 04, 2017 12:47 am
Re: Command Line Event Export
I just worked with the export code some. I know a little, certainly no guru.
The export window sends an ajax call that triggers /usr/share/zoneminder/www/skins/classic/includes/export_functions.php for the heavy lifting. For detail and image files it both generates some html to view later and packages up all the jpgs. I'd suspect either the storage path is breaking or it's actually timing out. I don't believe the ajax returns a timeout error. Check your apache error logs for php timeout.
When it's generating the archive it uses /tmp/zm/zmExport.zip or .tar.gz and /tmp/zm/zmFileList.txt
You might check that file list while it says it's generating the archive and see if the paths are sane.
The export window sends an ajax call that triggers /usr/share/zoneminder/www/skins/classic/includes/export_functions.php for the heavy lifting. For detail and image files it both generates some html to view later and packages up all the jpgs. I'd suspect either the storage path is breaking or it's actually timing out. I don't believe the ajax returns a timeout error. Check your apache error logs for php timeout.
When it's generating the archive it uses /tmp/zm/zmExport.zip or .tar.gz and /tmp/zm/zmFileList.txt
You might check that file list while it says it's generating the archive and see if the paths are sane.
Re: Command Line Event Export
there are various small details that can cause this to happen. check the time on the mysql server and that it matches the machine time and php time...in sync so to say...the other cause is the permissions are not correct and/or the /var/cache/zoneminder/temp folder is missing.
-
- Posts: 17
- Joined: Mon Sep 04, 2017 12:47 am
Re: Command Line Event Export
Huh. 1.30.4 is different. rockedge is right /var/cache/zoneminder/temp is the correct directory, not /tmp/zm.
Re: Command Line Event Export
Thanks for the help. --Solved-- Further questions.
Checked the time, we're good there.
Ya, it was the temp directory. I went the lazy route and only made one mount point to the NFS store at ...../zoneminder
I didn't re-make the temp directory
Recreated the /var/cache/zoneminder/temp and applied www-data:www-data ownership and bam export starts creating .gz file as expected.
So the question is (because this where I don't know all the pieces to the puzzle) can I run the php script from the command line and pipe the out put to some kind of curl, or http get type command, to handle the auto http download that starts?
What would that php command line look like?
and/or
Is there a parameter that can be passed to the export script to not start the http download?
(Then I'd just pull the file from the temp directory)
Checked the time, we're good there.
Ya, it was the temp directory. I went the lazy route and only made one mount point to the NFS store at ...../zoneminder
I didn't re-make the temp directory
Recreated the /var/cache/zoneminder/temp and applied www-data:www-data ownership and bam export starts creating .gz file as expected.
So the question is (because this where I don't know all the pieces to the puzzle) can I run the php script from the command line and pipe the out put to some kind of curl, or http get type command, to handle the auto http download that starts?
What would that php command line look like?
and/or
Is there a parameter that can be passed to the export script to not start the http download?
(Then I'd just pull the file from the temp directory)
-
- Posts: 17
- Joined: Mon Sep 04, 2017 12:47 am
Re: Command Line Event Export
In /usr/share/zoneminder/www/skins/classic/views/js/export.js you could comment out the line at the end of the file that says
You can still click on the download link if you need to. As far as I can see it doesn't break anything. Future updates would revert this of course.
Code: Select all
if ( exportReady ) {
startDownload.pass( exportFile ).delay( 1500 );
}
Code: Select all
if ( exportReady ) {
// startDownload.pass( exportFile ).delay( 1500 );
}
Re: Command Line Event Export
remember the directory structure looks like :
/var/cache/zoneminder
/var/cache/zoneminder/events
/var/cache/zoneminder/images
/var/cache/zoneminder/temp
the code modification digital-gnome has shown seems to be the most solid simple solution.
/var/cache/zoneminder
/var/cache/zoneminder/events
/var/cache/zoneminder/images
/var/cache/zoneminder/temp
the code modification digital-gnome has shown seems to be the most solid simple solution.
Re: Command Line Event Export
Testing on a smaller event.
With the code commented, apache2 restarted, zoneminder restarted, the download still starts.
sudo nano /usr/share/zoneminder/www/skins/classic/views/js/export.js
Any thoughts?
With the code commented, apache2 restarted, zoneminder restarted, the download still starts.
sudo nano /usr/share/zoneminder/www/skins/classic/views/js/export.js
Code: Select all
function initPage()
{
configureExportButton( $('exportButton') );
if ( exportReady )
{
// startDownload.pass( exportFile ).delay( 1500 );
}
}