<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nelsda</id>
	<title>ZoneMinder Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nelsda"/>
	<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/Special:Contributions/Nelsda"/>
	<updated>2026-04-19T19:14:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=CentOS&amp;diff=4206</id>
		<title>CentOS</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=CentOS&amp;diff=4206"/>
		<updated>2010-11-25T05:17:08Z</updated>

		<summary type="html">&lt;p&gt;Nelsda: /* Step Five - Installing ZoneMinder 1.24.2 */  added package yasm since it is needed to compile ffmpeg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The intent of this walk through is to install a very base/bare bones installation of CentOS that will only run ZoneMinder. This would be for a dedicated ZoneMinder server with no GUI or any unnecessary services running. The reason for the very light-weight installation is so that the majority of system resources are available to ZoneMinder and not having to power the OS. With this installation, memory is reduced to around 140-160MB, and CPU usage is practically nonexistent. CentOS is very easy to install the base installation and doesn’t take too much time as long as you have some type of broadband connection. There are many ways to install CentOS, but this will only cover two because they are related.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;All CLI operations/commands in this How-To are done as root in the user root&amp;#039;s directory. The reasoning is that this system would be in a secure environment to begin with. However, if you need to add a user to run these services to better secure the system then you can, but keep in mind that some items must be ran as root.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== CentOS 5.3 &amp;amp; ZoneMinder 1.24.2 ==&lt;br /&gt;
This guide is for CentOS v5.3 with ZoneMinder v1.24.2 which are the newest released versions as of this update (9/3/2009).  If you are attempting to install newer versions of either using this guide you will have to adjust file and directory names below.  Obviously at at the time of this update released versions newer than these have not been tested together.&lt;br /&gt;
&lt;br /&gt;
=== Step One - Get CentOS ===&lt;br /&gt;
You can download the “.iso” file(s) for CentOS from http://www.centos.org/&amp;lt;br/&amp;gt;&lt;br /&gt;
Alternatively download the net-install version of CentOS which is basically just the first CD.&lt;br /&gt;
Here is one location to download the net-install version:&amp;lt;br/&amp;gt;&lt;br /&gt;
Download i386: http://mirror.chpc.utah.edu/pub/centos/5.3/isos/i386/CentOS-5.3-i386-netinstall.iso&amp;lt;br/&amp;gt;&lt;br /&gt;
Download 64 bit: http://centos.cs.wisc.edu/pub/mirrors/linux/centos/5.3/isos/x86_64/CentOS-5.3-x86_64-netinstall.iso&amp;lt;br/&amp;gt;&lt;br /&gt;
Mirrors List: http://www.centos.org/mirrors/ &lt;br /&gt;
&lt;br /&gt;
=== Step Two - Installation Source ===&lt;br /&gt;
Regardless of which method you use the next few steps are the same.&amp;lt;br/&amp;gt;&lt;br /&gt;
Begin by booting your system up with either cd/dvd.&amp;lt;br/&amp;gt;&lt;br /&gt;
Choose the options that best fit your environment until you reach the “Installation Method”. &lt;br /&gt;
&lt;br /&gt;
[[Image:centosnetinstal-http.png]]&lt;br /&gt;
&lt;br /&gt;
Choose &amp;#039;&amp;#039;&amp;#039;HTTP&amp;#039;&amp;#039;&amp;#039; ONLY if you are using the net-install method.  Otherwise, you probably want to choose &amp;#039;&amp;#039;&amp;#039;Local CDROM&amp;#039;&amp;#039;&amp;#039;. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using the net-install method then enter:&amp;lt;br/&amp;gt;&lt;br /&gt;
Website Name: &amp;#039;&amp;#039;&amp;#039;mirror.centos.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
CentOS Directory: (for i386) &amp;#039;&amp;#039;&amp;#039;/centos/5.3/os/i386&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
CentOS Directory: (for 64 bit) &amp;#039;&amp;#039;&amp;#039;/centos/5.3/os/x86_64&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Step Three - Installation Packages ===&lt;br /&gt;
The first screen you want to un-check &amp;quot;Desktop - Gnome&amp;quot; and then check &amp;quot;Server&amp;quot; (not Server-GUI)&amp;lt;br/&amp;gt;&lt;br /&gt;
Then Make sure that you have &amp;quot;Customize now&amp;quot; selected at the bottom (do not check &amp;quot;Packages from CentOS Extras&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[Image:centosinstall-packages1.png]]&lt;br /&gt;
&lt;br /&gt;
Then click &amp;quot;Next&amp;quot; to continue on&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once presented with the custom package selection you need to un-check/check the following:&lt;br /&gt;
 Applications = Check only &amp;quot;Editors&amp;quot; and &amp;quot;Text Based Internet&amp;quot;&lt;br /&gt;
 Development = Check only &amp;quot;Development Libraries&amp;quot; and &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
 Servers = Un-check everything&lt;br /&gt;
 Base System = Check only &amp;quot;Base&amp;quot; (you can check Administration Tools and System Tools if you need them, but they are not necessary)&lt;br /&gt;
&lt;br /&gt;
[[Image:Centosinstall-packages2.png]]&lt;br /&gt;
&lt;br /&gt;
Now let the system finish installing&lt;br /&gt;
&lt;br /&gt;
[[Image:centosisntall-end.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step Four - Configuration ===&lt;br /&gt;
After the first reboot the setup screen should appear. If not then log into the system and type &amp;quot;setup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:centosinstall-setup1.png]]&lt;br /&gt;
&lt;br /&gt;
Go into the &amp;quot;Firewall Configuration&amp;quot; disable the Security Level, and Disable SELinux&lt;br /&gt;
&lt;br /&gt;
[[Image:centosinstall-setup2.png]]&lt;br /&gt;
&lt;br /&gt;
Next we are going to disable a number of system services. Go back to the setup screen and go into &amp;quot;System Services&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
Un-Check:&lt;br /&gt;
 apmd&lt;br /&gt;
 bluetooth&lt;br /&gt;
 cups&lt;br /&gt;
 hidd&lt;br /&gt;
 ip6tables&lt;br /&gt;
 iptables&lt;br /&gt;
 netfs&lt;br /&gt;
 nfslock&lt;br /&gt;
 pcscd&lt;br /&gt;
 portmap&lt;br /&gt;
After disabling the services then select &amp;quot;Disable Now and On Boot&amp;quot;, then exit the setup tool, and log into the system if you haven&amp;#039;t already.&lt;br /&gt;
*Screen is a simple program that allows you to run commands from a &amp;quot;Hosted&amp;quot; command line interface. This helps if you loose your connection to the server for any reason in that it allows you to resume (screen -r) right where you left off. Often times I will start a large update/upgrade, leave it for the day, then come back and see where it is at later. Screen allows you to do that without having to be always connected.&lt;br /&gt;
*Install Screen&lt;br /&gt;
 yum install screen&lt;br /&gt;
*To start a screen session just type&lt;br /&gt;
 screen&lt;br /&gt;
*If you get disconnected and need to resume your session of screen simply type&lt;br /&gt;
 screen -r&lt;br /&gt;
&lt;br /&gt;
=== Step Five - Installing ZoneMinder 1.24.2 ===&lt;br /&gt;
First we need to download files and prepare the system&lt;br /&gt;
*Add the RPM Forge repository to CentOS. This will allow the installation of a number of services/applications later on without having to manually install them.&lt;br /&gt;
&amp;lt;pre&amp;gt;# For i386 CentOS 5.x run:&lt;br /&gt;
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
# For 64 bit CentOS 5.x run:&lt;br /&gt;
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Download the needed files ZoneMinder 1.24.2 and the Cambozola addon&lt;br /&gt;
 wget http://www2.zoneminder.com/downloads/ZoneMinder-1.24.2.tar.gz&lt;br /&gt;
 wget http://www.zoneminder.com/fileadmin/downloads/cambozola.jar&lt;br /&gt;
*Now let&amp;#039;s install all the services and programs that will be needed (&amp;#039;&amp;#039;If you encounter any dependency errors using yum, try running &amp;#039;&amp;#039;&amp;#039;yum clean all&amp;#039;&amp;#039;&amp;#039; and then re-try the install command(s).&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;pre&amp;gt;# tip: Copy/paste two lines at a time&lt;br /&gt;
yum -y install mysql mysql-server mysql-devel php php-gd php-mysql httpd gcc \&lt;br /&gt;
pcre-devel gd mod_ssl glib2-devel gcc-c++ ntp gnutls-devel ImageMagick&lt;br /&gt;
&lt;br /&gt;
yum -y install libjpeg-devel perl-Archive-Tar perl-MIME-Lite perl-MIME-tools \&lt;br /&gt;
perl-Date-Manip perl-LWP-UserAgent-Determined&lt;br /&gt;
&lt;br /&gt;
yum -y install perl-PHP-Serialization perl-Device-SerialPort perl-Archive-Zip perl-Sys-Mmap.x86_64 \&lt;br /&gt;
perl-Module-Load subversion git yasm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Now let&amp;#039;s update everything within the new CentOS install&lt;br /&gt;
 yum -y update&lt;br /&gt;
*At this point it might be useful to reboot your system. Oddly, sometimes things don&amp;#039;t work right unless you reboot after all the updates&lt;br /&gt;
 reboot   -or-   shutdown -r now&lt;br /&gt;
*After reboot log back into your system&lt;br /&gt;
*Now we need to make sure we use the lasted &amp;quot;tested&amp;quot; version of &amp;quot;ffmpeg&amp;quot;. This is the latest version of ffmpeg that the ZoneMinder developers have tested with.  Download, compile and install ffmpeg:&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone git://git.ffmpeg.org/ffmpeg/&lt;br /&gt;
cd ffmpeg&lt;br /&gt;
git clone git://git.ffmpeg.org/libswscale/&lt;br /&gt;
./configure&lt;br /&gt;
make &lt;br /&gt;
# Next two commands must be done as root&lt;br /&gt;
make install &lt;br /&gt;
make install-libs&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Turn everything on&lt;br /&gt;
 # These commands must be run as root&lt;br /&gt;
 chkconfig httpd on &lt;br /&gt;
 chkconfig mysqld on &lt;br /&gt;
 chkconfig ntpd on &lt;br /&gt;
 service httpd start &lt;br /&gt;
 service mysqld start &lt;br /&gt;
 service ntpd start&lt;br /&gt;
*Next we need to extract the contents of the ZoneMinder &amp;quot;tar&amp;quot; file, and then jump into its directory&lt;br /&gt;
 cd /root/  # Or your work directory for this installation&lt;br /&gt;
 tar -zxvf ZoneMinder-1.24.2.tar.gz&lt;br /&gt;
 cd ZoneMinder-1.24.2&lt;br /&gt;
*Now we are going to configure ZoneMinder with some added statements. What is listed are default CentOS directory placements.&lt;br /&gt;
 ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin&lt;br /&gt;
By default ZM_DB_HOST=localhost, ZM_DB_NAME=zm, ZM_DB_USER=zmuser, and ZM_DB_PASS=zmpass.&lt;br /&gt;
*Change &amp;quot;zmuser&amp;quot; (if you want) with the user that you will use within MySQL to access the ZoneMinder database&lt;br /&gt;
*Change &amp;quot;zmpass&amp;quot; with the password you will be using with the &amp;quot;zmuser&amp;quot; account&lt;br /&gt;
So if you wish to change it then use a command like:&lt;br /&gt;
 ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass&lt;br /&gt;
&lt;br /&gt;
*if you get the configure &amp;quot;error zm requires libmysqlclient.a&amp;quot; with 64 bit CentOS add the following to the end of your configure statement&lt;br /&gt;
  --with-extralibs=&amp;quot;-L/usr/lib64 -L/usr/lib64/mysql&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
 # Run next command as root&lt;br /&gt;
 make install&lt;br /&gt;
*Need to add a password for the root user of MySQL&lt;br /&gt;
*Create the zm database&lt;br /&gt;
*Create the zm database user with permissions and password&lt;br /&gt;
 mysql&lt;br /&gt;
 mysql&amp;gt; SET PASSWORD FOR root@localhost=PASSWORD(&amp;#039;new_root_password&amp;#039;);&lt;br /&gt;
&amp;gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;
 mysql&amp;gt; create database zm;&lt;br /&gt;
&amp;gt;Query OK, 1 row affected (0.01 sec)&lt;br /&gt;
 mysql&amp;gt; grant CREATE, INSERT, SELECT, DELETE, UPDATE on zm.* to your_zm_user@localhost;&lt;br /&gt;
&amp;gt;Query OK, 0 rows affected (0.02 sec)&lt;br /&gt;
 mysql&amp;gt; SET PASSWORD FOR your_zm_user@localhost=PASSWORD(&amp;#039;your_zm_password_from_above&amp;#039;);&lt;br /&gt;
&amp;gt;Query OK, 0 rows affected (0.25 sec)&lt;br /&gt;
 mysql&amp;gt; exit&lt;br /&gt;
&amp;gt;Bye&lt;br /&gt;
*Import the tables into the zm database&lt;br /&gt;
 cd /root/ZoneMinder-1.24.2 &lt;br /&gt;
 mysql -u root -p zm &amp;lt; db/zm_create.sql&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;All remaining CLI commands need to be run as root.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Make it so that ZoneMinder will startup automatically when the system is rebooted&lt;br /&gt;
 # from the ZoneMinder-1.24.2 source directory&lt;br /&gt;
 cp scripts/zm /etc/init.d/&lt;br /&gt;
 chmod +x /etc/init.d/zm&lt;br /&gt;
 chkconfig zm on&lt;br /&gt;
*Add the Cambozola Java web interface&lt;br /&gt;
 cp cambozola.jar /var/www/html/zm/&lt;br /&gt;
* and make sure you have permission to view it from apache:&lt;br /&gt;
 chown apache:apache /var/www/html/zm/cambozola.jar&lt;br /&gt;
*Start ZoneMinder&lt;br /&gt;
 service zm start&lt;br /&gt;
&lt;br /&gt;
* tick the box for support for the Cambozola addon within your ZoneMinder installation: http://ip-address/zm (Options-&amp;gt;Images&amp;amp;nbsp;tab-&amp;gt;OPT_CAMBOZOLA)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now have fun and add your cameras to ZoneMinder knowing that you now have a very stable and streamlined OS to run it on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[== &amp;#039;&amp;#039;&amp;#039;P.S.&amp;#039;&amp;#039;&amp;#039; ==]] aspcicc@jumpy.it&lt;br /&gt;
(Update: This does not appear to be required any more.)&lt;br /&gt;
&lt;br /&gt;
Hi! and thanks for your guide.. i want to add a little correction that have made me crazy to resolve, when I poweroff or reboot system i obtain an error related to mysql database and i have    understood that the problem was because mysqld is stopped before zoneminder to be more specific there isn&amp;#039;t a link under rc0.d (halt) and rc6.d (reboot) to zoneminder that for this lack is simply killed by killall. To resolve this problem you need to add at the start of zm (under /etc/init.d) the line&lt;br /&gt;
&lt;br /&gt;
 &amp;#039; # chkconfig: 345 99 01 &amp;#039;  (without &amp;#039; of course)&lt;br /&gt;
&lt;br /&gt;
and then run &lt;br /&gt;
chkconfig --level 345 zm on&lt;br /&gt;
chkconfig --level 06 zm off&lt;br /&gt;
&lt;br /&gt;
So the link to shutdown zm is created under rc0.d and rc6.d and zoneminder is started at the end of poweron and stopped at the beginning of the poweroff&lt;br /&gt;
&lt;br /&gt;
For information about priority starting and stopping processes see: http://www.netadmintools.com/art94.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Added Dependency: ImageMagick&lt;br /&gt;
&lt;br /&gt;
Removed Dependency: perl-Time-HiRes, which causes a conflict with the default perl package.&lt;br /&gt;
&lt;br /&gt;
Also, mysql seems to install with no password for the root user, and the zm DB create script creates the database on the fly, which means that the database create command needs to have the &amp;quot;-p zm&amp;quot; removed from the command line.&lt;br /&gt;
&lt;br /&gt;
Could someone verify that this is correct, to make sure it&amp;#039;s not just something I missed?&lt;br /&gt;
&lt;br /&gt;
Thanks! &lt;br /&gt;
terry@cnysupport.com&lt;/div&gt;</summary>
		<author><name>Nelsda</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=CentOS&amp;diff=4205</id>
		<title>CentOS</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=CentOS&amp;diff=4205"/>
		<updated>2010-11-25T04:33:18Z</updated>

		<summary type="html">&lt;p&gt;Nelsda: Error in package line for the third yum install line in step 5. Should have been x86_64 followed by a space before the \&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The intent of this walk through is to install a very base/bare bones installation of CentOS that will only run ZoneMinder. This would be for a dedicated ZoneMinder server with no GUI or any unnecessary services running. The reason for the very light-weight installation is so that the majority of system resources are available to ZoneMinder and not having to power the OS. With this installation, memory is reduced to around 140-160MB, and CPU usage is practically nonexistent. CentOS is very easy to install the base installation and doesn’t take too much time as long as you have some type of broadband connection. There are many ways to install CentOS, but this will only cover two because they are related.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;All CLI operations/commands in this How-To are done as root in the user root&amp;#039;s directory. The reasoning is that this system would be in a secure environment to begin with. However, if you need to add a user to run these services to better secure the system then you can, but keep in mind that some items must be ran as root.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== CentOS 5.3 &amp;amp; ZoneMinder 1.24.2 ==&lt;br /&gt;
This guide is for CentOS v5.3 with ZoneMinder v1.24.2 which are the newest released versions as of this update (9/3/2009).  If you are attempting to install newer versions of either using this guide you will have to adjust file and directory names below.  Obviously at at the time of this update released versions newer than these have not been tested together.&lt;br /&gt;
&lt;br /&gt;
=== Step One - Get CentOS ===&lt;br /&gt;
You can download the “.iso” file(s) for CentOS from http://www.centos.org/&amp;lt;br/&amp;gt;&lt;br /&gt;
Alternatively download the net-install version of CentOS which is basically just the first CD.&lt;br /&gt;
Here is one location to download the net-install version:&amp;lt;br/&amp;gt;&lt;br /&gt;
Download i386: http://mirror.chpc.utah.edu/pub/centos/5.3/isos/i386/CentOS-5.3-i386-netinstall.iso&amp;lt;br/&amp;gt;&lt;br /&gt;
Download 64 bit: http://centos.cs.wisc.edu/pub/mirrors/linux/centos/5.3/isos/x86_64/CentOS-5.3-x86_64-netinstall.iso&amp;lt;br/&amp;gt;&lt;br /&gt;
Mirrors List: http://www.centos.org/mirrors/ &lt;br /&gt;
&lt;br /&gt;
=== Step Two - Installation Source ===&lt;br /&gt;
Regardless of which method you use the next few steps are the same.&amp;lt;br/&amp;gt;&lt;br /&gt;
Begin by booting your system up with either cd/dvd.&amp;lt;br/&amp;gt;&lt;br /&gt;
Choose the options that best fit your environment until you reach the “Installation Method”. &lt;br /&gt;
&lt;br /&gt;
[[Image:centosnetinstal-http.png]]&lt;br /&gt;
&lt;br /&gt;
Choose &amp;#039;&amp;#039;&amp;#039;HTTP&amp;#039;&amp;#039;&amp;#039; ONLY if you are using the net-install method.  Otherwise, you probably want to choose &amp;#039;&amp;#039;&amp;#039;Local CDROM&amp;#039;&amp;#039;&amp;#039;. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using the net-install method then enter:&amp;lt;br/&amp;gt;&lt;br /&gt;
Website Name: &amp;#039;&amp;#039;&amp;#039;mirror.centos.org&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
CentOS Directory: (for i386) &amp;#039;&amp;#039;&amp;#039;/centos/5.3/os/i386&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
CentOS Directory: (for 64 bit) &amp;#039;&amp;#039;&amp;#039;/centos/5.3/os/x86_64&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Step Three - Installation Packages ===&lt;br /&gt;
The first screen you want to un-check &amp;quot;Desktop - Gnome&amp;quot; and then check &amp;quot;Server&amp;quot; (not Server-GUI)&amp;lt;br/&amp;gt;&lt;br /&gt;
Then Make sure that you have &amp;quot;Customize now&amp;quot; selected at the bottom (do not check &amp;quot;Packages from CentOS Extras&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[Image:centosinstall-packages1.png]]&lt;br /&gt;
&lt;br /&gt;
Then click &amp;quot;Next&amp;quot; to continue on&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once presented with the custom package selection you need to un-check/check the following:&lt;br /&gt;
 Applications = Check only &amp;quot;Editors&amp;quot; and &amp;quot;Text Based Internet&amp;quot;&lt;br /&gt;
 Development = Check only &amp;quot;Development Libraries&amp;quot; and &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
 Servers = Un-check everything&lt;br /&gt;
 Base System = Check only &amp;quot;Base&amp;quot; (you can check Administration Tools and System Tools if you need them, but they are not necessary)&lt;br /&gt;
&lt;br /&gt;
[[Image:Centosinstall-packages2.png]]&lt;br /&gt;
&lt;br /&gt;
Now let the system finish installing&lt;br /&gt;
&lt;br /&gt;
[[Image:centosisntall-end.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step Four - Configuration ===&lt;br /&gt;
After the first reboot the setup screen should appear. If not then log into the system and type &amp;quot;setup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:centosinstall-setup1.png]]&lt;br /&gt;
&lt;br /&gt;
Go into the &amp;quot;Firewall Configuration&amp;quot; disable the Security Level, and Disable SELinux&lt;br /&gt;
&lt;br /&gt;
[[Image:centosinstall-setup2.png]]&lt;br /&gt;
&lt;br /&gt;
Next we are going to disable a number of system services. Go back to the setup screen and go into &amp;quot;System Services&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
Un-Check:&lt;br /&gt;
 apmd&lt;br /&gt;
 bluetooth&lt;br /&gt;
 cups&lt;br /&gt;
 hidd&lt;br /&gt;
 ip6tables&lt;br /&gt;
 iptables&lt;br /&gt;
 netfs&lt;br /&gt;
 nfslock&lt;br /&gt;
 pcscd&lt;br /&gt;
 portmap&lt;br /&gt;
After disabling the services then select &amp;quot;Disable Now and On Boot&amp;quot;, then exit the setup tool, and log into the system if you haven&amp;#039;t already.&lt;br /&gt;
*Screen is a simple program that allows you to run commands from a &amp;quot;Hosted&amp;quot; command line interface. This helps if you loose your connection to the server for any reason in that it allows you to resume (screen -r) right where you left off. Often times I will start a large update/upgrade, leave it for the day, then come back and see where it is at later. Screen allows you to do that without having to be always connected.&lt;br /&gt;
*Install Screen&lt;br /&gt;
 yum install screen&lt;br /&gt;
*To start a screen session just type&lt;br /&gt;
 screen&lt;br /&gt;
*If you get disconnected and need to resume your session of screen simply type&lt;br /&gt;
 screen -r&lt;br /&gt;
&lt;br /&gt;
=== Step Five - Installing ZoneMinder 1.24.2 ===&lt;br /&gt;
First we need to download files and prepare the system&lt;br /&gt;
*Add the RPM Forge repository to CentOS. This will allow the installation of a number of services/applications later on without having to manually install them.&lt;br /&gt;
&amp;lt;pre&amp;gt;# For i386 CentOS 5.x run:&lt;br /&gt;
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm&lt;br /&gt;
&lt;br /&gt;
# For 64 bit CentOS 5.x run:&lt;br /&gt;
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Download the needed files ZoneMinder 1.24.2 and the Cambozola addon&lt;br /&gt;
 wget http://www2.zoneminder.com/downloads/ZoneMinder-1.24.2.tar.gz&lt;br /&gt;
 wget http://www.zoneminder.com/fileadmin/downloads/cambozola.jar&lt;br /&gt;
*Now let&amp;#039;s install all the services and programs that will be needed (&amp;#039;&amp;#039;If you encounter any dependency errors using yum, try running &amp;#039;&amp;#039;&amp;#039;yum clean all&amp;#039;&amp;#039;&amp;#039; and then re-try the install command(s).&amp;#039;&amp;#039;)&lt;br /&gt;
&amp;lt;pre&amp;gt;# tip: Copy/paste two lines at a time&lt;br /&gt;
yum -y install mysql mysql-server mysql-devel php php-gd php-mysql httpd gcc \&lt;br /&gt;
pcre-devel gd mod_ssl glib2-devel gcc-c++ ntp gnutls-devel ImageMagick&lt;br /&gt;
&lt;br /&gt;
yum -y install libjpeg-devel perl-Archive-Tar perl-MIME-Lite perl-MIME-tools \&lt;br /&gt;
perl-Date-Manip perl-LWP-UserAgent-Determined&lt;br /&gt;
&lt;br /&gt;
yum -y install perl-PHP-Serialization perl-Device-SerialPort perl-Archive-Zip perl-Sys-Mmap.x86_64 \&lt;br /&gt;
perl-Module-Load subversion git&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Now let&amp;#039;s update everything within the new CentOS install&lt;br /&gt;
 yum -y update&lt;br /&gt;
*At this point it might be useful to reboot your system. Oddly, sometimes things don&amp;#039;t work right unless you reboot after all the updates&lt;br /&gt;
 reboot   -or-   shutdown -r now&lt;br /&gt;
*After reboot log back into your system&lt;br /&gt;
*Now we need to make sure we use the lasted &amp;quot;tested&amp;quot; version of &amp;quot;ffmpeg&amp;quot;. This is the latest version of ffmpeg that the ZoneMinder developers have tested with.  Download, compile and install ffmpeg:&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone git://git.ffmpeg.org/ffmpeg/&lt;br /&gt;
cd ffmpeg&lt;br /&gt;
git clone git://git.ffmpeg.org/libswscale/&lt;br /&gt;
./configure&lt;br /&gt;
make &lt;br /&gt;
# Next two commands must be done as root&lt;br /&gt;
make install &lt;br /&gt;
make install-libs&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Turn everything on&lt;br /&gt;
 # These commands must be run as root&lt;br /&gt;
 chkconfig httpd on &lt;br /&gt;
 chkconfig mysqld on &lt;br /&gt;
 chkconfig ntpd on &lt;br /&gt;
 service httpd start &lt;br /&gt;
 service mysqld start &lt;br /&gt;
 service ntpd start&lt;br /&gt;
*Next we need to extract the contents of the ZoneMinder &amp;quot;tar&amp;quot; file, and then jump into its directory&lt;br /&gt;
 cd /root/  # Or your work directory for this installation&lt;br /&gt;
 tar -zxvf ZoneMinder-1.24.2.tar.gz&lt;br /&gt;
 cd ZoneMinder-1.24.2&lt;br /&gt;
*Now we are going to configure ZoneMinder with some added statements. What is listed are default CentOS directory placements.&lt;br /&gt;
 ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin&lt;br /&gt;
By default ZM_DB_HOST=localhost, ZM_DB_NAME=zm, ZM_DB_USER=zmuser, and ZM_DB_PASS=zmpass.&lt;br /&gt;
*Change &amp;quot;zmuser&amp;quot; (if you want) with the user that you will use within MySQL to access the ZoneMinder database&lt;br /&gt;
*Change &amp;quot;zmpass&amp;quot; with the password you will be using with the &amp;quot;zmuser&amp;quot; account&lt;br /&gt;
So if you wish to change it then use a command like:&lt;br /&gt;
 ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass&lt;br /&gt;
&lt;br /&gt;
*if you get the configure &amp;quot;error zm requires libmysqlclient.a&amp;quot; with 64 bit CentOS add the following to the end of your configure statement&lt;br /&gt;
  --with-extralibs=&amp;quot;-L/usr/lib64 -L/usr/lib64/mysql&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
 # Run next command as root&lt;br /&gt;
 make install&lt;br /&gt;
*Need to add a password for the root user of MySQL&lt;br /&gt;
*Create the zm database&lt;br /&gt;
*Create the zm database user with permissions and password&lt;br /&gt;
 mysql&lt;br /&gt;
 mysql&amp;gt; SET PASSWORD FOR root@localhost=PASSWORD(&amp;#039;new_root_password&amp;#039;);&lt;br /&gt;
&amp;gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;
 mysql&amp;gt; create database zm;&lt;br /&gt;
&amp;gt;Query OK, 1 row affected (0.01 sec)&lt;br /&gt;
 mysql&amp;gt; grant CREATE, INSERT, SELECT, DELETE, UPDATE on zm.* to your_zm_user@localhost;&lt;br /&gt;
&amp;gt;Query OK, 0 rows affected (0.02 sec)&lt;br /&gt;
 mysql&amp;gt; SET PASSWORD FOR your_zm_user@localhost=PASSWORD(&amp;#039;your_zm_password_from_above&amp;#039;);&lt;br /&gt;
&amp;gt;Query OK, 0 rows affected (0.25 sec)&lt;br /&gt;
 mysql&amp;gt; exit&lt;br /&gt;
&amp;gt;Bye&lt;br /&gt;
*Import the tables into the zm database&lt;br /&gt;
 cd /root/ZoneMinder-1.24.2 &lt;br /&gt;
 mysql -u root -p zm &amp;lt; db/zm_create.sql&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;All remaining CLI commands need to be run as root.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Make it so that ZoneMinder will startup automatically when the system is rebooted&lt;br /&gt;
 # from the ZoneMinder-1.24.2 source directory&lt;br /&gt;
 cp scripts/zm /etc/init.d/&lt;br /&gt;
 chmod +x /etc/init.d/zm&lt;br /&gt;
 chkconfig zm on&lt;br /&gt;
*Add the Cambozola Java web interface&lt;br /&gt;
 cp cambozola.jar /var/www/html/zm/&lt;br /&gt;
* and make sure you have permission to view it from apache:&lt;br /&gt;
 chown apache:apache /var/www/html/zm/cambozola.jar&lt;br /&gt;
*Start ZoneMinder&lt;br /&gt;
 service zm start&lt;br /&gt;
&lt;br /&gt;
* tick the box for support for the Cambozola addon within your ZoneMinder installation: http://ip-address/zm (Options-&amp;gt;Images&amp;amp;nbsp;tab-&amp;gt;OPT_CAMBOZOLA)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now have fun and add your cameras to ZoneMinder knowing that you now have a very stable and streamlined OS to run it on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[== &amp;#039;&amp;#039;&amp;#039;P.S.&amp;#039;&amp;#039;&amp;#039; ==]] aspcicc@jumpy.it&lt;br /&gt;
(Update: This does not appear to be required any more.)&lt;br /&gt;
&lt;br /&gt;
Hi! and thanks for your guide.. i want to add a little correction that have made me crazy to resolve, when I poweroff or reboot system i obtain an error related to mysql database and i have    understood that the problem was because mysqld is stopped before zoneminder to be more specific there isn&amp;#039;t a link under rc0.d (halt) and rc6.d (reboot) to zoneminder that for this lack is simply killed by killall. To resolve this problem you need to add at the start of zm (under /etc/init.d) the line&lt;br /&gt;
&lt;br /&gt;
 &amp;#039; # chkconfig: 345 99 01 &amp;#039;  (without &amp;#039; of course)&lt;br /&gt;
&lt;br /&gt;
and then run &lt;br /&gt;
chkconfig --level 345 zm on&lt;br /&gt;
chkconfig --level 06 zm off&lt;br /&gt;
&lt;br /&gt;
So the link to shutdown zm is created under rc0.d and rc6.d and zoneminder is started at the end of poweron and stopped at the beginning of the poweroff&lt;br /&gt;
&lt;br /&gt;
For information about priority starting and stopping processes see: http://www.netadmintools.com/art94.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Added Dependency: ImageMagick&lt;br /&gt;
&lt;br /&gt;
Removed Dependency: perl-Time-HiRes, which causes a conflict with the default perl package.&lt;br /&gt;
&lt;br /&gt;
Also, mysql seems to install with no password for the root user, and the zm DB create script creates the database on the fly, which means that the database create command needs to have the &amp;quot;-p zm&amp;quot; removed from the command line.&lt;br /&gt;
&lt;br /&gt;
Could someone verify that this is correct, to make sure it&amp;#039;s not just something I missed?&lt;br /&gt;
&lt;br /&gt;
Thanks! &lt;br /&gt;
terry@cnysupport.com&lt;/div&gt;</summary>
		<author><name>Nelsda</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=FAQ&amp;diff=1913</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=FAQ&amp;diff=1913"/>
		<updated>2007-03-14T07:01:23Z</updated>

		<summary type="html">&lt;p&gt;Nelsda: /* How much Hard Disk Space / Bandwidth do I need for ZM? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ZoneMinder Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
This is the new FAQ page. I will be migrating the existing FAQs here as soon as possible. In the meantime the old FAQ page is available [http://www.zoneminder.com/faq.html here].&lt;br /&gt;
&lt;br /&gt;
Feel free to contribute any FAQs that you think are missing.&lt;br /&gt;
&lt;br /&gt;
===How can I stop ZoneMinder filling up my disk?===&lt;br /&gt;
&lt;br /&gt;
Recent versions of ZoneMinder come with a filter you can use for this purpose already included. However &amp;#039;&amp;#039;&amp;#039;by default it is not enabled for event deletion&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The filter is called &amp;#039;&amp;#039;PurgeWhenFull&amp;#039;&amp;#039; 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.&lt;br /&gt;
&lt;br /&gt;
This will bring up an event listing and a filter window.&lt;br /&gt;
&lt;br /&gt;
In the filter window there is a dropdown select box labelled &amp;#039;Use Filter&amp;#039;, that lets your select a saved filter. Select &amp;#039;PurgeWhenFull&amp;#039; and it will load that filter.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
Then click on &amp;#039;Save&amp;#039; which will bring up a new window. Make sure the &amp;#039;Automatically delete&amp;#039; box is checked and press save to save your filter. This will then run in the background to keep your disk within those limits.&lt;br /&gt;
&lt;br /&gt;
After you&amp;#039;ve done that, you changes will automatically be loaded into zmfilter within a few minutes.&lt;br /&gt;
&lt;br /&gt;
Check the &amp;lt;tt&amp;gt;zmfilter.log&amp;lt;/tt&amp;gt; file to make sure it is running as sometimes missing perl modules mean that it nevers runs but people don&amp;#039;t always realise.&lt;br /&gt;
&lt;br /&gt;
===What does a &amp;#039;Can&amp;#039;t shmget: Invalid argument&amp;#039; error in my logs mean?===&lt;br /&gt;
&lt;br /&gt;
This error is discussed in the README in the following excerpt:-&lt;br /&gt;
&amp;#039;&amp;#039;...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.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can often find out how much shared memory is available by typing the following :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/sys/kernel/shmall&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the most you can allocate in one go :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/sys/kernel/shmmax&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change these values type (for example) :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo 134217728 &amp;gt;/proc/sys/kernel/shmall &amp;amp;&amp;amp; echo 134217728 &amp;gt;/proc/sys/kernel/shmmax&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; and add the following lines (for example) :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;kernel.shmall = 134217728&lt;br /&gt;
kernel.shmmax = 134217728&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which will enforce the changes the next time your machine is restarted.&lt;br /&gt;
&lt;br /&gt;
===Why can&amp;#039;t I see streamed images when I can see stills in the Zone window etc?===&lt;br /&gt;
&lt;br /&gt;
This issue is normally down to one of two causes&lt;br /&gt;
&lt;br /&gt;
1) You are using Internet Explorer and are trying to view multi-part jpeg streams. IE does not support these streams directly, unlike most other browsers. You will need to install Cambozola or another multi-part jpeg aware pluging to view them. To do this you will need to obtain the applet from the Downloads page and install the cambozola.jar file in the same directly as the ZoneMinder php files. Then find the ZoneMinder Options-&amp;gt;Images page and enable ZM_OPT_CAMBOZOLA and enter the web path to the .jar file in ZM_PATH_CAMBOZOLA. This will ordinarily just be cambozola.jar. Provided ZM_CAN_STREAM is set to auto and ZM_STREAM_METHOD is set to jpeg then Cambozola should be loaded next time you try and view a stream.&lt;br /&gt;
2) The other common cause for being unable to view streams is that you have installed the ZoneMinder cgi binaries (zms and nph-zms) in a different directory than your web server is expecting. Make sure that the --with-cgidir option you use to the ZoneMinder configure script is the same as the CGI directory configure for your web server. If you are using Apache, which is the most common one, then in your httpd.conf file there should be a line like &amp;lt;pre&amp;gt;ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&amp;lt;/pre&amp;gt; where the last directory in the quotes is the one you have specified. If not then change one or the other to match. Be warned that configuring apache can be complex so changing the one passed to the ZoneMinder configure (and then rebuilding and reinstalling) is recommended in the first instance. If you change the apache config you will need to restart apache for the changes to take effect. If you still cannot see stream reliably then try changing Options-&amp;gt;Paths-&amp;gt;ZM_PATH_ZMS to just use zms if nph-zms is specified, or vice versa. Also check in your apache error logs.&lt;br /&gt;
&lt;br /&gt;
===I have several monitors configured but when I load the Montage view in FireFox why can I only see two?===&lt;br /&gt;
&lt;br /&gt;
By default FireFox only allows a limited number of simultaneous connections to a particular web server. To view a montage with X cameras you need at least X connections. To resolve this situation, follow the instructions below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Enter about:config in the address bar&lt;br /&gt;
&lt;br /&gt;
scroll down to&lt;br /&gt;
browser.cache.check_doc_frequency 3&lt;br /&gt;
change the 3 to a 1&lt;br /&gt;
&lt;br /&gt;
browser.cache.disk.enable True -&amp;gt; False&lt;br /&gt;
network.http.max-connections-per-server -&amp;gt; put a value of 100&lt;br /&gt;
network.http.max-persistent-connections-per-proxy -&amp;gt; 100 again&lt;br /&gt;
network.http.max-persistent-connections-per-server -&amp;gt; 100 again&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Why is ZoneMinder using so much CPU?===&lt;br /&gt;
&lt;br /&gt;
The various elements of ZoneMinder can be involved in some pretty intensive activity, especially while analysing images for motion. However generally this should not overwhelm your machine unless it is very old or underpowered.&lt;br /&gt;
&lt;br /&gt;
There are a number of specific reasons why processor loads can be high either by design or by accident. To figure out exactly what is causing it in your circumstances requires a bit of expermentation.&lt;br /&gt;
&lt;br /&gt;
The main causes are.&lt;br /&gt;
&lt;br /&gt;
# Using a video palette other than greyscale or RGB24. This can cause a relatively minor performace hit, though still significant. Although some cameras and cards require using planar palettes ZM currently doesn&amp;#039;t support this format internally (yet) and each frame is converted to an RGB representation prior to processing. Unless you have compelling reasons for using YUV or reduced RGB type palettes such as hitting USB transfer limits I would experiment to see if RGB24 or greyscale is quicker. Put your monitors into &amp;#039;Monitor&amp;#039; mode so that only the capture daemons are running and monitor the process load of these (the &amp;#039;zmc&amp;#039; processes) using top. Try it with various palettes to see if it makes a difference.&lt;br /&gt;
# Big image sizes. A image of 640x480 requires at least four times the processing of a 320x240 image. Experiment with different sizes to see what effect it may have. Sometimes a large image is just two interlaced smaller frames so has no real benefit anyway.&lt;br /&gt;
# Capture frame rates. Unless there&amp;#039;s a compelling reason in your case there is often little benefit in running cameras at 25fps when 5-10fps would often get you results just as good. Try changing your monitor settings to limit your cameras to lower frames rates. You can still configure ZM to ignore these limits and capture as fast as possible when an event is detected.&lt;br /&gt;
# Run function. Obviously running in Record or Mocord modes or in Modect with lots of events generates a lot of DB and file activity and so CPU and load will increase.&lt;br /&gt;
# Basic default detection zones. By default when a camera is added one detection zone is added which covers the whole image with a default set of parameters. If you camera covers a view in which various regions are unlikely to generate a valid alarm (ie the sky) then I would experiment with reducing the zone sizes or adding inactive zones to blank out areas you don&amp;#039;t want to monitor. Additionally the actual settings of the zone themselves may not be optimal. When doing motion detection the number of changed pixels above a threshold is examined, then this is filter, then contiguous regions are calculated to see if an alarm is generated. If any maximum or minimum threshold is exceeded according to your zone settings at any time the calculation stops. If your settings always result in the calculations going through to the last stage before being failed then additional CPU time is used unnecessarily. Make sure your maximum and minimumzone thresholds are set to sensible values and experiment by switching RECORD_EVENT_STATS on and seeing what the actual values of alarmed pixels etc are during sample events.&lt;br /&gt;
# Optimise your settings. After you&amp;#039;ve got some settings you&amp;#039;re happy with then switching off RECORD_EVENT_STATS will prevent the statistics being written to the database which saves some time. Other settings which might make a difference are ZM_FAST_RGB_DIFFS, ZM_OPT_FRAME_SERVER and the JPEG_xxx_QUALITY ones.&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m sure there are other things which might make a difference such as what else you have running on the box and memory sizes (make sure there&amp;#039;s no swapping going on). Also speed of disk etc will make some difference during event capture and also if you are watching the whole time then you may have a bunch of zms processes running also.&lt;br /&gt;
&lt;br /&gt;
I think the biggest factors are image size, colour depth and capture rate. Having said that I also don&amp;#039;t always know why you get certains results from &amp;#039;top&amp;#039;. For instance if I have a &amp;#039;zma&amp;#039; daemon running for a monitor that is capturing an image. I&amp;#039;ve commented out the actual analysis so all it&amp;#039;s doing is blending the image with the previous one. In colour mode this takes ~11 milliseconds per frame on my system and the camera is capturing at ~10fps. Using &amp;#039;top&amp;#039; this reports the process as using ~5% of CPU and permanently in R(un) state. Changing to greyscale mode the blending takes ~4msec (as you would expect as this is roughly a third of 11) but top reports the process as now with 0% CPU and permanently in S(leep) state. So an actual CPU resource usage change of a factor of 3 causes huge differences in reported CPU usage. I have yet to get to the bottom of this but I suspect it&amp;#039;s to do with scheduling somewhere along the line and that maybe the greyscale processing will fit into one scheduling time slice whereas the colour one won&amp;#039;t but I have no evidence of this yet!&lt;br /&gt;
&lt;br /&gt;
===Why is the timeline view all messed up?===&lt;br /&gt;
&lt;br /&gt;
The timeline view is a new view allowing you to see a graph of alarm activity over time and to quickly scan and home in on events of interest. However this feature is highly complex and still in beta. It is based extensively on HTML div tags, sometimes lots of them. Whilst FireFox is able to render this view successfully other browsers, particular Internet Explorer do not seem able to cope and so present a messed up view, either always or when there are a lot of events.&lt;br /&gt;
Using the timeline view is only recommended when using FireFox, however even then there may be issues.&lt;br /&gt;
&lt;br /&gt;
===How much Hard Disk Space / Bandwidth do I need for ZM?===&lt;br /&gt;
Please see [http://www.jpwilson.eu/ZM_Utils/ZM%20storage%20calc%20sheet.xls Storage Calc] in excel format&lt;br /&gt;
&lt;br /&gt;
Or go to [http://www.axis.com/techsup/cam_servers/bandwidth/bw_210.htm this link] for the Axis bandwidth calculator. Although this is aimed at Axis cameras it still produces valid results for any kind of IP camera.&lt;br /&gt;
&lt;br /&gt;
As a quick guide I have 4 cameras at 320x240 storing 1 fps except during alarm events. After 1 week 60GB of space in the volume where the events are stored (/var/www/html/zm) has been used.&lt;br /&gt;
&lt;br /&gt;
===Why don&amp;#039;t all my cameras display when I use the Montage view in FireFox?===&lt;br /&gt;
By default FireFox only supports a small number of simultaneous connections. Using the montage view usually requires one persistent connection for each camera plus intermittant 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. This is a simple process and details of how to do it are available from [http://www.zoneminder.com/forums/viewtopic.php?t=4484 this forum thread]. Certain FireFox extensions such as FasterFox may also help to acehive the same result.&lt;br /&gt;
&lt;br /&gt;
===When I try and run ZoneMinder I get lots of audit permission errors in the logs and it won&amp;#039;t start===&lt;br /&gt;
Many Linux distributions nowadays are built with security in mind. One of the latest methods of achieving this is via SELinux (Secure Linux) which controls who is able to run what in a more precise way then traditional accounting and file based permissions ([http://en.wikipedia.org/wiki/Selinux]).&lt;br /&gt;
If you are seeing entries in your system log like:&lt;br /&gt;
&lt;br /&gt;
   Jun 11 20:44:02 kernel: audit(1150033442.443:226): avc: denied { read } for pid=5068&lt;br /&gt;
   comm=&amp;quot;uptime&amp;quot; name=&amp;quot;utmp&amp;quot; dev=dm-0 ino=16908345 scontext=user_u:system_r:httpd_sys_script_t&lt;br /&gt;
   tcontext=user_u:object_r:initrc_var_run_t tclass=file&lt;br /&gt;
&lt;br /&gt;
then it is likely that your system has SELinux enabled and it is preventing ZoneMinder from performaing certain activities. You then have two choices. You can either tune SELinux to permit the required operations or you can disable SELinux entirely which will permit ZoneMinder to run unhindered. Disabling SELinux is usually performed by editing it&amp;#039;s configuration file (e.g., &amp;lt;tt&amp;gt;/etc/selinux/config&amp;lt;/tt&amp;gt;) and then rebooting. However if you run a public server you should read up on the risks associated with disabled Secure Linux before disabling it.&lt;br /&gt;
&lt;br /&gt;
Note that SELinux may cause errors other than those listed above. If you are in any doubt then it can be worth disabling SELinux experimentally to see if it fixes your problem before trying other solutions.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable ZoneMinder&amp;#039;s security? ===&lt;br /&gt;
In the console, click on Options. Check the box next to &amp;quot;ZM_OPT_USE_AUTH&amp;quot;. You will immediately be asked to login. The username is &amp;#039;admin&amp;#039; and the password is &amp;#039;admin&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To Manage Users:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In main console, go to &amp;#039;&amp;#039;&amp;#039;Options-&amp;gt;Users&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Why does ZM stop recording once I have 32000 events for my monitor? ===&lt;br /&gt;
This is a limitation of the ext3 filesystem that most Linux distributions use.&lt;br /&gt;
&lt;br /&gt;
One directory cannot hold more than 32k approx  files. Future versions of ZM will have a deeper filesystem but for now you have to reduce the number of events or use a different filesystems such as reiserfs.&lt;br /&gt;
&lt;br /&gt;
If you search for ext3 or reiserfs on the forums you will find various threads on this issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Managing system load &amp;#039;&amp;#039;(with IP Cameras in mind)&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Zoneminder is a superb application in every way, but it does a job that needs a lot of horsepower especially when using multiple IP cameras. IP Cams require an extra level of processing to analogue cards as the jpg or mjpeg images need to be decoded before analysing. This needs grunt. If you have lots of cameras, you need lots of grunt.&lt;br /&gt;
&lt;br /&gt;
Why do ZM need so much grunt?&lt;br /&gt;
Think what Zoneminder is actually doing. In modect mode ZM is:&lt;br /&gt;
1. Fetching a jpeg from the camera. (Either in single part or multipart stream)&lt;br /&gt;
2. Decoding the jpeg image. &lt;br /&gt;
3. Comparing the zoned selections to the previous image or images and applying rules.&lt;br /&gt;
4. If in alarm state, writing that image to the disk and updating the mysql database.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re capturing at five frames per second, the above is repeated five times every second, multiplied by the number of cameras. Decoding the images is what takes the real power from the processor and this is the main reason why analogue cameras which present an image ready-decoded in memory take less work.&lt;br /&gt;
&lt;br /&gt;
=== How do I know if my computer is overloaded? ===&lt;br /&gt;
If your CPU is running at 100% all the time, it&amp;#039;s probably overloaded (or running at exact optimisation). If the load is consistently high (over 10.0 for a single processor) then Bad Things happen - like lost frames, unrecorded events etc. Occasional peaks are fine, normal and nothing to worry about.&lt;br /&gt;
&lt;br /&gt;
Zoneminder runs on Linux, Linux measures system load using &amp;quot;load&amp;quot;, which is complicated but gives a rough guide on what the computer is doing at any given time. Zoneminder shows Load on the main page (top right) as well as disk space. Typing &amp;quot;uptime&amp;quot; on the command line will give a similar guide, but with three figures to give a fuller measure of what&amp;#039;s happening over a period of time but for the best guide to see what&amp;#039;s happening, install &amp;quot;htop&amp;quot; - which gives easy to read graphs for load, memory and cpu usage.&lt;br /&gt;
&lt;br /&gt;
A load of 1.0 means the processor has &amp;quot;just enough to do right now&amp;quot;. Also worth noting that a load of 4.0 means exactly the same for a quad processor machine - each number equals a single processor&amp;#039;s workload. A very high load can be fine on a computer that has a stacked workload - such as a machine sending out bulk emails, or working its way through a knotty problem; it&amp;#039;ll just keep churning away until it&amp;#039;s done. However - Zoneminder needs to process information in real time so it can&amp;#039;t afford to stack its jobs, it needs to deal with them right away.&lt;br /&gt;
&lt;br /&gt;
For a better and full explanation of Load: http://en.wikipedia.org/wiki/Load_%28computing%29&lt;br /&gt;
&lt;br /&gt;
=== My load is too high, how can I reduce it? ===&lt;br /&gt;
Zoneminder is /very/ tweakable and it&amp;#039;s possible to tune it to compromise. The following are good things to try, in no particular order;&lt;br /&gt;
&lt;br /&gt;
Change the jpeg libraries. In most distributions Linux uses standard jpeg libraries which although fine for most things, don&amp;#039;t use the MMX functions in nearly all modern processors. Check whether your cpu supports mmx by running &amp;quot;cpuid |grep MMX&amp;quot; which should give you a line or two along the lines of &amp;quot;MMX instructions&amp;quot;. If so, give the libs a try. Most people report their load halves simply by using these libs. http://www.zoneminder.com/forums/viewtopic.php?t=6419 gives more info. Nobody&amp;#039;s posted there to say it broke their system... Yet.&lt;br /&gt;
&lt;br /&gt;
If your camera allows you to change image size, think whether you can get away with smaller images. Smaller pics = less load. 320x240 is usually ok for close-up corridor shots.&lt;br /&gt;
&lt;br /&gt;
Go Black and White. Colour pictures use twice to three times the CPU, memory and diskspace but give little benefit to identification.&lt;br /&gt;
&lt;br /&gt;
Reduce frames per second. Halve the fps, halve the workload. If your camera supports fps throttling (Axis do), try that - saves ZM having to drop frames from a stream. 2-5 fps seems to be widely used.&lt;br /&gt;
&lt;br /&gt;
Experiment with using jpeg instead of mjpeg. Some users have reported it gives better performance, but YMMV.&lt;br /&gt;
&lt;br /&gt;
Tweak the zones. Keep them as small and as few as possible. Stick to one zone unless you really need more.&lt;br /&gt;
&lt;br /&gt;
Schedule. If you are running a linux system at near capacity, you&amp;#039;ll need to think carefully about things like backups and scheduled tasks. updatedb - the process which maintains a file database so that &amp;#039;locate&amp;#039; works quickly, is normally scheduled to run once a day and if on a busy system can create a heavy increase on the load. The same is true for scheduled backups, especially those which compress the files. Re-schedule these tasks to a time when the cpu is less likely to be busy, if possible - and also use the &amp;quot;nice&amp;quot; command to reduce their priority. (crontab and /etc/cron.daily/ are good places to start)&lt;br /&gt;
&lt;br /&gt;
Reduce clutter on your PC. Don&amp;#039;t run X unless you really need it, the GUI is a huge overhead in both memory and cpu.&lt;br /&gt;
&lt;br /&gt;
More expensive options:&lt;br /&gt;
&lt;br /&gt;
Increase RAM. If your system is having to use disk swap it will HUGELY impact performance in all areas. Again, htop is a good monitor - but first you need to understand that because Linux is using all the memory, it doesn&amp;#039;t mean it needs it all - linux handles ram very differently to Windows/DOS and caches stuff. htop will show cached ram as a different colour in the memory graph. Also check that you&amp;#039;re actually using a high memory capable kernel - many kernels don&amp;#039;t enable high memory by default. &lt;br /&gt;
&lt;br /&gt;
Faster CPU. Simple but effective. Zoneminder also works very well with multiple processor systems out of the box (if SMP is enabled in your kernel). The load of different cameras is spread across the processors.&lt;br /&gt;
&lt;br /&gt;
=== What about disks and bandwidth? ===&lt;br /&gt;
&lt;br /&gt;
In most modern pc-based servers, disk I/O is more than adequate for the speeds involved in capturing from multiple cameras in most scenarios.&lt;br /&gt;
&lt;br /&gt;
A typical 100mbit LAN will cope with most setups easily. If you&amp;#039;re feeding from cameras over smaller or internet links, obviously fps will be much lower.&lt;br /&gt;
&lt;br /&gt;
Disk and Bandwidth calculators are referenced on the Zoneminder wiki here: http://www.zoneminder.com/wiki/index.php/FAQ#How_much_Hard_Disk_Space_.2F_Bandwidth_do_I_need_for_ZM.3F&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building ZoneMinder ==&lt;br /&gt;
&lt;br /&gt;
=== How do I build for X10 support? ===&lt;br /&gt;
&lt;br /&gt;
You do not need to rebuild ZM for X10 support. You will need to install the perl module and switch on X10 in the options, then restart. Installing the perl module is covered in the README amongst other places but in summary, do:&lt;br /&gt;
&lt;br /&gt;
 perl -MCPAN -eshell&lt;br /&gt;
 install X10::ActiveHome&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending ZoneMinder ==&lt;br /&gt;
&lt;br /&gt;
=== How can I get ZM to do different things at different times of day or week? ===&lt;br /&gt;
If you want to configure ZoneMinder to do motion detection during the day and just record at night, for example, you will need to use ZoneMinder &amp;#039;run states&amp;#039;. A run state is a particular configuration of monitor functions that you want to use at any time.&lt;br /&gt;
&lt;br /&gt;
To save a run state you should first configure your monitors for Modect, Record, Monitor etc as you would want them during one of the times of day. Then click on the running state link at the top of the Console view. This will usually say &amp;#039;Running&amp;#039; or &amp;#039;Stopped&amp;#039;. You will then be able to save the current state and give it a name, &amp;#039;Daytime&amp;#039; for example. Now configure your monitors how you would want them during other times of day and save that, for instance as &amp;#039;Nighttime&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Now you can switch between these two states by selecting them from the same dialog you saved them, or from the command line from issue the command &amp;#039;&amp;#039;zmpkg.pl &amp;lt;run state&amp;gt;&amp;#039;&amp;#039;, for example &amp;#039;&amp;#039;zmpkg.pl Daytime&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The final step you need to take, is scheduling the time the changes take effect. For this you can use [http://en.wikipedia.org/wiki/Cron cron]. A simple entry to change to the Daylight state at at 8am and to the nighttime state at 8pm would be as follows,&lt;br /&gt;
&amp;lt;pre&amp;gt;0 8 * * * /usr/local/bin/zmpkg.pl Daytime&lt;br /&gt;
0 20 * * * /usr/local/bin/zmpkg.pl Nighttime&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the example above describes changing states at different times of day, the same principle can equally be applied to days of the week or other more arbitrary periods.&lt;br /&gt;
&lt;br /&gt;
For an alternative method of time controlling ZoneMinder, forum user &amp;#039;voronwe&amp;#039; has created a more interactive calendar style integration. Details of this can be found in this [http://www.zoneminder.com/forums/viewtopic.php?t=6519 forum thread]. If you would like to find out more about this contribution please post on this thread.&lt;br /&gt;
&lt;br /&gt;
=== How can I use ZoneMinder to trigger something else when there is an alarm? ===&lt;br /&gt;
ZoneMinder includes a perl API which means you can create a script to interact with the ZM shared memory data and use it in your own scripts to react to ZM alarms or to trigger ZM to generate new alarms. Full details are in the README or by doing &amp;#039;perdoc ZoneMinder&amp;#039;, &amp;#039;perldoc ZoneMinder::SharedMem&amp;#039; etc.&lt;br /&gt;
Below is an example script that checks all monitors for alarms and when one occurs, prints a message to the screen. You can add in your own code to make this reaction a little more useful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/usr/bin/perl -w&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use ZoneMinder;&lt;br /&gt;
&lt;br /&gt;
$| = 1;&lt;br /&gt;
&lt;br /&gt;
zmDbgInit( &amp;quot;myscript&amp;quot;, level=&amp;gt;0, to_log=&amp;gt;0, to_syslog=&amp;gt;0, to_term=&amp;gt;1 );&lt;br /&gt;
&lt;br /&gt;
my $dbh = DBI-&amp;gt;connect( &amp;quot;DBI:mysql:database=&amp;quot;.ZM_DB_NAME.&amp;quot;;host=&amp;quot;.ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );&lt;br /&gt;
&lt;br /&gt;
my $sql = &amp;quot;select M.*, max(E.Id) as LastEventId from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Function != &amp;#039;None&amp;#039; group by (E.MonitorId)&amp;quot;;&lt;br /&gt;
my $sth = $dbh-&amp;gt;prepare_cached( $sql ) or die( &amp;quot;Can&amp;#039;t prepare &amp;#039;$sql&amp;#039;: &amp;quot;.$dbh-&amp;gt;errstr() );&lt;br /&gt;
&lt;br /&gt;
my $res = $sth-&amp;gt;execute() or die( &amp;quot;Can&amp;#039;t execute &amp;#039;$sql&amp;#039;: &amp;quot;.$sth-&amp;gt;errstr() );&lt;br /&gt;
my @monitors;&lt;br /&gt;
while ( my $monitor = $sth-&amp;gt;fetchrow_hashref() )&lt;br /&gt;
{&lt;br /&gt;
    push( @monitors, $monitor );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
while( 1 )&lt;br /&gt;
{&lt;br /&gt;
    foreach my $monitor ( @monitors )&lt;br /&gt;
    {&lt;br /&gt;
        next if ( !zmShmVerify( $monitor ) );&lt;br /&gt;
 &lt;br /&gt;
        if ( my $last_event_id = zmHasAlarmed( $monitor, $monitor-&amp;gt;{LastEventId} ) )&lt;br /&gt;
        {&lt;br /&gt;
            $monitor-&amp;gt;{LastEventId} = $last_event_id;&lt;br /&gt;
            print( &amp;quot;Monitor &amp;quot;.$monitor-&amp;gt;{Name}.&amp;quot; has alarmed\n&amp;quot; );&lt;br /&gt;
            #&lt;br /&gt;
            # Do your stuff here&lt;br /&gt;
            #&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    sleep( 1 );&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Trouble Shooting==&lt;br /&gt;
Here are some things that will help you track down whats wrong.&lt;br /&gt;
This is also how to obtain the info that we need to help you on the forums.&lt;br /&gt;
&lt;br /&gt;
===What logs should I check for errors?===&lt;br /&gt;
ZoneMinder creates its own logs and are usually located in the &amp;lt;tt&amp;gt;/tmp&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The ZoneMinder logs for the RPM packages are located in &amp;lt;tt&amp;gt;/var/log/zm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Depending on your problem errors can show up in any of these logs but, usually the logs of interest are &amp;lt;tt&amp;gt;zmdc.log&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;zmpkg.log&amp;lt;/tt&amp;gt; if ZM is not able to start.&lt;br /&gt;
&lt;br /&gt;
Now since ZM is dependent on other components to work, you might not find errors in ZM but in the other components.&lt;br /&gt;
Other logs of interest are:&amp;lt;tt&amp;gt;&lt;br /&gt;
*/var/log/messages and/or /var/log/syslog&lt;br /&gt;
*/var/log/dmesg&lt;br /&gt;
*/var/log/httpd/error_log&amp;lt;/tt&amp;gt; (RedHat/Fedora) or &amp;lt;tt&amp;gt;/var/log/apache2/error_log&lt;br /&gt;
*/var/log/mysqld.log&amp;lt;/tt&amp;gt; (Errors here don&amp;#039;t happen very often but just in case)&lt;br /&gt;
&lt;br /&gt;
If ZM is not functioning, you should always be able to find an error in at least one of these logs. Use the [[tail]] command to get info from the logs. This can be done like so: &lt;br /&gt;
&lt;br /&gt;
  tail -f /var/log/messages /var/log/httpd/error_log /var/log/zm/zm*.log&lt;br /&gt;
&lt;br /&gt;
This will append any data entered to any of these logs to your console screen (&amp;lt;tt&amp;gt;-f&amp;lt;/tt&amp;gt;). To exit, hit [ctrl -c].&lt;br /&gt;
&lt;br /&gt;
===How can I trouble shoot the hardware and/or software?===&lt;br /&gt;
Here are some commands to get information about your hardware. Some commands are distribution dependent.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[lspci]] -vv&amp;lt;/tt&amp;gt; -- Returns lots of detailed info. Check for conflicting interrupts or port assignments. You can sometimes alter interrupts/ ports in bios. Try a different pci slot to get a clue if it is HW conflict (comand provided by the pciutils package).&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[scanpci]] -v&amp;lt;/tt&amp;gt;  -- Gives you information from your hardware EPROM&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[lsusb]] -vv&amp;lt;/tt&amp;gt; -- Returns lots of detail about USB devices (camand provided by usbutils package).&lt;br /&gt;
* &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; -- Shows you how your hardware initialized (or didn&amp;#039;t) on boot-up. You will get the most use of this.&lt;br /&gt;
* &amp;lt;tt&amp;gt;v4l-info&amp;lt;/tt&amp;gt; -- to see how driver is talking to card. look for unusual values.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[modinfo bttv]]&amp;lt;/tt&amp;gt; -- some bttv driver stats.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[zmu]]  -m 0 -q -v&amp;lt;/tt&amp;gt; -- Returns various information regarding a monitor configuration.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ipcs]] &amp;lt;/tt&amp;gt;  -- Provides information on the ipc facilities for which the calling process has read acccess.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ipcrm]] &amp;lt;/tt&amp;gt;  -- The ipcrm command can be used to remove an IPC object from the kernel.&lt;br /&gt;
&lt;br /&gt;
===I am getting messages about a backtrace in my logs, what do I do?===&lt;br /&gt;
If you are seeing entries in your log like the following&lt;br /&gt;
&amp;lt;pre&amp;gt;Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6 [0x3347230210]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6(memset+0xce) [0x334727684e]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x40ee9a]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x419946]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x4213cf]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma(cos+0x35c) [0x404674]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6(__libc_start_main+0xf4) [0x334721da44]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma(cos+0xd1) [0x4043e9]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: INF [Backtrace complete]&amp;lt;/pre&amp;gt;&lt;br /&gt;
then you can help diagnose the problem by running a special command to translate the hex addresses into helpful information. This command is called addr2line and you can type &amp;#039;man addr2line&amp;#039; for more information.&lt;br /&gt;
Basically addr2line takes two sets of parameters, the first is the name of the binary file, and the second is a list of addresses. Both of these pieces of information are displayed in the logs. The filename is the first part after the &amp;#039;Backtrace:&amp;#039; tag, in this case /usr/local/bin/zma, though it may well be different in your case. Some of the lines refer to libraries rather than the zma executable but those can be ignored for now, the important part is noting which ZM binary is involved. The binary file is passed in following the -e flag. The addresses to pass to addr2line are those contained in the &amp;#039;[]&amp;#039; pairs. Again you can ignore those that are on a line that refers to a library but it will not hurt if you include them.&lt;br /&gt;
So in the example above, the command would be &amp;lt;pre&amp;gt;addr2line -e /usr/local/bin/zma 0x40ee9a 0x419946 0x4213cf 0x404674 0x4043e9&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should then dump out a more symbolic list containing source file names and line numbers, and it is this information which will be helpful if posted to the forums. Sometimes addr2line fails to produce useful output. This is usually because either the problem is so severe that it has corrupted the stack and prevented useful information from being displayed, or that you have either compiled ZM without the -g flag for debug, or you have stripped the binaries of symbol information after installation. This this case you would need to rebuild temporarily with debug enabled for the information to be useful.&lt;br /&gt;
&lt;br /&gt;
===How do I repair the MySQL Database?===&lt;br /&gt;
There is two ways to go about this. In most cases you can run from the command prompt -&amp;gt;&lt;br /&gt;
* mysqlcheck --all-databases --auto-repair -p&amp;#039;&amp;#039;&amp;#039;your_database_password&amp;#039;&amp;#039;&amp;#039; -u &amp;#039;&amp;#039;&amp;#039;your_databse_user&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If that does not work then you will have to make sure that ZoneMinder is stopped then run the following (nothing should be using the database while running this and you will have to adjust for your correct path if it is different). -&amp;gt;&lt;br /&gt;
* myisamchk --silent --force --fast --update-state -O key_buffer=64M -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M /var/lib/mysql/*/*.MYI &lt;br /&gt;
&lt;br /&gt;
===I upgraded by distribution and ZM stopped working===&lt;br /&gt;
Some possibilties (Incomplete list and subject to correction)&lt;br /&gt;
#[[/usr/local/bin/zmfix: /usr/lib/libmysqlclient.so.15: version `MYSQL_5.0&amp;#039; not found (required by /usr/local/bin/zmfix)]]  :: Solution: Recompile and reinstall Zoneminder.&lt;br /&gt;
Any time you update a major version that ZoneMinder depends on, you need to recompile ZoneMinder.&lt;/div&gt;</summary>
		<author><name>Nelsda</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=FAQ&amp;diff=1912</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=FAQ&amp;diff=1912"/>
		<updated>2007-03-14T07:00:42Z</updated>

		<summary type="html">&lt;p&gt;Nelsda: /* How much Hard Disk Space / Bandwidth do I need for ZM? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ZoneMinder Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
This is the new FAQ page. I will be migrating the existing FAQs here as soon as possible. In the meantime the old FAQ page is available [http://www.zoneminder.com/faq.html here].&lt;br /&gt;
&lt;br /&gt;
Feel free to contribute any FAQs that you think are missing.&lt;br /&gt;
&lt;br /&gt;
===How can I stop ZoneMinder filling up my disk?===&lt;br /&gt;
&lt;br /&gt;
Recent versions of ZoneMinder come with a filter you can use for this purpose already included. However &amp;#039;&amp;#039;&amp;#039;by default it is not enabled for event deletion&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The filter is called &amp;#039;&amp;#039;PurgeWhenFull&amp;#039;&amp;#039; 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.&lt;br /&gt;
&lt;br /&gt;
This will bring up an event listing and a filter window.&lt;br /&gt;
&lt;br /&gt;
In the filter window there is a dropdown select box labelled &amp;#039;Use Filter&amp;#039;, that lets your select a saved filter. Select &amp;#039;PurgeWhenFull&amp;#039; and it will load that filter.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
Then click on &amp;#039;Save&amp;#039; which will bring up a new window. Make sure the &amp;#039;Automatically delete&amp;#039; box is checked and press save to save your filter. This will then run in the background to keep your disk within those limits.&lt;br /&gt;
&lt;br /&gt;
After you&amp;#039;ve done that, you changes will automatically be loaded into zmfilter within a few minutes.&lt;br /&gt;
&lt;br /&gt;
Check the &amp;lt;tt&amp;gt;zmfilter.log&amp;lt;/tt&amp;gt; file to make sure it is running as sometimes missing perl modules mean that it nevers runs but people don&amp;#039;t always realise.&lt;br /&gt;
&lt;br /&gt;
===What does a &amp;#039;Can&amp;#039;t shmget: Invalid argument&amp;#039; error in my logs mean?===&lt;br /&gt;
&lt;br /&gt;
This error is discussed in the README in the following excerpt:-&lt;br /&gt;
&amp;#039;&amp;#039;...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.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can often find out how much shared memory is available by typing the following :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/sys/kernel/shmall&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the most you can allocate in one go :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/sys/kernel/shmmax&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change these values type (for example) :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo 134217728 &amp;gt;/proc/sys/kernel/shmall &amp;amp;&amp;amp; echo 134217728 &amp;gt;/proc/sys/kernel/shmmax&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; and add the following lines (for example) :-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;kernel.shmall = 134217728&lt;br /&gt;
kernel.shmmax = 134217728&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which will enforce the changes the next time your machine is restarted.&lt;br /&gt;
&lt;br /&gt;
===Why can&amp;#039;t I see streamed images when I can see stills in the Zone window etc?===&lt;br /&gt;
&lt;br /&gt;
This issue is normally down to one of two causes&lt;br /&gt;
&lt;br /&gt;
1) You are using Internet Explorer and are trying to view multi-part jpeg streams. IE does not support these streams directly, unlike most other browsers. You will need to install Cambozola or another multi-part jpeg aware pluging to view them. To do this you will need to obtain the applet from the Downloads page and install the cambozola.jar file in the same directly as the ZoneMinder php files. Then find the ZoneMinder Options-&amp;gt;Images page and enable ZM_OPT_CAMBOZOLA and enter the web path to the .jar file in ZM_PATH_CAMBOZOLA. This will ordinarily just be cambozola.jar. Provided ZM_CAN_STREAM is set to auto and ZM_STREAM_METHOD is set to jpeg then Cambozola should be loaded next time you try and view a stream.&lt;br /&gt;
2) The other common cause for being unable to view streams is that you have installed the ZoneMinder cgi binaries (zms and nph-zms) in a different directory than your web server is expecting. Make sure that the --with-cgidir option you use to the ZoneMinder configure script is the same as the CGI directory configure for your web server. If you are using Apache, which is the most common one, then in your httpd.conf file there should be a line like &amp;lt;pre&amp;gt;ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&amp;lt;/pre&amp;gt; where the last directory in the quotes is the one you have specified. If not then change one or the other to match. Be warned that configuring apache can be complex so changing the one passed to the ZoneMinder configure (and then rebuilding and reinstalling) is recommended in the first instance. If you change the apache config you will need to restart apache for the changes to take effect. If you still cannot see stream reliably then try changing Options-&amp;gt;Paths-&amp;gt;ZM_PATH_ZMS to just use zms if nph-zms is specified, or vice versa. Also check in your apache error logs.&lt;br /&gt;
&lt;br /&gt;
===I have several monitors configured but when I load the Montage view in FireFox why can I only see two?===&lt;br /&gt;
&lt;br /&gt;
By default FireFox only allows a limited number of simultaneous connections to a particular web server. To view a montage with X cameras you need at least X connections. To resolve this situation, follow the instructions below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Enter about:config in the address bar&lt;br /&gt;
&lt;br /&gt;
scroll down to&lt;br /&gt;
browser.cache.check_doc_frequency 3&lt;br /&gt;
change the 3 to a 1&lt;br /&gt;
&lt;br /&gt;
browser.cache.disk.enable True -&amp;gt; False&lt;br /&gt;
network.http.max-connections-per-server -&amp;gt; put a value of 100&lt;br /&gt;
network.http.max-persistent-connections-per-proxy -&amp;gt; 100 again&lt;br /&gt;
network.http.max-persistent-connections-per-server -&amp;gt; 100 again&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Why is ZoneMinder using so much CPU?===&lt;br /&gt;
&lt;br /&gt;
The various elements of ZoneMinder can be involved in some pretty intensive activity, especially while analysing images for motion. However generally this should not overwhelm your machine unless it is very old or underpowered.&lt;br /&gt;
&lt;br /&gt;
There are a number of specific reasons why processor loads can be high either by design or by accident. To figure out exactly what is causing it in your circumstances requires a bit of expermentation.&lt;br /&gt;
&lt;br /&gt;
The main causes are.&lt;br /&gt;
&lt;br /&gt;
# Using a video palette other than greyscale or RGB24. This can cause a relatively minor performace hit, though still significant. Although some cameras and cards require using planar palettes ZM currently doesn&amp;#039;t support this format internally (yet) and each frame is converted to an RGB representation prior to processing. Unless you have compelling reasons for using YUV or reduced RGB type palettes such as hitting USB transfer limits I would experiment to see if RGB24 or greyscale is quicker. Put your monitors into &amp;#039;Monitor&amp;#039; mode so that only the capture daemons are running and monitor the process load of these (the &amp;#039;zmc&amp;#039; processes) using top. Try it with various palettes to see if it makes a difference.&lt;br /&gt;
# Big image sizes. A image of 640x480 requires at least four times the processing of a 320x240 image. Experiment with different sizes to see what effect it may have. Sometimes a large image is just two interlaced smaller frames so has no real benefit anyway.&lt;br /&gt;
# Capture frame rates. Unless there&amp;#039;s a compelling reason in your case there is often little benefit in running cameras at 25fps when 5-10fps would often get you results just as good. Try changing your monitor settings to limit your cameras to lower frames rates. You can still configure ZM to ignore these limits and capture as fast as possible when an event is detected.&lt;br /&gt;
# Run function. Obviously running in Record or Mocord modes or in Modect with lots of events generates a lot of DB and file activity and so CPU and load will increase.&lt;br /&gt;
# Basic default detection zones. By default when a camera is added one detection zone is added which covers the whole image with a default set of parameters. If you camera covers a view in which various regions are unlikely to generate a valid alarm (ie the sky) then I would experiment with reducing the zone sizes or adding inactive zones to blank out areas you don&amp;#039;t want to monitor. Additionally the actual settings of the zone themselves may not be optimal. When doing motion detection the number of changed pixels above a threshold is examined, then this is filter, then contiguous regions are calculated to see if an alarm is generated. If any maximum or minimum threshold is exceeded according to your zone settings at any time the calculation stops. If your settings always result in the calculations going through to the last stage before being failed then additional CPU time is used unnecessarily. Make sure your maximum and minimumzone thresholds are set to sensible values and experiment by switching RECORD_EVENT_STATS on and seeing what the actual values of alarmed pixels etc are during sample events.&lt;br /&gt;
# Optimise your settings. After you&amp;#039;ve got some settings you&amp;#039;re happy with then switching off RECORD_EVENT_STATS will prevent the statistics being written to the database which saves some time. Other settings which might make a difference are ZM_FAST_RGB_DIFFS, ZM_OPT_FRAME_SERVER and the JPEG_xxx_QUALITY ones.&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m sure there are other things which might make a difference such as what else you have running on the box and memory sizes (make sure there&amp;#039;s no swapping going on). Also speed of disk etc will make some difference during event capture and also if you are watching the whole time then you may have a bunch of zms processes running also.&lt;br /&gt;
&lt;br /&gt;
I think the biggest factors are image size, colour depth and capture rate. Having said that I also don&amp;#039;t always know why you get certains results from &amp;#039;top&amp;#039;. For instance if I have a &amp;#039;zma&amp;#039; daemon running for a monitor that is capturing an image. I&amp;#039;ve commented out the actual analysis so all it&amp;#039;s doing is blending the image with the previous one. In colour mode this takes ~11 milliseconds per frame on my system and the camera is capturing at ~10fps. Using &amp;#039;top&amp;#039; this reports the process as using ~5% of CPU and permanently in R(un) state. Changing to greyscale mode the blending takes ~4msec (as you would expect as this is roughly a third of 11) but top reports the process as now with 0% CPU and permanently in S(leep) state. So an actual CPU resource usage change of a factor of 3 causes huge differences in reported CPU usage. I have yet to get to the bottom of this but I suspect it&amp;#039;s to do with scheduling somewhere along the line and that maybe the greyscale processing will fit into one scheduling time slice whereas the colour one won&amp;#039;t but I have no evidence of this yet!&lt;br /&gt;
&lt;br /&gt;
===Why is the timeline view all messed up?===&lt;br /&gt;
&lt;br /&gt;
The timeline view is a new view allowing you to see a graph of alarm activity over time and to quickly scan and home in on events of interest. However this feature is highly complex and still in beta. It is based extensively on HTML div tags, sometimes lots of them. Whilst FireFox is able to render this view successfully other browsers, particular Internet Explorer do not seem able to cope and so present a messed up view, either always or when there are a lot of events.&lt;br /&gt;
Using the timeline view is only recommended when using FireFox, however even then there may be issues.&lt;br /&gt;
&lt;br /&gt;
===How much Hard Disk Space / Bandwidth do I need for ZM?===&lt;br /&gt;
Please see [http://www.jpwilson.eu/ZM_Utils/ZM%20storage%20calc%20sheet.xls Storage Calc] in excel format&lt;br /&gt;
&lt;br /&gt;
Or go to [http://www.axis.com/techsup/cam_servers/bandwidth/bw_210.htm this link] for the Axis bandwidth calculator. Although this is aimed at Axis cameras it still produces valid results for any kind of IP camera.&lt;br /&gt;
&lt;br /&gt;
As a quick guide I have 4 cameras storing 1 fps except during alarm events. After 1 week 60GB of space in the volume where the events are stored (/var/www/html/zm) has been used.&lt;br /&gt;
&lt;br /&gt;
===Why don&amp;#039;t all my cameras display when I use the Montage view in FireFox?===&lt;br /&gt;
By default FireFox only supports a small number of simultaneous connections. Using the montage view usually requires one persistent connection for each camera plus intermittant 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. This is a simple process and details of how to do it are available from [http://www.zoneminder.com/forums/viewtopic.php?t=4484 this forum thread]. Certain FireFox extensions such as FasterFox may also help to acehive the same result.&lt;br /&gt;
&lt;br /&gt;
===When I try and run ZoneMinder I get lots of audit permission errors in the logs and it won&amp;#039;t start===&lt;br /&gt;
Many Linux distributions nowadays are built with security in mind. One of the latest methods of achieving this is via SELinux (Secure Linux) which controls who is able to run what in a more precise way then traditional accounting and file based permissions ([http://en.wikipedia.org/wiki/Selinux]).&lt;br /&gt;
If you are seeing entries in your system log like:&lt;br /&gt;
&lt;br /&gt;
   Jun 11 20:44:02 kernel: audit(1150033442.443:226): avc: denied { read } for pid=5068&lt;br /&gt;
   comm=&amp;quot;uptime&amp;quot; name=&amp;quot;utmp&amp;quot; dev=dm-0 ino=16908345 scontext=user_u:system_r:httpd_sys_script_t&lt;br /&gt;
   tcontext=user_u:object_r:initrc_var_run_t tclass=file&lt;br /&gt;
&lt;br /&gt;
then it is likely that your system has SELinux enabled and it is preventing ZoneMinder from performaing certain activities. You then have two choices. You can either tune SELinux to permit the required operations or you can disable SELinux entirely which will permit ZoneMinder to run unhindered. Disabling SELinux is usually performed by editing it&amp;#039;s configuration file (e.g., &amp;lt;tt&amp;gt;/etc/selinux/config&amp;lt;/tt&amp;gt;) and then rebooting. However if you run a public server you should read up on the risks associated with disabled Secure Linux before disabling it.&lt;br /&gt;
&lt;br /&gt;
Note that SELinux may cause errors other than those listed above. If you are in any doubt then it can be worth disabling SELinux experimentally to see if it fixes your problem before trying other solutions.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable ZoneMinder&amp;#039;s security? ===&lt;br /&gt;
In the console, click on Options. Check the box next to &amp;quot;ZM_OPT_USE_AUTH&amp;quot;. You will immediately be asked to login. The username is &amp;#039;admin&amp;#039; and the password is &amp;#039;admin&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To Manage Users:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In main console, go to &amp;#039;&amp;#039;&amp;#039;Options-&amp;gt;Users&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Why does ZM stop recording once I have 32000 events for my monitor? ===&lt;br /&gt;
This is a limitation of the ext3 filesystem that most Linux distributions use.&lt;br /&gt;
&lt;br /&gt;
One directory cannot hold more than 32k approx  files. Future versions of ZM will have a deeper filesystem but for now you have to reduce the number of events or use a different filesystems such as reiserfs.&lt;br /&gt;
&lt;br /&gt;
If you search for ext3 or reiserfs on the forums you will find various threads on this issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Managing system load &amp;#039;&amp;#039;(with IP Cameras in mind)&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
Zoneminder is a superb application in every way, but it does a job that needs a lot of horsepower especially when using multiple IP cameras. IP Cams require an extra level of processing to analogue cards as the jpg or mjpeg images need to be decoded before analysing. This needs grunt. If you have lots of cameras, you need lots of grunt.&lt;br /&gt;
&lt;br /&gt;
Why do ZM need so much grunt?&lt;br /&gt;
Think what Zoneminder is actually doing. In modect mode ZM is:&lt;br /&gt;
1. Fetching a jpeg from the camera. (Either in single part or multipart stream)&lt;br /&gt;
2. Decoding the jpeg image. &lt;br /&gt;
3. Comparing the zoned selections to the previous image or images and applying rules.&lt;br /&gt;
4. If in alarm state, writing that image to the disk and updating the mysql database.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re capturing at five frames per second, the above is repeated five times every second, multiplied by the number of cameras. Decoding the images is what takes the real power from the processor and this is the main reason why analogue cameras which present an image ready-decoded in memory take less work.&lt;br /&gt;
&lt;br /&gt;
=== How do I know if my computer is overloaded? ===&lt;br /&gt;
If your CPU is running at 100% all the time, it&amp;#039;s probably overloaded (or running at exact optimisation). If the load is consistently high (over 10.0 for a single processor) then Bad Things happen - like lost frames, unrecorded events etc. Occasional peaks are fine, normal and nothing to worry about.&lt;br /&gt;
&lt;br /&gt;
Zoneminder runs on Linux, Linux measures system load using &amp;quot;load&amp;quot;, which is complicated but gives a rough guide on what the computer is doing at any given time. Zoneminder shows Load on the main page (top right) as well as disk space. Typing &amp;quot;uptime&amp;quot; on the command line will give a similar guide, but with three figures to give a fuller measure of what&amp;#039;s happening over a period of time but for the best guide to see what&amp;#039;s happening, install &amp;quot;htop&amp;quot; - which gives easy to read graphs for load, memory and cpu usage.&lt;br /&gt;
&lt;br /&gt;
A load of 1.0 means the processor has &amp;quot;just enough to do right now&amp;quot;. Also worth noting that a load of 4.0 means exactly the same for a quad processor machine - each number equals a single processor&amp;#039;s workload. A very high load can be fine on a computer that has a stacked workload - such as a machine sending out bulk emails, or working its way through a knotty problem; it&amp;#039;ll just keep churning away until it&amp;#039;s done. However - Zoneminder needs to process information in real time so it can&amp;#039;t afford to stack its jobs, it needs to deal with them right away.&lt;br /&gt;
&lt;br /&gt;
For a better and full explanation of Load: http://en.wikipedia.org/wiki/Load_%28computing%29&lt;br /&gt;
&lt;br /&gt;
=== My load is too high, how can I reduce it? ===&lt;br /&gt;
Zoneminder is /very/ tweakable and it&amp;#039;s possible to tune it to compromise. The following are good things to try, in no particular order;&lt;br /&gt;
&lt;br /&gt;
Change the jpeg libraries. In most distributions Linux uses standard jpeg libraries which although fine for most things, don&amp;#039;t use the MMX functions in nearly all modern processors. Check whether your cpu supports mmx by running &amp;quot;cpuid |grep MMX&amp;quot; which should give you a line or two along the lines of &amp;quot;MMX instructions&amp;quot;. If so, give the libs a try. Most people report their load halves simply by using these libs. http://www.zoneminder.com/forums/viewtopic.php?t=6419 gives more info. Nobody&amp;#039;s posted there to say it broke their system... Yet.&lt;br /&gt;
&lt;br /&gt;
If your camera allows you to change image size, think whether you can get away with smaller images. Smaller pics = less load. 320x240 is usually ok for close-up corridor shots.&lt;br /&gt;
&lt;br /&gt;
Go Black and White. Colour pictures use twice to three times the CPU, memory and diskspace but give little benefit to identification.&lt;br /&gt;
&lt;br /&gt;
Reduce frames per second. Halve the fps, halve the workload. If your camera supports fps throttling (Axis do), try that - saves ZM having to drop frames from a stream. 2-5 fps seems to be widely used.&lt;br /&gt;
&lt;br /&gt;
Experiment with using jpeg instead of mjpeg. Some users have reported it gives better performance, but YMMV.&lt;br /&gt;
&lt;br /&gt;
Tweak the zones. Keep them as small and as few as possible. Stick to one zone unless you really need more.&lt;br /&gt;
&lt;br /&gt;
Schedule. If you are running a linux system at near capacity, you&amp;#039;ll need to think carefully about things like backups and scheduled tasks. updatedb - the process which maintains a file database so that &amp;#039;locate&amp;#039; works quickly, is normally scheduled to run once a day and if on a busy system can create a heavy increase on the load. The same is true for scheduled backups, especially those which compress the files. Re-schedule these tasks to a time when the cpu is less likely to be busy, if possible - and also use the &amp;quot;nice&amp;quot; command to reduce their priority. (crontab and /etc/cron.daily/ are good places to start)&lt;br /&gt;
&lt;br /&gt;
Reduce clutter on your PC. Don&amp;#039;t run X unless you really need it, the GUI is a huge overhead in both memory and cpu.&lt;br /&gt;
&lt;br /&gt;
More expensive options:&lt;br /&gt;
&lt;br /&gt;
Increase RAM. If your system is having to use disk swap it will HUGELY impact performance in all areas. Again, htop is a good monitor - but first you need to understand that because Linux is using all the memory, it doesn&amp;#039;t mean it needs it all - linux handles ram very differently to Windows/DOS and caches stuff. htop will show cached ram as a different colour in the memory graph. Also check that you&amp;#039;re actually using a high memory capable kernel - many kernels don&amp;#039;t enable high memory by default. &lt;br /&gt;
&lt;br /&gt;
Faster CPU. Simple but effective. Zoneminder also works very well with multiple processor systems out of the box (if SMP is enabled in your kernel). The load of different cameras is spread across the processors.&lt;br /&gt;
&lt;br /&gt;
=== What about disks and bandwidth? ===&lt;br /&gt;
&lt;br /&gt;
In most modern pc-based servers, disk I/O is more than adequate for the speeds involved in capturing from multiple cameras in most scenarios.&lt;br /&gt;
&lt;br /&gt;
A typical 100mbit LAN will cope with most setups easily. If you&amp;#039;re feeding from cameras over smaller or internet links, obviously fps will be much lower.&lt;br /&gt;
&lt;br /&gt;
Disk and Bandwidth calculators are referenced on the Zoneminder wiki here: http://www.zoneminder.com/wiki/index.php/FAQ#How_much_Hard_Disk_Space_.2F_Bandwidth_do_I_need_for_ZM.3F&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building ZoneMinder ==&lt;br /&gt;
&lt;br /&gt;
=== How do I build for X10 support? ===&lt;br /&gt;
&lt;br /&gt;
You do not need to rebuild ZM for X10 support. You will need to install the perl module and switch on X10 in the options, then restart. Installing the perl module is covered in the README amongst other places but in summary, do:&lt;br /&gt;
&lt;br /&gt;
 perl -MCPAN -eshell&lt;br /&gt;
 install X10::ActiveHome&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extending ZoneMinder ==&lt;br /&gt;
&lt;br /&gt;
=== How can I get ZM to do different things at different times of day or week? ===&lt;br /&gt;
If you want to configure ZoneMinder to do motion detection during the day and just record at night, for example, you will need to use ZoneMinder &amp;#039;run states&amp;#039;. A run state is a particular configuration of monitor functions that you want to use at any time.&lt;br /&gt;
&lt;br /&gt;
To save a run state you should first configure your monitors for Modect, Record, Monitor etc as you would want them during one of the times of day. Then click on the running state link at the top of the Console view. This will usually say &amp;#039;Running&amp;#039; or &amp;#039;Stopped&amp;#039;. You will then be able to save the current state and give it a name, &amp;#039;Daytime&amp;#039; for example. Now configure your monitors how you would want them during other times of day and save that, for instance as &amp;#039;Nighttime&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Now you can switch between these two states by selecting them from the same dialog you saved them, or from the command line from issue the command &amp;#039;&amp;#039;zmpkg.pl &amp;lt;run state&amp;gt;&amp;#039;&amp;#039;, for example &amp;#039;&amp;#039;zmpkg.pl Daytime&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The final step you need to take, is scheduling the time the changes take effect. For this you can use [http://en.wikipedia.org/wiki/Cron cron]. A simple entry to change to the Daylight state at at 8am and to the nighttime state at 8pm would be as follows,&lt;br /&gt;
&amp;lt;pre&amp;gt;0 8 * * * /usr/local/bin/zmpkg.pl Daytime&lt;br /&gt;
0 20 * * * /usr/local/bin/zmpkg.pl Nighttime&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the example above describes changing states at different times of day, the same principle can equally be applied to days of the week or other more arbitrary periods.&lt;br /&gt;
&lt;br /&gt;
For an alternative method of time controlling ZoneMinder, forum user &amp;#039;voronwe&amp;#039; has created a more interactive calendar style integration. Details of this can be found in this [http://www.zoneminder.com/forums/viewtopic.php?t=6519 forum thread]. If you would like to find out more about this contribution please post on this thread.&lt;br /&gt;
&lt;br /&gt;
=== How can I use ZoneMinder to trigger something else when there is an alarm? ===&lt;br /&gt;
ZoneMinder includes a perl API which means you can create a script to interact with the ZM shared memory data and use it in your own scripts to react to ZM alarms or to trigger ZM to generate new alarms. Full details are in the README or by doing &amp;#039;perdoc ZoneMinder&amp;#039;, &amp;#039;perldoc ZoneMinder::SharedMem&amp;#039; etc.&lt;br /&gt;
Below is an example script that checks all monitors for alarms and when one occurs, prints a message to the screen. You can add in your own code to make this reaction a little more useful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/usr/bin/perl -w&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use ZoneMinder;&lt;br /&gt;
&lt;br /&gt;
$| = 1;&lt;br /&gt;
&lt;br /&gt;
zmDbgInit( &amp;quot;myscript&amp;quot;, level=&amp;gt;0, to_log=&amp;gt;0, to_syslog=&amp;gt;0, to_term=&amp;gt;1 );&lt;br /&gt;
&lt;br /&gt;
my $dbh = DBI-&amp;gt;connect( &amp;quot;DBI:mysql:database=&amp;quot;.ZM_DB_NAME.&amp;quot;;host=&amp;quot;.ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );&lt;br /&gt;
&lt;br /&gt;
my $sql = &amp;quot;select M.*, max(E.Id) as LastEventId from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Function != &amp;#039;None&amp;#039; group by (E.MonitorId)&amp;quot;;&lt;br /&gt;
my $sth = $dbh-&amp;gt;prepare_cached( $sql ) or die( &amp;quot;Can&amp;#039;t prepare &amp;#039;$sql&amp;#039;: &amp;quot;.$dbh-&amp;gt;errstr() );&lt;br /&gt;
&lt;br /&gt;
my $res = $sth-&amp;gt;execute() or die( &amp;quot;Can&amp;#039;t execute &amp;#039;$sql&amp;#039;: &amp;quot;.$sth-&amp;gt;errstr() );&lt;br /&gt;
my @monitors;&lt;br /&gt;
while ( my $monitor = $sth-&amp;gt;fetchrow_hashref() )&lt;br /&gt;
{&lt;br /&gt;
    push( @monitors, $monitor );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
while( 1 )&lt;br /&gt;
{&lt;br /&gt;
    foreach my $monitor ( @monitors )&lt;br /&gt;
    {&lt;br /&gt;
        next if ( !zmShmVerify( $monitor ) );&lt;br /&gt;
 &lt;br /&gt;
        if ( my $last_event_id = zmHasAlarmed( $monitor, $monitor-&amp;gt;{LastEventId} ) )&lt;br /&gt;
        {&lt;br /&gt;
            $monitor-&amp;gt;{LastEventId} = $last_event_id;&lt;br /&gt;
            print( &amp;quot;Monitor &amp;quot;.$monitor-&amp;gt;{Name}.&amp;quot; has alarmed\n&amp;quot; );&lt;br /&gt;
            #&lt;br /&gt;
            # Do your stuff here&lt;br /&gt;
            #&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    sleep( 1 );&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Trouble Shooting==&lt;br /&gt;
Here are some things that will help you track down whats wrong.&lt;br /&gt;
This is also how to obtain the info that we need to help you on the forums.&lt;br /&gt;
&lt;br /&gt;
===What logs should I check for errors?===&lt;br /&gt;
ZoneMinder creates its own logs and are usually located in the &amp;lt;tt&amp;gt;/tmp&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The ZoneMinder logs for the RPM packages are located in &amp;lt;tt&amp;gt;/var/log/zm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Depending on your problem errors can show up in any of these logs but, usually the logs of interest are &amp;lt;tt&amp;gt;zmdc.log&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;zmpkg.log&amp;lt;/tt&amp;gt; if ZM is not able to start.&lt;br /&gt;
&lt;br /&gt;
Now since ZM is dependent on other components to work, you might not find errors in ZM but in the other components.&lt;br /&gt;
Other logs of interest are:&amp;lt;tt&amp;gt;&lt;br /&gt;
*/var/log/messages and/or /var/log/syslog&lt;br /&gt;
*/var/log/dmesg&lt;br /&gt;
*/var/log/httpd/error_log&amp;lt;/tt&amp;gt; (RedHat/Fedora) or &amp;lt;tt&amp;gt;/var/log/apache2/error_log&lt;br /&gt;
*/var/log/mysqld.log&amp;lt;/tt&amp;gt; (Errors here don&amp;#039;t happen very often but just in case)&lt;br /&gt;
&lt;br /&gt;
If ZM is not functioning, you should always be able to find an error in at least one of these logs. Use the [[tail]] command to get info from the logs. This can be done like so: &lt;br /&gt;
&lt;br /&gt;
  tail -f /var/log/messages /var/log/httpd/error_log /var/log/zm/zm*.log&lt;br /&gt;
&lt;br /&gt;
This will append any data entered to any of these logs to your console screen (&amp;lt;tt&amp;gt;-f&amp;lt;/tt&amp;gt;). To exit, hit [ctrl -c].&lt;br /&gt;
&lt;br /&gt;
===How can I trouble shoot the hardware and/or software?===&lt;br /&gt;
Here are some commands to get information about your hardware. Some commands are distribution dependent.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[lspci]] -vv&amp;lt;/tt&amp;gt; -- Returns lots of detailed info. Check for conflicting interrupts or port assignments. You can sometimes alter interrupts/ ports in bios. Try a different pci slot to get a clue if it is HW conflict (comand provided by the pciutils package).&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[scanpci]] -v&amp;lt;/tt&amp;gt;  -- Gives you information from your hardware EPROM&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[lsusb]] -vv&amp;lt;/tt&amp;gt; -- Returns lots of detail about USB devices (camand provided by usbutils package).&lt;br /&gt;
* &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; -- Shows you how your hardware initialized (or didn&amp;#039;t) on boot-up. You will get the most use of this.&lt;br /&gt;
* &amp;lt;tt&amp;gt;v4l-info&amp;lt;/tt&amp;gt; -- to see how driver is talking to card. look for unusual values.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[modinfo bttv]]&amp;lt;/tt&amp;gt; -- some bttv driver stats.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[zmu]]  -m 0 -q -v&amp;lt;/tt&amp;gt; -- Returns various information regarding a monitor configuration.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ipcs]] &amp;lt;/tt&amp;gt;  -- Provides information on the ipc facilities for which the calling process has read acccess.&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[ipcrm]] &amp;lt;/tt&amp;gt;  -- The ipcrm command can be used to remove an IPC object from the kernel.&lt;br /&gt;
&lt;br /&gt;
===I am getting messages about a backtrace in my logs, what do I do?===&lt;br /&gt;
If you are seeing entries in your log like the following&lt;br /&gt;
&amp;lt;pre&amp;gt;Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6 [0x3347230210]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6(memset+0xce) [0x334727684e]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x40ee9a]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x419946]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x4213cf]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma(cos+0x35c) [0x404674]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6(__libc_start_main+0xf4) [0x334721da44]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma(cos+0xd1) [0x4043e9]]&lt;br /&gt;
Jan 11 20:25:22 localhost zma_m2[19051]: INF [Backtrace complete]&amp;lt;/pre&amp;gt;&lt;br /&gt;
then you can help diagnose the problem by running a special command to translate the hex addresses into helpful information. This command is called addr2line and you can type &amp;#039;man addr2line&amp;#039; for more information.&lt;br /&gt;
Basically addr2line takes two sets of parameters, the first is the name of the binary file, and the second is a list of addresses. Both of these pieces of information are displayed in the logs. The filename is the first part after the &amp;#039;Backtrace:&amp;#039; tag, in this case /usr/local/bin/zma, though it may well be different in your case. Some of the lines refer to libraries rather than the zma executable but those can be ignored for now, the important part is noting which ZM binary is involved. The binary file is passed in following the -e flag. The addresses to pass to addr2line are those contained in the &amp;#039;[]&amp;#039; pairs. Again you can ignore those that are on a line that refers to a library but it will not hurt if you include them.&lt;br /&gt;
So in the example above, the command would be &amp;lt;pre&amp;gt;addr2line -e /usr/local/bin/zma 0x40ee9a 0x419946 0x4213cf 0x404674 0x4043e9&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should then dump out a more symbolic list containing source file names and line numbers, and it is this information which will be helpful if posted to the forums. Sometimes addr2line fails to produce useful output. This is usually because either the problem is so severe that it has corrupted the stack and prevented useful information from being displayed, or that you have either compiled ZM without the -g flag for debug, or you have stripped the binaries of symbol information after installation. This this case you would need to rebuild temporarily with debug enabled for the information to be useful.&lt;br /&gt;
&lt;br /&gt;
===How do I repair the MySQL Database?===&lt;br /&gt;
There is two ways to go about this. In most cases you can run from the command prompt -&amp;gt;&lt;br /&gt;
* mysqlcheck --all-databases --auto-repair -p&amp;#039;&amp;#039;&amp;#039;your_database_password&amp;#039;&amp;#039;&amp;#039; -u &amp;#039;&amp;#039;&amp;#039;your_databse_user&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If that does not work then you will have to make sure that ZoneMinder is stopped then run the following (nothing should be using the database while running this and you will have to adjust for your correct path if it is different). -&amp;gt;&lt;br /&gt;
* myisamchk --silent --force --fast --update-state -O key_buffer=64M -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M /var/lib/mysql/*/*.MYI &lt;br /&gt;
&lt;br /&gt;
===I upgraded by distribution and ZM stopped working===&lt;br /&gt;
Some possibilties (Incomplete list and subject to correction)&lt;br /&gt;
#[[/usr/local/bin/zmfix: /usr/lib/libmysqlclient.so.15: version `MYSQL_5.0&amp;#039; not found (required by /usr/local/bin/zmfix)]]  :: Solution: Recompile and reinstall Zoneminder.&lt;br /&gt;
Any time you update a major version that ZoneMinder depends on, you need to recompile ZoneMinder.&lt;/div&gt;</summary>
		<author><name>Nelsda</name></author>
	</entry>
</feed>