Replay doesn't work with ZM_DIR_EVENTS=/mnt/hda2/events

Support and queries relating to all previous versions of ZoneMinder
Locked
A.Ottburg
Posts: 10
Joined: Fri Oct 29, 2004 1:17 pm
Location: Germany

Replay doesn't work with ZM_DIR_EVENTS=/mnt/hda2/events

Post by A.Ottburg »

Hi Phil,
Hi ZM users,

1.) I finished my cam-installation and the program is running fine, but when I change ZM_DIR_EVENTS (for ex.: /mnt/hda2/events) to store the events on another partition on my computer, the event-replay function does not work anymore.

This behavior is 100% reproducable. I tried out vfat and ext3 partition mode with the same behavior.

2.) If I change that option (ZM_DIR_EVENTS) I have to restart zm (what is clear), but in the console window I still see the disk usage of the previous setting (events that means disk usage on /dev/hda7 for my installation). I have to restart the Bowser to see the disk space of the actual setting.

3.) when starting zm the first time after rebooting I realize a red source

/dev/video0(1) and
/dev/video1(1)

in the console window. I have to restart zm to get video functional (amber or green). Any suggestions?

Best regards

Andreas Ottburg

P.S.:

SUSE 9.1
APACHE2 2.0.49
Kernel 2.6.5-111 (SUSE) and 2.6.9
dfaulkner
Posts: 14
Joined: Sun Jun 11, 2006 11:27 pm
Location: Fayetteville, AR
Contact:

Re: Replay doesn't work with ZM_DIR_EVENTS=/mnt/hda2/events

Post by dfaulkner »

[quote="A.Ottburg"]
1.) I finished my cam-installation and the program is running fine, but when I change ZM_DIR_EVENTS (for ex.: /mnt/hda2/events) to store the events on another partition on my computer, the event-replay function does not work anymore.
/quote]

I'm trying to do the same thing, so I did some poking about in the source. In zm_xhtml_view_event.php (and similarly in other locations):

Code: Select all

$event_path = ZM_DIR_EVENTS.'/'.$event['MonitorName'].'/'.$event['Id'];
It appears that ZM_DIR_EVENTS is used not just as the filesystem path to events, but also as the web-relative path to events. This doesn't work if you move the event directory out of the web root, which is a common need.

I expect that the easiest solution is to leave the variables alone (ZM_DIR_EVENTS=events) and symlink from your large drive into the web root :

Code: Select all

$ ln -s /mnt/hda2/events /var/www/html/events
I did change ZM_PATH_SOCKS and ZM_PATH_LOCKS, though, since I don't want that data in /tmp.

Here's what I did. I mounted my disk on /video, so:

Code: Select all

bash# cd /var/www/html
bash# cp -a {events,images,sounds} /video
bash# mv events orig-events # (etc.)
bash# ln -s /video/events . # (etc.)
This seems to be working for me.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Thanks for that and for resurecting an old one!
I am about to embark on a test project using ISCSI and MDADM and LVM to see if the theory works. Using this approch will make it easier for me so thanks
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
dfaulkner
Posts: 14
Joined: Sun Jun 11, 2006 11:27 pm
Location: Fayetteville, AR
Contact:

Post by dfaulkner »

jameswilson wrote:I am about to embark on a test project using ISCSI and MDADM and LVM to see if the theory works.
I'm not using LVM, but I am using software RAID1. My /video filesystem is md3 or something. I'm sure that LVM would work just fine in this case too, but I dropped it to save overhead since I don't plan on expanding beyond the system case.

Good luck with iSCSI. Let us know how it goes.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

will do
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
vivi
Posts: 1
Joined: Fri Feb 06, 2009 11:44 am

Re: Replay doesn't work with ZM_DIR_EVENTS=/mnt/hda2/events

Post by vivi »

A.Ottburg wrote:Hi Phil,
2.) If I change that option (ZM_DIR_EVENTS) I have to restart zm (what is clear), but in the console window I still see the disk usage of the previous setting (events that means disk usage on /dev/hda7 for my installation). I have to restart the Bowser to see the disk space of the actual setting.
As for me, you have to change 2 lines in zm_funcs.php only.

Find getDiskPercent() and getDiskBlocks() functions and change the line:

Code: Select all

$df = shell_exec ( 'df '.ZM_DIR_EVENTS );
with something like

Code: Select all

$df = shell_exec ( 'df /mnt/hdd/' );
where /mnt/hdd/ is a path to yours new events storage place
Locked