Zmxap

From ZoneMinder Wiki
Revision as of 16:46, 14 June 2006 by Gliming (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

zmxap is an integration utility used to connect zoneminder with other (typically home automation) programs via the network protocol, xAP. zmxap is bidirectional--sending alarm event information and accepting control requests to alter zoneminder operation. zmxap is written in Perl and because of its interface with zoneminder must be run on the same system that hosts zoneminder. It is run "stand alone" and is therefore executed separate from zoneminder.

Features

  • regularly reports each monitor's operating mode
  • reports alarm starts
  • reports alarm endings--including duration and all event information reportable (e.g., frame count, score)
  • reports alarm telemetry (center position) at regular intervals during an alarm
  • sends user customizable messages (for display on computers, VCD displays, etc)
  • accepts alarm start, stop and suspend requests

Installation and Configuration

Installation/Running

  • Download a zmxap "tarball" and untar into an appropriate location. A recommended practice is to place it in /usr/local/zmxap.
  • Optionally, install a xAP hub. (IMPORTANT: if you do not want or need a xAP hub, you must declare nohub=1 in the zmxap configuration (zmxap.conf) file). A stand-alone xAP hub can be found at Patrick Lidstone's xAP site.
  • zmxap must be started with equivalent access/privs as the user that executes zm. Most installations use apache as this user. Alternatively, zmxap may be run as root.
  • zmxap must be executed at the command line or via a startup script. zmxap will continuously monitor for zm execution and begin polling zm when it is running.
  • Start zmxap via the command "./zmxap.pl" (w/o the quotes)
IMPORTANT: If you are starting zmxap from a directory other than its installation, you must pass the path to its location. For example:
/usr/local/zmxap/zmxap.pl -path=/usr/local/zmxap &
More precise control over the lib location and config file location exists via the lib and config arguments.
  • All logging is sent to /tmp/zmxap.log by default. You can monitor zmxap during execution using the command
tail -f /tmp/zmxap.log

Configuration

Locate zmxap.conf.conf included as a sample in the release and copy to zmxap.conf. Uncomment any properties that you wish to override. Commented properties show the default values. Additional notes are included as comments.

For each monitor that you want to report or control ...

  1. Click on the monitor "source" link and leave on Monitor tab
  2. Select the Enabled checkbox if you want to be able to start and stop (or cancel) alarms via xAP; otherwise leave as is
  3. Alter the function of the monitor to be either: (i) Modect, (ii) Record or (iii) Mocord *if* you want to be able to start and stop the zm motion analysis via xAP messages (Note: each of these modes automatically starts w/ zm analysis or recording enabled)
Consider selecting (iv) Nodect if you don't want zm to perform any motion analysis, but do want to control alarms via xAP.

To be able to report x/y alarm center-position updates via xAP ...

  1. Open global options window and leave at System tab
  2. Check the ZM_OPT_CONTROL box (regardless of whether your cameras are PTZ)
  3. For each monitor to report, click on the monitor "source" link and select the Control tab
  4. Check the "Track Motion" check box

To be able to include URLs in the web portion of the message.display xAP message, you must specify the path to zm.

  1. Open the global options window and select the Email tab
  2. Enter the URL to your zm installation in ZM_URL (e.g., http://192.168.0.2 or http://192.168.0.2/zm. Do not include any trailing slash)