Compare commits
7 Commits
1.36.12_he
...
release-1.
Author | SHA1 | Date |
---|---|---|
Isaac Connor | def9134c02 | |
Isaac Connor | 0130df5df9 | |
Isaac Connor | 1fb9c57096 | |
Isaac Connor | bc0d35f6d7 | |
Isaac Connor | bb6c045a18 | |
Isaac Connor | e87033aff9 | |
Isaac Connor | 0d7fe79b27 |
38
docs/faq.rst
38
docs/faq.rst
|
@ -11,18 +11,21 @@ How can I stop ZoneMinder filling up my disk?
|
|||
---------------------------------------------
|
||||
|
||||
Recent versions of ZoneMinder come with a filter you can use for this purpose already included.
|
||||
The filter is called **PurgeWhenFull** and to find it, choose one of the event counts from the console page, for instance events in the last hour, for one of your monitors. **Note** that this filter is automatically enabled if you do a fresh install of ZoneMinder including creating a new database. If you already have an existing database and are upgrading ZoneMinder, it will retain the settings of the filter (which in earlier releases was disabled by default). So you may want to check if PurgeWhenFull is enabled and if not, enable it.
|
||||
The filter is called **PurgeWhenFull** and to find it, click on the word **Filters** in the header.
|
||||
**Note** that this filter is automatically enabled if you do a fresh install of ZoneMinder including creating a new database. If you already have an existing database and are upgrading ZoneMinder, it will retain the settings of the filter (which in earlier releases was disabled by default). So you may want to check if PurgeWhenFull is enabled and if not, enable it.
|
||||
|
||||
To enable it, go to Web Console, click on any of your Events of any of your monitors.
|
||||
This will bring up an event listing and a filter window.
|
||||
To enable it, go to Web Console, click on the word **Filters** in the UI header.
|
||||
|
||||
In the filter window there is a drop down select box labeled 'Use Filter', that lets your select a saved filter. Select 'PurgeWhenFull' and it will load that filter.
|
||||
In the filter window there is a drop down select box labeled 'Use Filter', that lets you select a saved filter. Select 'PurgeWhenFull' and it will load that filter.
|
||||
|
||||
Make any modifications you might want, such as the percentage full you want it to kick in, or how many events to delete at a time (it will repeat the filter as many times as needed to clear the space, but will only delete this many events each time to get there).
|
||||
|
||||
Then click on 'Save' which will bring up a new window. Make sure the 'Automatically delete' box is checked and press save to save your filter. This will then run in the background to keep your disk within those limits.
|
||||
Ensure that the Run filter in background checkbox is checked.
|
||||
Ensure that the Delete all matches checkbox is checked.
|
||||
|
||||
After you've done that, you changes will automatically be loaded into zmfilter within a few minutes.
|
||||
Then click on 'Save'. The filter will immediately begin executing in the background to keep your disk within those limits.
|
||||
|
||||
Please note that that this filter will only affect the default storage location. If you have added other storage areas, you must create a PurgeWhenFull filter for each one, and specify the Storage Area as one of the parameters in the filter. You can duplicate the existing PurgeWhenFull filter by using Save As instead of Save.
|
||||
|
||||
Check the ``zmfilter.log`` file to make sure it is running as sometimes missing perl modules mean that it never runs but people don't always realize.
|
||||
|
||||
|
@ -46,7 +49,7 @@ Normally an event created as the result of an alarm consists of entries in one o
|
|||
|
||||
ZM_RUN_AUDIT:
|
||||
|
||||
The zmaudit daemon exists to check that the saved information in the database and on the file system match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronize the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and file system may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.
|
||||
The zmaudit daemon exists to check that the saved information in the database and on the file system match and are consistent with each other. If an error occurs or if you are using 'fast deletes' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronize the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is not recommended for most systems, as zmaudit.pl is very resource intensive.
|
||||
|
||||
ZM_AUDIT_CHECK_INTERVAL:
|
||||
|
||||
|
@ -184,14 +187,27 @@ Once I did this, images started to stream for me.
|
|||
|
||||
Lastly, please look for errors created by the zmc processes. If zmc isn't running, then zms will not be able to get an image from it and will exit.
|
||||
|
||||
I have several monitors configured but when I load the Montage view in FireFox why can I only see two? or, Why don't all my cameras display when I use the Montage view in FireFox?
|
||||
I have several monitors configured but when I load the Montage view why can I only see two? or, Why don't all my cameras display when I use the Montage view?
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
By default FireFox only supports a small number of simultaneous connections. Using the montage view usually requires one persistent connection for each camera plus intermittent connections for other information such as statuses.
|
||||
By default most browsers only support a small number of simultaneous connections to any given server. Using the montage view usually requires one persistent connection for each camera plus intermittent connections for other information such as statuses.
|
||||
|
||||
You will need to increase the number of allowed connections to use the montage view with more than a small number of cameras. Certain FireFox extensions such as FasterFox may also help to achieve the same result.
|
||||
In firefox you can increase the limit, but other browsers are not configurable in this way.
|
||||
|
||||
To resolve this situation, follow the instructions below:
|
||||
A solution for all browsers is something we call multi-port. We reconfigure apache to operate on ports other than the default of 80(http) or 443(https). You need to pick a range, let's say 30000 to 30010 in order to support 10 cameras. We add lines to your zoneminder apache config file as follows:
|
||||
|
||||
Listen 30000
|
||||
Listen 30001
|
||||
Listen 30002
|
||||
Listen 30003
|
||||
etc
|
||||
Listen 30010
|
||||
|
||||
If you are using virtualhosts, you will have to add these to the VirtualHost directive as well.
|
||||
|
||||
Then in ZoneMinder config, Go Options -> Network and set MIN_STREAMING_PORT to 30000. Now when generating urls to stream images from ZoneMinder a port will be appended that is 30000 + MonitorId, so Monitor 1 will stream from 30001 and so on. This will allow Montage to stream from all monitors.
|
||||
|
||||
Alternatively if you are in fact using only Firefox, you can increase the limit as follows:
|
||||
|
||||
Enter ``about:config`` in the address bar
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Filtering Events
|
|||
Filters allow you to define complex conditions with associated actions in ZoneMinder. Examples could include:
|
||||
|
||||
* Send an email each time a new event occurs for a specific monitor
|
||||
* Delete events that are more than 10 days old
|
||||
* Delete events that are more than 10 days old
|
||||
|
||||
And many more.
|
||||
|
||||
|
@ -27,18 +27,16 @@ Here is what the filter window looks like
|
|||
* Archive all matches: sets the archive field to 1 in the Database for the matched events.
|
||||
Think of 'archiving' as grouping them under a special category - you can view archived
|
||||
events later and also make sure archived events don't get deleted, for example
|
||||
|
||||
.. todo ::
|
||||
fill in what update used disk space, copy all matches, move all matches do. For the "create video" filter, put in more details on how it works, any dependencies etc.
|
||||
|
||||
* Update used disk space:
|
||||
* Create video for all matches: creates a video file of all the events that match
|
||||
* Execute command on all matches: Allows you to execute any arbitrary command on the matched events. You can use replacement tokens as subsequent arguents to the command, the last argument will be the absolute path to the event, preceeded by replacement arguents. eg: /usr/bin/script.sh %MN% will excecute as /usr/bin/script.sh MonitorName /path/to/event.
|
||||
* Delete all matches: Deletes all the matched events.
|
||||
* Copy all matches:
|
||||
* Move all matches:
|
||||
* Run filter in background: When checked, ZoneMinder will make sure the filter is checked regularly. For example, if you want to be notified of new events by email, you should make sure this is checked. Filters that are configured to run in the background have a “*” next to it.
|
||||
* Run filter concurrently: Allows this filter to run in its own thread thereby letting other filters run in parallel.
|
||||
* Update used disk space: calculates how much disk space is taken by the event and updates the db record.
|
||||
* Create video for all matches: ffmpeg will be used to create a video file out of all the stored jpgs if using jpeg storage.
|
||||
* Email details of all matches: Sends an email to the configured address with details about the event.
|
||||
The email can be customized as per TBD
|
||||
* Message details of all matches: Uses an email to SMS gateway to send an SMS message for each match.
|
||||
* Execute command on all matches: Allows you to execute any arbitrary command on the matched events. You can use replacement tokens as subsequent arguents to the command, the last argument will be the absolute path to the event, preceeded by replacement arguents. eg: /usr/bin/script.sh %MN% will excecute as /usr/bin/script.sh MonitorName /path/to/event. Please note that urls may contain characters like & that need quoting. So you may need to put quotes around them like /usr/bin/scrupt.sh "%MN%".
|
||||
* Delete all matches: Deletes all the matched events
|
||||
* *E*: Use 'Submit' to 'test' your matching conditions. This will just match and show you what filters match. Use 'Execute' to actually execute the action after matching your conditions. Use 'Save' to save the filter for future use and 'Reset' to clear your settings
|
||||
* Copy all matches: copies the event files to another location, specified in the Copy To dropdown. The other location must be setup in the Storage Tab under options.
|
||||
* Move all matches: copies the event files to another location, specified in the Move To dropdown. The other location must be setup in the Storage Tab under options. The files will be delete from the original location.
|
||||
|
||||
* *F*: Use 'List Matches' to 'test' your matching conditions. This will just match and show you what filters match. Use 'Execute' to actually execute the action after matching your conditions. Use 'Save' to save the filter for future use and 'Reset' to clear your settings
|
||||
|
||||
|
@ -55,61 +53,59 @@ Here is what the filter window looks like
|
|||
|
||||
If you do this then the subsequent dialog will also allow you specify whether you want this filter automatically applied in order to delete events or upload events via ftp to another server and mail notifications of events to one or more email accounts. Emails and messages (essentially small emails intended for mobile phones or pagers) have a format defined in the Options screen, and may include a variety of tokens that can be substituted for various details of the event that caused them. This includes links to the event view or the filter as well as the option of attaching images or videos to the email itself. Be aware that tokens that represent links may require you to log in to access the actual page, and sometimes may function differently when viewed outside of the general ZoneMinder context. The tokens you can use are as follows.
|
||||
|
||||
* %EI% Id of the event
|
||||
* %EN% Name of the event
|
||||
* %EC% Cause of the event
|
||||
* %ED% Event description
|
||||
* %ET% Time of the event
|
||||
* %EL% Length of the event
|
||||
* %EF% Number of frames in the event
|
||||
* %EFA% Number of alarm frames in the event
|
||||
* %EST% Total score of the event
|
||||
* %ESA% Average score of the event
|
||||
* %ESM% Maximum score of the event
|
||||
* %EP% Path to the event
|
||||
* %EPS% Path to the event stream
|
||||
* %EPI% Path to the event images
|
||||
* %EPI1% Path to the first alarmed event image
|
||||
* %EPIM% Path to the (first) event image with the highest score
|
||||
* %EI1% Attach first alarmed event image
|
||||
* %EIM% Attach (first) event image with the highest score
|
||||
* %EV% Attach event mpeg video
|
||||
* %MN% Name of the monitor
|
||||
* %MET% Total number of events for the monitor
|
||||
* %MEH% Number of events for the monitor in the last hour
|
||||
* %MED% Number of events for the monitor in the last day
|
||||
* %MEW% Number of events for the monitor in the last week
|
||||
* %MEM% Number of events for the monitor in the last month
|
||||
* %MEA% Number of archived events for the monitor
|
||||
* %MOD% Path to image containing object detection
|
||||
* %MP% Path to the monitor window
|
||||
* %MPS% Path to the monitor stream
|
||||
* %MPI% Path to the monitor recent image
|
||||
* %FN% Name of the current filter that matched
|
||||
* %FP% Path to the current filter that matched
|
||||
* %ZP% Path to your ZoneMinder console
|
||||
* %EI% Id of the event
|
||||
* %EN% Name of the event
|
||||
* %EC% Cause of the event
|
||||
* %ED% Event description
|
||||
* %ET% Time of the event
|
||||
* %EL% Length of the event
|
||||
* %EF% Number of frames in the event
|
||||
* %EFA% Number of alarm frames in the event
|
||||
* %EST% Total score of the event
|
||||
* %ESA% Average score of the event
|
||||
* %ESM% Maximum score of the event
|
||||
* %EP% Path to the event
|
||||
* %EPS% Path to the event stream
|
||||
* %EPI% Path to the event images
|
||||
* %EPI1% Path to the first alarmed event image
|
||||
* %EPIM% Path to the (first) event image with the highest score
|
||||
* %EI1% Attach first alarmed event image
|
||||
* %EI1A% Attach first alarmed event analysis image
|
||||
* %EIM% Attach (first) event image with the highest score
|
||||
* %EIMA% Attach (first) event analysis image with the highest score
|
||||
* %EIMOD% Attach event image with object detection objects
|
||||
* %EV% Attach event mpeg video
|
||||
* %EVM% Attach event mpeg video in phone format
|
||||
* %MN% Name of the monitor
|
||||
* %MET% Total number of events for the monitor
|
||||
* %MEH% Number of events for the monitor in the last hour
|
||||
* %MED% Number of events for the monitor in the last day
|
||||
* %MEW% Number of events for the monitor in the last week
|
||||
* %MEM% Number of events for the monitor in the last month
|
||||
* %MEA% Number of archived events for the monitor
|
||||
* %MP% Path to the monitor window
|
||||
* %MPS% Path to the monitor stream
|
||||
* %MPI% Path to the monitor recent image
|
||||
* %FN% Name of the current filter that matched
|
||||
* %FP% Path to the current filter that matched
|
||||
* %ZP% Path to your ZoneMinder console
|
||||
|
||||
Finally you can also specify a script which is run on each matched event. This script should be readable and executable by your web server user. It will get run once per event and the relative path to the directory containing the event in question. Normally this will be of the form <MonitorName>/<EventId> so from this path you can derive both the monitor name and event id and perform any action you wish. Note that arbitrary commands are not allowed to be specified in the filter, for security the only thing it may contain is the full path to an executable. What that contains is entirely up to you however.
|
||||
|
||||
Filtering is a powerful mechanism you can use to eliminate events that fit a certain pattern however in many cases modifying the zone settings will better address this. Where it really comes into its own is generally in applying time filters, so for instance events that happen during weekdays or at certain times of the day are highlighted, uploaded or deleted. Additionally using disk related terms in your filters means you can automatically create filters that delete the oldest events when your disk gets full. Be warned however that if you use this strategy then you should limit the returned results to the amount of events you want deleted in each pass until the disk usage is at an acceptable level. If you do not do this then the first pass when the disk usage is high will match, and then delete, all events unless you have used other criteria inside of limits. ZoneMinder ships with a sample filter already installed, though disabled. The PurgeWhenFull filter can be used to delete the oldest events when your disk starts filling up. To use it you should select and load it in the filter interface, modify it to your requirements, and then save it making you sure you check the ‘Delete all matches’ option. This will then run in the background and ensure that your disk does not fill up with events.
|
||||
|
||||
|
||||
Saving filters
|
||||
-----------------
|
||||
|
||||
When saving filters, if you want the filter to run in the background make sure you select the "Run filter in background" option. When checked, ZoneMinder will make sure the filter is checked regularly. For example, if you want to be notified of new events by email, you should make sure this is checked. Filters that are configured to run in the background have a "*" next to it.
|
||||
When saving filters, if you want the filter to run in the background make sure you select the "Run filter in background" option. When checked, ZoneMinder will make sure the filter is checked regularly. For example, if you want to be notified of new events by email, you should make sure this is checked. Filters that are configured to run in the background have a "*" next to it in the dropdown.
|
||||
|
||||
|
||||
How filters actually work
|
||||
--------------------------
|
||||
It is useful to know how filters actually work behind the scenes in ZoneMinder, in the event you find your filter not functioning as intended:
|
||||
|
||||
* the primary filter processing process in ZoneMinder is a perl file called ``zmfilter.pl`` which retrieves filters from the Filters database table
|
||||
* Each filter set to run in the background will be run in it's own process called ``zmfilter.pl`` which retrieves filters from the Filters database table
|
||||
* zmfilter.pl runs every FILTER_EXECUTE_INTERVAL seconds (default is 20s, can be changed in Options->System)
|
||||
* in each run, it goes through all the filters which are marked as "Run in Background" and if the conditions match performs the specified action
|
||||
* zmfilter.pl also reloads all the filters every FILTER_RELOAD_DELAY seconds (default is 300s/5mins, can be changed in Options->System)
|
||||
* So if you have just created a new filter, zmfilter will not see it till the next FILTER_RELOAD_DELAY cycle
|
||||
* This is also important if you are using "relative times" like 'now' - see :ref:`relative_caveat`
|
||||
* after each interval the filter will query the database and apply the action to each matching event.
|
||||
* zmfilter.pl also reloads the filter every FILTER_RELOAD_DELAY seconds (default is 300s/5mins, can be changed in Options->System)
|
||||
* In previous versions of ZoneMinder filter changes would not take immediate effect, but now the web ui will start/stop/restart filters as appropriate upon editing a filter.
|
||||
|
||||
|
||||
Relative items in date strings
|
||||
|
|
|
@ -103,18 +103,17 @@ if ( $command eq 'state' ) {
|
|||
or Fatal("Can't prepare '$sql': ".$dbh->errstr());
|
||||
my $res = $sth->execute($Config{ZM_SERVER_ID} ? $Config{ZM_SERVER_ID}: ())
|
||||
or Fatal("Can't execute: ".$sth->errstr());
|
||||
while( my $monitor = $sth->fetchrow_hashref() ) {
|
||||
while ( my $monitor = $sth->fetchrow_hashref() ) {
|
||||
foreach my $definition ( @{$state->{Definitions}} ) {
|
||||
if ( $monitor->{Id} =~ /^$definition->{Id}$/ ) {
|
||||
$monitor->{NewFunction} = $definition->{Function};
|
||||
$monitor->{NewEnabled} = $definition->{Enabled};
|
||||
last;
|
||||
}
|
||||
}
|
||||
#next if ( !$monitor->{NewFunction} );
|
||||
$monitor->{NewFunction} = 'None'
|
||||
if ( !$monitor->{NewFunction} );
|
||||
$monitor->{NewEnabled} = 0
|
||||
if ( !$monitor->{NewEnabled} );
|
||||
next if ! exists $monitor->{NewFunction};
|
||||
$monitor->{NewFunction} = 'None' if !$monitor->{NewFunction};
|
||||
$monitor->{NewEnabled} = 0 if !$monitor->{NewEnabled};
|
||||
if ( $monitor->{Function} ne $monitor->{NewFunction}
|
||||
|| $monitor->{Enabled} ne $monitor->{NewEnabled}
|
||||
) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 0bd63fb464957080ead342db58ca9e01532cf1ef
|
||||
Subproject commit 14292374ccf1328f2d5db20897bd06f99ba4d938
|
|
@ -458,22 +458,22 @@ function getAlarmCmdResponse(respObj, respText) {
|
|||
}
|
||||
|
||||
function cmdDisableAlarms() {
|
||||
alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=disableAlarms");
|
||||
alarmCmdReq.send(alarmCmdParms+'&'+auth_relay+"&command=disableAlarms");
|
||||
}
|
||||
|
||||
function cmdEnableAlarms() {
|
||||
alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=enableAlarms");
|
||||
alarmCmdReq.send(alarmCmdParms+'&'+auth_relay+"&command=enableAlarms");
|
||||
}
|
||||
|
||||
function cmdForceAlarm() {
|
||||
alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=forceAlarm");
|
||||
alarmCmdReq.send(alarmCmdParms+'&'+auth_relay+"&command=forceAlarm");
|
||||
if ( window.event ) {
|
||||
window.event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdCancelForcedAlarm() {
|
||||
alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=cancelForcedAlarm");
|
||||
alarmCmdReq.send(alarmCmdParms+'&'+auth_relay+"&command=cancelForcedAlarm");
|
||||
if ( window.event ) {
|
||||
window.event.preventDefault();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue