Difference between revisions of "FAQ"

From ZoneMinder Wiki
Jump to navigationJump to search
 
(159 intermediate revisions by 52 users not shown)
Line 1: Line 1:


== ZoneMinder Frequently Asked Questions ==
==User Generated ZoneMinder Frequently Asked Questions ==


This is the new FAQ page. I will be migrating the existing FAQs here as soon as possible.
These are user generated FAQs for ZoneMinder.
The official ZoneMinder FAQ can be found at http://zoneminder.readthedocs.org/en/latest/faq.html


Feel free to contribute any FAQs that you think are missing.
Please treat this page as a supplement to the official FAQ. If you have tips that are not covered in the official FAQ
please add them here. If we find some tips really interesting, we may move them to the official FAQ.


===How can I stop ZoneMinder filling up my disk?===
You can add your FAQ by following the format below


Recent versions of ZoneMinder come with a filter you can use for this purpose already included. However by default it is not enabled for event deletion.
=== Sample FAQ Heading ===
Sample FAQ answer.


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. This will bring up an event listing and a filter window. In the filter window there is a dropdown select box labelled 'Use Filter', that lets your 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.
----


After you've done that, you changes will automatically be loaded into zmfilter within a few minutes. Check the zmfilter.log file to make sure it is running as sometimes missing perl modules mean that it nevers runs but people don't always realise.
=== Montage Layout Names duplicity ===


===What does a 'Can't shmget: Invalid argument' error in my logs mean?===
Problem with Montage Layout naming - using same name <b><i>causes creating new one instead of updating existing one...</i></b><br>
Ubuntu 20.04.3 LTS Focal Fossa - easy setup - thank You ZoneMinder !<br>
- but then You need to access the database "zm" - and I searched and found easy solution and modified a little...<br>
- in this case - I use webui of phpmyadmin to manage the content of database - it is easy for beginners,<br>
and You cannot harm the database so easy like with bad syntax on command line...<br>


This error is discussed in the README in the following excerpt:-
<b>1./ log-in to terminal as su</b><br>
''...this is caused by an attempt to allocate an amount of shared memory greater than your system can handle. The size it requests is based on the following formula, ring buffer size x image width x image height x 3 (for 24 bit images) + a bit of overhead.
  sudo su
(provide password for Your superuser)<br>


So if for instance you were using 24bit 640x480 then this would come to about 92Mb if you are using the default buffer size of 100. If this is too large then you can either reduce the image or buffer sizes or increase the maximum amount of shared memory available. If you are using RedHat then you can get details on how to change these settings at http://www.redhat.com/docs/manuals/database/RHDB-2.1-Manual/admin_user/kernel-resources.html
<b>2./ install phpmyadmin</b><br>
  apt-get install phpmyadmin
- I have used for both apache2 and lighttpd<br>
- I have created custom password (for example: PASSword123)<br>


You should be able to use a similar procedure  with other distributions to modify the shared memory pool without kernel recompilations though in some cases this may be necessary. Note, this error also sometimes occurs if you have an old shared memory segment lying around from a previous run that is too small. Use the ipcs and ipcrm system commands to check and remove it if necessary.'"
<b>3./ modify access to databases for default user "phpmyadmin"</b><br>
- enter mysql:<br>
  mysql -u root -pzm
- pzm is for -p and zm because "-p zm" with space don't work...<br>
- I have used command for all databases for easy use...<br>
  GRANT ALL ON *.* TO 'phpmyadmin'@'localhost'
- this causes that user "phpmyadmin" has all databases on host visible and editable<br>
- normaly it would look like this - only for "zm" database<br>
  GRANT ALL ON zm.* TO 'phpmyadmin'@'localhost'


You can often find out how much shared memory is available by typing the following :-
<b>4./ delete or modify unwanted layouts</b><br>
- connect from browser:
  http://localhost/phpmyadmin
- username "phpmyadmin"
- password "PASSword123"
- open database "zm" and look for table "MontageLayouts"<br>
- do what You want (study how layout is defined...) :-)<br>
- or simply delete unwanted or broken layout - after this refresh page with layout and<br>
in the dropdown menu of layouts is the deleted one (or more) not more available...<br>


cat /proc/sys/kernel/shmall
<b><i>Don't forget - MYSQL and PHPMYADMIN are two DIFFERENT things...<br>
- also take care about usernames and passwords</i></b>


and the most you can allocate in one go :-
----
 
cat /proc/sys/kernel/shmmax
 
To change these values type (for example) :-
 
echo 134217728 >/proc/sys/kernel/shmall
echo 134217728 >/proc/sys/kernel/shmmax
 
However be aware that sometimes you will only need to change the shmmax value as shmall is often large enough. Also changing these values in this way is only effective until your machine is rebooted. To change them permanently you will need to edit /etc/sysctl.conf and add the following lines (for example) :-
 
kernel.shmall = 134217728
kernel.shmmax = 134217728
 
Which will enforce the changes the next time your machine is restarted.

Latest revision as of 05:01, 4 October 2021

User Generated ZoneMinder Frequently Asked Questions

These are user generated FAQs for ZoneMinder. The official ZoneMinder FAQ can be found at http://zoneminder.readthedocs.org/en/latest/faq.html

Please treat this page as a supplement to the official FAQ. If you have tips that are not covered in the official FAQ please add them here. If we find some tips really interesting, we may move them to the official FAQ.

You can add your FAQ by following the format below

Sample FAQ Heading

Sample FAQ answer.


Montage Layout Names duplicity

Problem with Montage Layout naming - using same name causes creating new one instead of updating existing one...
Ubuntu 20.04.3 LTS Focal Fossa - easy setup - thank You ZoneMinder !
- but then You need to access the database "zm" - and I searched and found easy solution and modified a little...
- in this case - I use webui of phpmyadmin to manage the content of database - it is easy for beginners,
and You cannot harm the database so easy like with bad syntax on command line...

1./ log-in to terminal as su

 sudo su

(provide password for Your superuser)

2./ install phpmyadmin

 apt-get install phpmyadmin

- I have used for both apache2 and lighttpd
- I have created custom password (for example: PASSword123)

3./ modify access to databases for default user "phpmyadmin"
- enter mysql:

 mysql -u root -pzm

- pzm is for -p and zm because "-p zm" with space don't work...
- I have used command for all databases for easy use...

 GRANT ALL ON *.* TO 'phpmyadmin'@'localhost'

- this causes that user "phpmyadmin" has all databases on host visible and editable
- normaly it would look like this - only for "zm" database

 GRANT ALL ON zm.* TO 'phpmyadmin'@'localhost'

4./ delete or modify unwanted layouts
- connect from browser:

 http://localhost/phpmyadmin

- username "phpmyadmin" - password "PASSword123" - open database "zm" and look for table "MontageLayouts"
- do what You want (study how layout is defined...) :-)
- or simply delete unwanted or broken layout - after this refresh page with layout and
in the dropdown menu of layouts is the deleted one (or more) not more available...

Don't forget - MYSQL and PHPMYADMIN are two DIFFERENT things...
- also take care about usernames and passwords