Difference between revisions of "FAQ"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 13: Line 13:


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.
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.
===What does a 'Can't shmget: Invalid argument' error in my logs mean?===
This error is discussed in the README in the following excerpt:-
''...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.
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
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.'"
You can often find out how much shared memory is available by typing the following :-
cat /proc/sys/kernel/shmall
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.

Revision as of 11:50, 19 May 2006

ZoneMinder Frequently Asked Questions

This is the new FAQ page. I will be migrating the existing FAQs here as soon as possible.

Feel free to contribute any FAQs that you think are missing.

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. However by default it is not enabled for event deletion.

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.

What does a 'Can't shmget: Invalid argument' error in my logs mean?

This error is discussed in the README in the following excerpt:- ...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.

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

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.'"

You can often find out how much shared memory is available by typing the following :-

cat /proc/sys/kernel/shmall

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.