Bug 232 - Revamped config and build methodology
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1676 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
6adbd44d77
commit
b7cbe133d9
|
@ -15,9 +15,7 @@ SUBDIRS = \
|
|||
|
||||
EXTRA_DIST = \
|
||||
zmconfig.pl.in \
|
||||
zmconfig_eml.txt \
|
||||
zmconfig_msg.txt \
|
||||
zm.conf.z \
|
||||
zm.conf.in \
|
||||
README.html \
|
||||
README.pdf \
|
||||
README.rtf
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
AC_DEFUN([AC_DEFINE_DIR], [
|
||||
prefix_NONE=
|
||||
exec_prefix_NONE=
|
||||
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
|
||||
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
|
||||
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
|
||||
dnl refers to ${prefix}. Thus we have to use `eval' twice.
|
||||
eval ac_define_dir="\"[$]$2\""
|
||||
eval ac_define_dir="\"$ac_define_dir\""
|
||||
AC_SUBST($1, "$ac_define_dir")
|
||||
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
|
||||
test "$prefix_NONE" && prefix=NONE
|
||||
test "$exec_prefix_NONE" && exec_prefix=NONE
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_PROG_PERL_VERSION],[dnl
|
||||
# Make sure we have perl
|
||||
if test -z "$PERL"; then
|
||||
AC_CHECK_PROG(PERL,perl,perl)
|
||||
fi
|
||||
|
||||
# Check if version of Perl is sufficient
|
||||
ac_perl_version="$1"
|
||||
|
||||
if test "x$PERL" != "x"; then
|
||||
AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version)
|
||||
# NB: It would be nice to log the error if there is one, but we cannot rely
|
||||
# on autoconf internals
|
||||
$PERL -e "use $ac_perl_version;" > /dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_RESULT(no);
|
||||
$3
|
||||
else
|
||||
AC_MSG_RESULT(ok);
|
||||
$2
|
||||
fi
|
||||
else
|
||||
AC_MSG_WARN(could not find perl)
|
||||
fi
|
||||
])dnl
|
||||
|
||||
AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
|
||||
ac_perl_modules="$1"
|
||||
# Make sure we have perl
|
||||
if test -z "$PERL"; then
|
||||
AC_CHECK_PROG(PERL,perl,perl)
|
||||
fi
|
||||
|
||||
if test "x$PERL" != x; then
|
||||
ac_perl_modules_failed=0
|
||||
for ac_perl_module in $ac_perl_modules; do
|
||||
AC_MSG_CHECKING(for perl module $ac_perl_module)
|
||||
|
||||
# Would be nice to log result here, but can't rely on autoconf internals
|
||||
$PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_RESULT(no);
|
||||
ac_perl_modules_failed=1
|
||||
else
|
||||
AC_MSG_RESULT(ok);
|
||||
fi
|
||||
done
|
||||
|
||||
# Run optional shell commands
|
||||
if test "$ac_perl_modules_failed" = 0; then
|
||||
:
|
||||
$2
|
||||
else
|
||||
:
|
||||
$3
|
||||
fi
|
||||
else
|
||||
AC_MSG_WARN(could not find perl)
|
||||
fi])dnl
|
58
configure.in
58
configure.in
|
@ -1,5 +1,6 @@
|
|||
AC_INIT(src/zm.h)
|
||||
AM_INIT_AUTOMAKE(zm,1.22.0)
|
||||
AC_INIT(zm,1.22.0,support@zoneminder.com,ZoneMinder)
|
||||
AC_CONFIG_SRCDIR(src/zm.h)
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
PATH_BUILD=`pwd`
|
||||
|
@ -7,6 +8,24 @@ AC_SUBST(PATH_BUILD)
|
|||
TIME_BUILD=`date +'%s'`
|
||||
AC_SUBST(TIME_BUILD)
|
||||
|
||||
AC_ARG_VAR(ZM_DB_HOST,[Hostname where ZoneMinder database located])
|
||||
AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database])
|
||||
AC_ARG_VAR(ZM_DB_USER,[Name of ZoneMinder database user])
|
||||
AC_ARG_VAR(ZM_DB_PASS,[Password of ZoneMinder database user])
|
||||
|
||||
if test "$ZM_DB_HOST" == ""; then
|
||||
AC_SUBST(ZM_DB_HOST,[localhost])
|
||||
fi
|
||||
if test "$ZM_DB_NAME" == ""; then
|
||||
AC_SUBST(ZM_DB_NAME,[zm])
|
||||
fi
|
||||
if test "$ZM_DB_USER" == ""; then
|
||||
AC_SUBST(ZM_DB_USER,[zmuser])
|
||||
fi
|
||||
if test "$ZM_DB_PASS" == ""; then
|
||||
AC_SUBST(ZM_DB_PASS,[zmpass])
|
||||
fi
|
||||
|
||||
MYSQL_PREFIX=/usr
|
||||
AC_ARG_WITH(mysql,
|
||||
[ --with-mysql=<path> prefix of MySQL installation, default /usr],
|
||||
|
@ -115,7 +134,7 @@ AC_ARG_ENABLE(debug,
|
|||
of ZoneMinder you may use this switch to prevent debug from being compiled in.
|
||||
e.g. --enable-debug=yes or --disable-debug])
|
||||
)
|
||||
if test "$enable_debug" != yes; then
|
||||
if test "$enable_debug" != "yes"; then
|
||||
AC_DEFINE(ZM_DBG_OFF,1,"Whether debug is switched off and compiled out")
|
||||
fi
|
||||
|
||||
|
@ -130,23 +149,46 @@ AC_LANG_CPLUSPLUS
|
|||
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires mysql/mysql.h),)
|
||||
AC_CHECK_HEADERS(pcre/pcre.h,,,)
|
||||
AC_CHECK_HEADERS(pcre.h,,,)
|
||||
AC_CHECK_DECLS(round,,,[#include <math.h>])
|
||||
AC_CHECK_DECLS(strsignal,,,[#include <string.h>])
|
||||
AC_CHECK_DECLS(MD5,,,[#include <openssl/md5.h>])
|
||||
AC_CHECK_DECLS(MD5,,AC_MSG_ERROR(zm requires openssl/md5.h),[#include <openssl/md5.h>])
|
||||
AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(zm requires libjpeg.a))
|
||||
AC_CHECK_LIB(z,compress,,AC_MSG_ERROR(zm requires libz.a))
|
||||
AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a))
|
||||
AC_CHECK_LIB(mysqlclient,mysql_init,,AC_MSG_ERROR(zm requires libmysqlclient.a))
|
||||
AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN(libcrypto.a is required for authenticated streaming))
|
||||
AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for some remote/network camera support))
|
||||
AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support))
|
||||
AC_CHECK_LIB(avutil,ff_gcd,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
|
||||
AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
|
||||
AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming),-lavcodec)
|
||||
|
||||
AC_SUBST(bindir)
|
||||
AC_PROG_PERL_VERSION(5.6.0)
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile web/Makefile web/graphics/Makefile scripts/Makefile db/Makefile zmconfig.pl)
|
||||
AC_PROG_PERL_MODULES(DBI,,AC_MSG_ERROR(zm requires DBI))
|
||||
AC_PROG_PERL_MODULES(DBD::mysql,,AC_MSG_ERROR(zm requires DBD::mysql))
|
||||
AC_PROG_PERL_MODULES(Getopt::Long,,AC_MSG_ERROR(zm requires Getopt::Long))
|
||||
AC_PROG_PERL_MODULES(Time::HiRes,,AC_MSG_ERROR(zm requires Time::HiRes))
|
||||
AC_PROG_PERL_MODULES(Date::Manip,,AC_MSG_ERROR(zm requires Date::Manip))
|
||||
|
||||
AC_CHECK_FILE(zmconfig.txt,,AC_MSG_WARN([Now run 'perl zmconfig.pl' to create your ZoneMinder configuration]))
|
||||
AC_PROG_PERL_MODULES(LWP::UserAgent,,AC_MSG_WARN(LWP::UserAgent is required for PTZ network camera control))
|
||||
AC_PROG_PERL_MODULES(Device::SerialPort,,AC_MSG_WARN(Device::SerialPort is required for RS232/RS485 PTZ camera control))
|
||||
AC_PROG_PERL_MODULES(Net::FTP,,AC_MSG_WARN(Net::FTP is required for automatic event uploading))
|
||||
AC_PROG_PERL_MODULES(Archive::Tar,,AC_MSG_WARN(Archive::Tar may be required for automatic event uploading))
|
||||
AC_PROG_PERL_MODULES(Archive::Zip,,AC_MSG_WARN(Archive::Zip may be required for automatic event uploading))
|
||||
AC_PROG_PERL_MODULES(Net::SMTP,,AC_MSG_WARN(Net::SMTP may be required for automatic event email notification))
|
||||
AC_PROG_PERL_MODULES(MIME::Lite,,AC_MSG_WARN(MIME::Lite may be required for automatic event email notification))
|
||||
AC_PROG_PERL_MODULES(MIME::Entity,,AC_MSG_WARN(MIME::Entity may be required for automatic event email notification))
|
||||
AC_PROG_PERL_MODULES(X10::ActiveHome,,AC_MSG_WARN(X10::ActiveHome is required for X.10 support))
|
||||
|
||||
AC_DEFINE_DIR([BINDIR],[bindir],[Expanded binary directory])
|
||||
AC_DEFINE_DIR([LIBDIR],[libdir],[Expanded library directory])
|
||||
AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory])
|
||||
AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf")
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile web/Makefile web/graphics/Makefile scripts/Makefile db/Makefile)
|
||||
AC_OUTPUT(zm.conf zmconfig.pl src/zm_config.h web/zm_config.php scripts/ZoneMinder/lib/ZoneMinder.pm scripts/zm db/zmschema.sql db/zmdrop.sql)
|
||||
|
||||
AC_CHECK_FILE(scripts/ZoneMinder/Makefile,,[cd scripts/ZoneMinder;perl Makefile.PL])
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
# ==========================================================================
|
||||
#
|
||||
# ZoneMinder Base Configuration, $Date$, $Revision$
|
||||
#
|
||||
# ==========================================================================
|
||||
#
|
||||
# This file is generated by 'configure'. Care should be taken if manually
|
||||
# editing this file as an changes may be overwritten by subsequent configuration
|
||||
# or installations.
|
||||
#
|
||||
|
||||
# Current version of ZoneMinder
|
||||
ZM_VERSION=@VERSION@
|
||||
|
||||
# Path to build directory, used mostly for finding DB upgrade scripts
|
||||
ZM_PATH_BUILD=@PATH_BUILD@
|
||||
|
||||
# Build time, used to record when to trigger various checks
|
||||
ZM_TIME_BUILD=@TIME_BUILD@
|
||||
|
||||
# Path to ZoneMinder binaries
|
||||
ZM_PATH_BIN=@BINDIR@
|
||||
|
||||
# Path to ZoneMinder libraries (none at present, for future use)
|
||||
ZM_PATH_LIB=@LIBDIR@
|
||||
|
||||
# Path to ZoneMinder configuration (this file only at present)
|
||||
ZM_PATH_CONF=@SYSCONFDIR@
|
||||
|
||||
# Path to ZoneMinder web files
|
||||
ZM_PATH_WEB=@WEB_PREFIX@
|
||||
|
||||
# Path to ZoneMinder cgi files
|
||||
ZM_PATH_CGI=@CGI_PREFIX@
|
||||
|
||||
# Username and group that web daemon (httpd/apache) runs as
|
||||
ZM_WEB_USER=@WEB_USER@
|
||||
ZM_WEB_GROUP=@WEB_GROUP@
|
||||
|
||||
# ZoneMinder database hostname or ip address
|
||||
ZM_DB_HOST=@ZM_DB_HOST@
|
||||
|
||||
# ZoneMinder database name
|
||||
ZM_DB_NAME=@ZM_DB_NAME@
|
||||
|
||||
# ZoneMinder database user
|
||||
ZM_DB_USER=@ZM_DB_USER@
|
||||
|
||||
# ZoneMinder database password
|
||||
ZM_DB_PASS=@ZM_DB_PASS@
|
||||
|
528
zmconfig.pl.in
528
zmconfig.pl.in
|
@ -35,23 +35,25 @@ $| = 1;
|
|||
sub Usage
|
||||
{
|
||||
print( "
|
||||
Usage: zmconfig.pl [-f <config file>,--file=<config file>] [-(no)database] [--(no)interactive] [--(no)reprocess]
|
||||
Usage: zmconfig.pl [--(no)interactive] [--(no)reprocess]
|
||||
Parameters are :-
|
||||
-f <config_file>, --file=<config_file> - Use a configuration file other than the default zmconfig.txt
|
||||
-(no)d, --(no)database - Whether the database has already been created, on by default
|
||||
-(no)i, --(no)interactive - Whether to include interactive configuration, on by default
|
||||
-(no)r, --(no)reprocess - Whether to reprocess files, on by default
|
||||
-(no)r, --(no)reprocess - Whether to reprocess files, off by default
|
||||
");
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
my $config_file = "zmconfig.txt";
|
||||
my $config_header = "src/zm_config_defines.h";
|
||||
my $database = !undef;
|
||||
my $interactive = !undef;
|
||||
my $reprocess = !undef;
|
||||
use constant ZM_DB_HOST => "@ZM_DB_HOST@";
|
||||
use constant ZM_DB_NAME => "@ZM_DB_NAME@";
|
||||
use constant ZM_DB_USER => "@ZM_DB_USER@";
|
||||
use constant ZM_DB_PASS => "@ZM_DB_PASS@";
|
||||
|
||||
if ( !GetOptions( 'file=s'=>\$config_file, 'database!'=>\$database, 'interactive!'=>\$interactive, 'reprocess!'=>\$reprocess ) )
|
||||
my $config_header = "src/zm_config_defines.h";
|
||||
my $config_sql = "db/zm_config.sql";
|
||||
my $interactive = undef;
|
||||
my $reprocess = undef;
|
||||
|
||||
if ( !GetOptions( 'interactive!'=>\$interactive, 'reprocess!'=>\$reprocess ) )
|
||||
{
|
||||
Usage();
|
||||
}
|
||||
|
@ -87,127 +89,11 @@ my %types =
|
|||
include => { db_type=>'include', hint=>'local/path/to/file', pattern=>qr|^(.*)?$|, check=>q( -e $1 ), format=>q( $1 ) },
|
||||
);
|
||||
|
||||
# Minor hack to get the right values out of configure.
|
||||
my $prefix = "@prefix@";
|
||||
my $exec_prefix = ${prefix};
|
||||
my $bindir = "${exec_prefix}/bin";
|
||||
|
||||
my @options =
|
||||
(
|
||||
{
|
||||
name => "ZM_VERSION",
|
||||
default => "@VERSION@",
|
||||
description => "ZoneMinder version number, autogenerated do not change",
|
||||
type => $types{string},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_PATH_BUILD",
|
||||
default => "@PATH_BUILD@",
|
||||
description => "ZoneMinder build directory , autogenerated do not change",
|
||||
type => $types{string},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_TIME_BUILD",
|
||||
default => "@TIME_BUILD@",
|
||||
description => "ZoneMinder build time , autogenerated do not change",
|
||||
type => $types{integer},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_CONFIG",
|
||||
default => "@sysconfdir@/zm.conf",
|
||||
description => "Path to the ZoneMinder config file, autogenerated do not change",
|
||||
help => "None",
|
||||
type => $types{abs_path},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_PATH_BIN",
|
||||
default => "$bindir",
|
||||
description => "Path to the ZoneMinder executables, autogenerated do not change",
|
||||
help => "The path where the ZoneMinder executables are installed is set at configure time. This is a readonly option for the purposes of distributing this information around the various binaries and scripts that need to know it. Changing this option here will tend to break things. Instead re-run configure to regenerate the path.",
|
||||
type => $types{abs_path},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_PATH_WEB",
|
||||
default => "@WEB_PREFIX@",
|
||||
description => "Path to the ZoneMinder web files, autogenerated do not change",
|
||||
help => "The path where the ZoneMinder web files are installed is set at configure time. This is a readonly option for the purposes of distributing this information around the various binaries and scripts that need to know it. Changing this option here will tend to break things. Instead re-run configure to regenerate the path.",
|
||||
type => $types{abs_path},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_PATH_CGI",
|
||||
default => "@CGI_PREFIX@",
|
||||
description => "Path to the ZoneMinder cgi files, autogenerated do not change",
|
||||
help => "The path where the ZoneMinder cgi files are installed is set at configure time. This is a readonly option for the purposes of distributing this information around the various binaries and scripts that need to know it. Changing this option here will tend to break things. Instead re-run configure to regenerate the path.",
|
||||
type => $types{abs_path},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_WEB_USER",
|
||||
default => "@WEB_USER@",
|
||||
description => "User name of your httpd daemon user, autogenerated do not change",
|
||||
help => "The user name of your httpd daemon user is set at configure time. This is a readonly option for the purposes of distributing this information around the various binaries and scripts that need to know it. Changing this option here will tend to break things. Instead re-run configure to regenerate the user name.",
|
||||
type => $types{alphanum},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_WEB_GROUP",
|
||||
default => "@WEB_GROUP@",
|
||||
description => "User group of your httpd daemon user, autogenerated do not change",
|
||||
help => "The user group of your httpd daemon user is set at configure time. This is a readonly option for the purposes of distributing this information around the various binaries and scripts that need to know it. Changing this option here will tend to break things. Instead re-run configure to regenerate the user group.",
|
||||
type => $types{alphanum},
|
||||
readonly => 1,
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_DB_SERVER",
|
||||
default => "localhost",
|
||||
description => "Machine on which the database server is running",
|
||||
help => "This is the machine on which you have installed MySQL and which manages the database. For performance and convenience purposes this is usually on the same machine the web server is running on but can be elsewhere. Enter either your hostname or 'localhost' for this machine.",
|
||||
type => $types{hostname},
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_DB_NAME",
|
||||
default => "zm",
|
||||
description => "Database containing the tables",
|
||||
help => "This is the name of the MySQL database that will be used. Normally this will be just 'zm' though if you two or more installs you may wish to keep databases separate. To create this database just run the following command 'mysql < db/zmschema.sql'. You may need to give additional username and password parameters to MySQL to acquire sufficient privileges to create tables.",
|
||||
type => $types{alphanum},
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_DB_USER",
|
||||
default => "",
|
||||
description => "DB user name, needs at least select, insert, update and delete privileges",
|
||||
help => "This is the username of the MySQL user that has privileges to select, insert, update and delete data from your ZoneMinder database. If you have no user available yet you can create one by typing 'mysql mysql' with additional parameters as required to give you access. Then at the prompt type 'grant select,insert,update,delete on <your database name>.* to '<your username>' identified by '<your password>';'. Then type 'quit' to exit. You may also need to type 'mysqladmin reload' to ensure your changes take effect. Note that the username and passwords used here are not related to your Linux login or accounts and should not be the same.",
|
||||
type => $types{alphanum},
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_DB_PASS",
|
||||
default => "",
|
||||
description => "DB user password",
|
||||
help => "This is the password of the MySQL user that has privileges to select, insert, update and delete data from your ZoneMinder database. If you have no user available yet you can create one by typing 'mysql mysql' with additional parameters as required to give you access. Then at the prompt type 'grant select,insert,update,delete on <your database name>.* to '<your username>' identified by '<your password>';'. Then type 'quit' to exit. You may also need to type 'mysqladmin reload' to ensure your changes take effect. Note that the username and passwords used here are not related to your Linux login or accounts and should not be the same.",
|
||||
type => $types{alphanum},
|
||||
category => 'core',
|
||||
},
|
||||
{
|
||||
name => "ZM_LANG_DEFAULT",
|
||||
default => "en_gb",
|
||||
introduction => "You have completed the options that are fixed in compilation. You can now continue and specify the remaining options or press 'x' to exit and save your changes and then edit the remainder from the web interface.",
|
||||
description => "Default language used by web interface",
|
||||
help => "ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language",
|
||||
type => $types{directory},
|
||||
|
@ -885,24 +771,61 @@ my @options =
|
|||
type => $types{email},
|
||||
category => 'mail',
|
||||
},
|
||||
{
|
||||
name => "ZM_EMAIL_FORMAT",
|
||||
default => "zmconfig_eml.txt",
|
||||
description => "The format of the email used to send matching event details",
|
||||
requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ],
|
||||
help => "This option is used to define the file that contains the format of the email that is sent for any events that match the appropriate filters.",
|
||||
type => $types{include},
|
||||
category => 'mail',
|
||||
},
|
||||
{
|
||||
name => "ZM_EMAIL_TEXT",
|
||||
default => "",
|
||||
default => 'subject = "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)"
|
||||
body = "
|
||||
Hello,
|
||||
|
||||
An alarm has been detected on your installation of the ZoneMinder.
|
||||
|
||||
The details are as follows :-
|
||||
|
||||
Monitor : %MN%
|
||||
Event Id : %EI%
|
||||
Duration : %ED%
|
||||
Frames : %EF% (%EFA%)
|
||||
Scores : t%EST% m%ESM% a%ESA%
|
||||
|
||||
This alarm was matched by the %FN% filter and can be viewed at %EPS%
|
||||
|
||||
# %ZP% - The path to your ZoneMinder console
|
||||
# %MN% - The name of the monitor
|
||||
# %MET% - The total number of events for the monitor
|
||||
# %MEH% - The number of events for the monitor in the last hour
|
||||
# %MED% - The number of events for the monitor in the last day
|
||||
# %MEW% - The number of events for the monitor in the last week
|
||||
# %MEM% - The number of events for the monitor in the last month
|
||||
# %MEA% - The number of archived events for the monitor
|
||||
# %MP% - The path to the monitor window
|
||||
# %MPS% - The path to the monitor stream
|
||||
# %MPI% - The path to the monitor recent image
|
||||
# %EP% - The path to the event
|
||||
# %EPS% - The path to the event stream
|
||||
# %EPI% - The path to the event images
|
||||
# %EPI1% - The path to the first alarmed event image
|
||||
# %EPIM% - The path to the (first) event image with the highest score
|
||||
# %EI1% - Attach first alarmed event image
|
||||
# %EIM% - Attach (first) event image with the highest score
|
||||
# %EV% - Attach event mpeg video
|
||||
# %EI% - The id of the event
|
||||
# %EN% - The name of the event
|
||||
# %ET% - The time of the event
|
||||
# %ED% - The duration of the event
|
||||
# %EF% - The number of frames in the event
|
||||
# %EFA% - The number of alarm frames in the event
|
||||
# %EST% - The total score of the event
|
||||
# %ESA% - The average score of the event
|
||||
# %ESM% - The maximum score of the event
|
||||
# %FN% - The name of the current filter that matched
|
||||
# %FP% - The path to the current filter that matched
|
||||
|
||||
ZoneMinder',
|
||||
description => "The text of the email used to send matching event details",
|
||||
requires => [ { name => "ZM_OPT_EMAIL", value => "yes" } ],
|
||||
help => "This option is used to define the content of the email that is sent for any events that match the appropriate filters.",
|
||||
type => $types{text},
|
||||
category => 'mail',
|
||||
readonly => 1,
|
||||
},
|
||||
{
|
||||
name => "ZM_OPT_MESSAGE",
|
||||
|
@ -921,34 +844,16 @@ my @options =
|
|||
type => $types{email},
|
||||
category => 'mail',
|
||||
},
|
||||
{
|
||||
name => "ZM_MESSAGE_FORMAT",
|
||||
default => "zmconfig_msg.txt",
|
||||
description => "The format of the message used to send matching event details",
|
||||
requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ],
|
||||
help => "This option is used to define the file that contains the format of the message that is sent for any events that match the appropriate filters.",
|
||||
type => $types{include},
|
||||
category => 'mail',
|
||||
},
|
||||
{
|
||||
name => "ZM_MESSAGE_TEXT",
|
||||
default => "",
|
||||
default => 'subject = "ZoneMinder: Alarm - %MN%-%EI%"
|
||||
body = "ZM alarm detected - %ED% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.',
|
||||
description => "The text of the message used to send matching event details",
|
||||
requires => [ { name => "ZM_OPT_MESSAGE", value => "yes" } ],
|
||||
help => "This option is used to define the content of the message that is sent for any events that match the appropriate filters.",
|
||||
type => $types{text},
|
||||
category => 'mail',
|
||||
readonly => 1,
|
||||
},
|
||||
#{
|
||||
#name => "ZM_EMAIL_METHOD",
|
||||
#default => "sendmail",
|
||||
#description => "The method your machine uses to send email and messages",
|
||||
#requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ],
|
||||
#help => "ZoneMinder needs to know how to send you the notification emails or messages. This option tell it which method to use, generally sendmail will work if configured correctly on your machine, otherwise choose smtp and then give your mail host address in the next option.",
|
||||
#type => { db_type=>'string', hint=>'sendmail|smtp', pattern=>qr|^(se\|sm)|i, format=>q( $1 =~ /^se/ ? 'sendmail' : 'smtp' ) },
|
||||
#category => 'mail',
|
||||
#},
|
||||
{
|
||||
name => "ZM_NEW_MAIL_MODULES",
|
||||
default => "no",
|
||||
|
@ -962,7 +867,6 @@ my @options =
|
|||
name => "ZM_EMAIL_HOST",
|
||||
default => "localhost",
|
||||
description => "The host address of your SMTP mail server",
|
||||
#requires => [ { name => "ZM_EMAIL_METHOD", value => "smtp" } ],
|
||||
requires => [ { name => "ZM_OPT_EMAIL", value => "yes" }, { name => "ZM_OPT_MESSAGE", value => "yes" } ],
|
||||
help => "If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP's SMTP mail server here.",
|
||||
type => $types{hostname},
|
||||
|
@ -1588,24 +1492,7 @@ foreach my $option ( @options )
|
|||
}
|
||||
}
|
||||
|
||||
my $first_run = !(-s $config_file);
|
||||
|
||||
my $file_option_count = 0;
|
||||
if ( !$first_run || !$database )
|
||||
{
|
||||
$file_option_count = loadOptionsFromFile();
|
||||
}
|
||||
my $db_option_count = 0;
|
||||
if ( $database )
|
||||
{
|
||||
$db_option_count = loadOptionsFromDB();
|
||||
}
|
||||
|
||||
if ( !$interactive && !$file_option_count && !$db_option_count )
|
||||
{
|
||||
print( "Warning: Non-interative mode being used with no existing configuration information.\n" );
|
||||
print( " Using only default values which may not be appropriate or even work.\n" );
|
||||
}
|
||||
my $db_option_count = loadOptionsFromDB();
|
||||
|
||||
if ( $interactive )
|
||||
{
|
||||
|
@ -1732,41 +1619,16 @@ foreach my $option ( @options )
|
|||
$option->{id} = $option_id++;
|
||||
}
|
||||
|
||||
saveOptionsToFile();
|
||||
saveOptionsToDB();
|
||||
|
||||
sub saveOptionsToFile
|
||||
{
|
||||
print( "Saving config to '$config_file'\n" );
|
||||
open( CONFIG, ">$config_file" ) or die( "Can't open options file: $!" );
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
next if ( $option->{readonly} );
|
||||
next if ( $option->{type} == $types{text} );
|
||||
print( CONFIG "Name: $option->{name}\n" );
|
||||
print( CONFIG "Value: $option->{value}\n" );
|
||||
print( CONFIG "Description: $option->{description}\n" );
|
||||
print( CONFIG "\n" );
|
||||
}
|
||||
chmod( 0600, $config_file ) or die( "Can't chmod '$config_file': $!" );
|
||||
close( CONFIG );
|
||||
}
|
||||
|
||||
sub saveOptionsToDB
|
||||
{
|
||||
print( "Saving config to DB\n" );
|
||||
my $dbh = DBI->connect( "DBI:mysql:database=".$options_hash{ZM_DB_NAME}->{value}.";host=".$options_hash{ZM_DB_SERVER}->{value}, $options_hash{ZM_DB_USER}->{value}, $options_hash{ZM_DB_PASS}->{value} );
|
||||
my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );
|
||||
|
||||
if ( !$dbh )
|
||||
{
|
||||
if ( $first_run )
|
||||
{
|
||||
print( "Warning: unable to save options to database. Ignore if database not created yet\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
print( "Error: unable to save options to database: $DBI::errstr\n" );
|
||||
}
|
||||
print( "Error: unable to save options to database: $DBI::errstr\n" );
|
||||
return( 0 );
|
||||
}
|
||||
my $sql = "delete from Config";
|
||||
|
@ -1804,65 +1666,14 @@ sub saveOptionsToDB
|
|||
$dbh->disconnect();
|
||||
}
|
||||
|
||||
sub loadOptionsFromFile
|
||||
{
|
||||
print( "Loading config from '$config_file'\n" );
|
||||
open( CONFIG, "<$config_file" ) or die( "Can't open options file: $!" );
|
||||
local $/ = "\n\n";
|
||||
my $option_count = 0;
|
||||
foreach my $section ( <CONFIG> )
|
||||
{
|
||||
my ( $name, $value, $description ) = $section =~ /Name: (.*)\nValue: (.*)\nDescription: (.*)\n/ms;
|
||||
#print( "Name = '$name'\n" );
|
||||
my $option = $options_hash{$name};
|
||||
if ( !$option )
|
||||
{
|
||||
warn( "No option '$name' found, removing" );
|
||||
next;
|
||||
}
|
||||
if ( defined($value) )
|
||||
{
|
||||
if ( $name eq "ZM_OPT_MPEG" && $value eq "yes" )
|
||||
{
|
||||
$value = "mpeg_encode";
|
||||
}
|
||||
$option->{value} = $value;
|
||||
}
|
||||
$option_count++;;
|
||||
}
|
||||
close( CONFIG );
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
if ( $option->{type} == $types{include} )
|
||||
{
|
||||
open( FILE, $option->{value} ) or die( "Can't open option file '$option->{value}': $!" );
|
||||
local $/;
|
||||
my $content = <FILE>;
|
||||
close( FILE );
|
||||
( my $text_option_name = $option->{name} ) =~ s/FORMAT/TEXT/;
|
||||
my $text_option = $options_hash{$text_option_name};
|
||||
die( "Can't find $text_option_name option for include" ) unless( $text_option );
|
||||
$text_option->{value} = $content;
|
||||
}
|
||||
}
|
||||
return( $option_count );
|
||||
}
|
||||
|
||||
sub loadOptionsFromDB
|
||||
{
|
||||
print( "Loading config from DB\n" );
|
||||
my $dbh = DBI->connect( "DBI:mysql:database=".$options_hash{ZM_DB_NAME}->{value}.";host=".$options_hash{ZM_DB_SERVER}->{value}, $options_hash{ZM_DB_USER}->{value}, $options_hash{ZM_DB_PASS}->{value} );
|
||||
my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );
|
||||
|
||||
if ( !$dbh )
|
||||
{
|
||||
if ( $first_run )
|
||||
{
|
||||
print( "Warning: unable to load options from database. Ignore if database not created yet\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
print( "Error: unable to load options from database: $DBI::errstr\n" );
|
||||
}
|
||||
print( "Error: unable to load options from database: $DBI::errstr\n" );
|
||||
return( 0 );
|
||||
}
|
||||
my $sql = "select * from Config";
|
||||
|
@ -1971,182 +1782,49 @@ if ( $reprocess )
|
|||
|
||||
$last_id = $option->{id};
|
||||
}
|
||||
printf( CFG_HDR_FILE $define_list."\n\n" );
|
||||
printf( CFG_HDR_FILE "#define ZM_MAX_CFG_ID $last_id\n\n" );
|
||||
printf( CFG_HDR_FILE "#define ZM_CFG_DECLARE_LIST \\\n" );
|
||||
printf( CFG_HDR_FILE $declare_list."\n\n" );
|
||||
printf( CFG_HDR_FILE "#define ZM_CFG_ASSIGN_LIST \\\n" );
|
||||
printf( CFG_HDR_FILE $assign_list."\n\n" );
|
||||
print( CFG_HDR_FILE $define_list."\n\n" );
|
||||
print( CFG_HDR_FILE "#define ZM_MAX_CFG_ID $last_id\n\n" );
|
||||
print( CFG_HDR_FILE "#define ZM_CFG_DECLARE_LIST \\\n" );
|
||||
print( CFG_HDR_FILE $declare_list."\n\n" );
|
||||
print( CFG_HDR_FILE "#define ZM_CFG_ASSIGN_LIST \\\n" );
|
||||
print( CFG_HDR_FILE $assign_list."\n\n" );
|
||||
close( CFG_HDR_FILE );
|
||||
|
||||
my @config_files = qw(
|
||||
zm.conf
|
||||
src/zm_config.h
|
||||
web/zm_config.php
|
||||
scripts/zmdc.pl
|
||||
scripts/zmwatch.pl
|
||||
scripts/zmaudit.pl
|
||||
scripts/zmfilter.pl
|
||||
scripts/zmtrigger.pl
|
||||
scripts/zmx10.pl
|
||||
scripts/zmpkg.pl
|
||||
scripts/zmupdate.pl
|
||||
scripts/zmvideo.pl
|
||||
scripts/zmcontrol-pelco-d.pl
|
||||
scripts/zmcontrol-pelco-p.pl
|
||||
scripts/zmcontrol-visca.pl
|
||||
scripts/zmcontrol-kx-hcm10.pl
|
||||
scripts/zmcontrol-axis-v2.pl
|
||||
scripts/zmtrack.pl
|
||||
scripts/zm
|
||||
db/zmschema.sql
|
||||
db/zmdrop.sql
|
||||
);
|
||||
|
||||
foreach my $config_file ( @config_files )
|
||||
print( "Generating '$config_sql'\n" );
|
||||
open( CFG_SQL_FILE, ">$config_sql" ) or die( "Can't open '$config_sql' for writing" );
|
||||
print( CFG_SQL_FILE "-- The file is autogenerated by zmconfig.pl\n" );
|
||||
print( CFG_SQL_FILE "-- Do not edit this file as any changes will be overwritten\n\n" );
|
||||
print( CFG_SQL_FILE "delete from Config;\n\n" );
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
print( "Processing '$config_file'\n" );
|
||||
local $/ = undef;
|
||||
my $config_z_file = $config_file.".z";
|
||||
open( CFG_IN_FILE, $config_z_file ) or die( "Can't open '$config_z_file' for reading" );
|
||||
my $data = <CFG_IN_FILE>;
|
||||
close( CFG_IN_FILE );
|
||||
if ( $config_file =~ /\.h$/ )
|
||||
next if ( $option->{category} eq 'core' );
|
||||
next if ( $option->{type} == $types{include} );
|
||||
#print( $option->{name}."\n" ) if ( !$option->{category} );
|
||||
$option->{db_type} = $option->{type}->{db_type};
|
||||
$option->{db_hint} = $option->{type}->{hint};
|
||||
$option->{db_pattern} = $option->{type}->{pattern};
|
||||
$option->{db_format} = $option->{type}->{format};
|
||||
if ( $option->{db_type} eq "boolean" )
|
||||
{
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
my $opt_name = $option->{name};
|
||||
my $opt_type = $option->{type};
|
||||
my $opt_value = $option->{value};
|
||||
my $opt_desc = $option->{description};
|
||||
if ( $opt_type == $types{boolean} )
|
||||
{
|
||||
$opt_value = "true" if ( $opt_value eq "yes" );
|
||||
$opt_value = "false" if ( $opt_value eq "no" );
|
||||
}
|
||||
if ( $opt_type->{db_type} eq 'boolean'
|
||||
|| $opt_type->{db_type} eq 'integer'
|
||||
|| $opt_type->{db_type} eq 'decimal'
|
||||
|| $opt_type->{db_type} eq 'hexadecimal' )
|
||||
{
|
||||
$data =~ s/^(#define\s+$opt_name\s+).*$/$1$opt_value\t\/\/ $opt_desc \(from zmconfig\)/mg;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data =~ s/^(#define\s+$opt_name\s+).*$/$1"$opt_value"\t\/\/ $opt_desc \(from zmconfig\)/mg;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ( $config_file =~ /\.pl$/ )
|
||||
{
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
my $opt_name = $option->{name};
|
||||
my $opt_type = $option->{type};
|
||||
my $opt_value = $option->{value};
|
||||
my $opt_desc = $option->{description};
|
||||
if ( $opt_type == $types{boolean} )
|
||||
{
|
||||
$opt_value = 1 if ( $opt_value eq "yes" );
|
||||
$opt_value = 0 if ( $opt_value eq "no" );
|
||||
}
|
||||
if ( $opt_type->{db_type} eq 'boolean'
|
||||
|| $opt_type->{db_type} eq 'integer'
|
||||
|| $opt_type->{db_type} eq 'decimal'
|
||||
|| $opt_type->{db_type} eq 'hexadecimal' )
|
||||
{
|
||||
$data =~ s/^(\s*use\s+constant\s+$opt_name\s*=>\s*).*$/$1$opt_value;\t# $opt_desc \(from zmconfig\)/mg;
|
||||
}
|
||||
elsif ( $opt_type == $types{email} )
|
||||
{
|
||||
$opt_value =~ s/\@/\\\@/;
|
||||
$data =~ s/^(\s*use\s+constant\s+$opt_name\s*=>\s*).*$/$1"$opt_value";\t# $opt_desc \(from zmconfig\)/mg;
|
||||
}
|
||||
elsif ( $opt_type == $types{include} )
|
||||
{
|
||||
open( FILE, "<$opt_value" ) or die( "Can't open option file '$opt_value': $!" );
|
||||
local $/;
|
||||
my $content = <FILE>;
|
||||
$content =~ s/"/\\"/g;
|
||||
$data =~ s/^(\s*use\s+constant\s+$opt_name\s*=>\s*).*$/$1\t# $opt_desc \(from zmconfig\)\n"$content";/mg;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data =~ s/^(\s*use\s+constant\s+$opt_name\s*=>\s*).*$/$1"$opt_value";\t# $opt_desc \(from zmconfig\)/mg;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ( $config_file =~ /\.php$/ )
|
||||
{
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
my $opt_name = $option->{name};
|
||||
my $opt_type = $option->{type};
|
||||
my $opt_value = $option->{value};
|
||||
my $opt_desc = $option->{description};
|
||||
if ( $opt_type == $types{boolean} )
|
||||
{
|
||||
$opt_value = "true" if ( $opt_value eq "yes" );
|
||||
$opt_value = "false" if ( $opt_value eq "no" );
|
||||
}
|
||||
if ( $opt_type->{db_type} eq 'boolean'
|
||||
|| $opt_type->{db_type} eq 'integer'
|
||||
|| $opt_type->{db_type} eq 'decimal'
|
||||
|| $opt_type->{db_type} eq 'hexadecimal' )
|
||||
{
|
||||
$data =~ s/^(define\s*\(\s*"$opt_name"\s*,\s*).*$/$1$opt_value \);\t\/\/ $opt_desc \(from zmconfig\)/mg;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data =~ s/^(define\s*\(\s*"$opt_name"\s*,\s*).*$/$1"$opt_value" \);\t\/\/ $opt_desc \(from zmconfig\)/mg;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ( $config_file =~ /\.sql$/ )
|
||||
{
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
my $opt_name = $option->{name};
|
||||
my $opt_type = $option->{type};
|
||||
my $opt_value = $option->{value};
|
||||
my $opt_desc = $option->{description};
|
||||
$data =~ s/$opt_name/$opt_value/mg;
|
||||
}
|
||||
}
|
||||
elsif ( $config_file =~ /\.conf$/ )
|
||||
{
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
my $opt_name = $option->{name};
|
||||
my $opt_type = $option->{type};
|
||||
my $opt_value = $option->{value};
|
||||
my $opt_desc = $option->{description};
|
||||
$data =~ s/^$opt_name\s*=.*$/$opt_name=$opt_value/mg;
|
||||
}
|
||||
}
|
||||
elsif ( $config_file !~ /\./ )
|
||||
{
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
my $opt_name = $option->{name};
|
||||
my $opt_type = $option->{type};
|
||||
my $opt_value = $option->{value};
|
||||
my $opt_desc = $option->{description};
|
||||
$data =~ s/^$opt_name\s*=.*$/$opt_name="$opt_value"/mg;
|
||||
}
|
||||
$option->{db_value} = ($option->{value} eq "yes")?"1":"0";
|
||||
}
|
||||
else
|
||||
{
|
||||
warn( "Unrecognised file type '$config_file'" );
|
||||
next;
|
||||
$option->{db_value} = $option->{value};
|
||||
}
|
||||
open( CFG_FILE, ">$config_file" ) or die( "Can't open '$config_file' for writing" );
|
||||
print( CFG_FILE $data );
|
||||
close( CFG_FILE );
|
||||
if ( my $requires = $option->{requires} )
|
||||
{
|
||||
$option->{db_requires} = join( ";", map { my $value = $_->{value}; $value = ($value eq "yes")?1:0 if ( $options_hash{$_->{name}}->{db_type} eq "boolean" ); ( "$_->{name}=$value" ) } @$requires );
|
||||
}
|
||||
else
|
||||
{
|
||||
$option->{db_requires} = "";
|
||||
}
|
||||
printf( CFG_SQL_FILE
|
||||
"replace into Config set Id = %d, Name = '%s', Value = '%s', Type = '%s', DefaultValue = '%s', Hint = '%s', Pattern = '%s', Format = '%s', Prompt = '%s', Help = '%s', Category = '%s', Readonly = '%s', Requires = '%s';\n",
|
||||
$option->{id}, $option->{name}, $option->{db_value}, $option->{db_type}, $option->{default}, $option->{db_hint}, $option->{db_pattern}, $option->{db_format}, $option->{description}, $option->{help}, $option->{category}, $option->{readonly}?1:0, $option->{db_requires}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $first_run )
|
||||
{
|
||||
print( "Now please create your database and database users and then run\n'perl zmconfig.pl -noi' to import your configuration into the database\n" );
|
||||
print( CFG_SQL_FILE "\n" );
|
||||
close( CFG_SQL_FILE );
|
||||
}
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
#
|
||||
# This is the configuration file for notification emails
|
||||
#
|
||||
# The tags you can use in here are as follows
|
||||
# %ZP% - The path to your ZoneMinder console
|
||||
# %MN% - The name of the monitor
|
||||
# %MET% - The total number of events for the monitor
|
||||
# %MEH% - The number of events for the monitor in the last hour
|
||||
# %MED% - The number of events for the monitor in the last day
|
||||
# %MEW% - The number of events for the monitor in the last week
|
||||
# %MEM% - The number of events for the monitor in the last month
|
||||
# %MEA% - The number of archived events for the monitor
|
||||
# %MP% - The path to the monitor window
|
||||
# %MPS% - The path to the monitor stream
|
||||
# %MPI% - The path to the monitor recent image
|
||||
# %EP% - The path to the event
|
||||
# %EPS% - The path to the event stream
|
||||
# %EPI% - The path to the event images
|
||||
# %EPI1% - The path to the first alarmed event image
|
||||
# %EPIM% - The path to the (first) event image with the highest score
|
||||
# %EI1% - Attach first alarmed event image
|
||||
# %EIM% - Attach (first) event image with the highest score
|
||||
# %EV% - Attach event video in default format
|
||||
# %EVM% - Attach event video in default mobile format
|
||||
# %EI% - The id of the event
|
||||
# %EN% - The name of the event
|
||||
# %ET% - The time of the event
|
||||
# %ED% - The duration of the event
|
||||
# %EF% - The number of frames in the event
|
||||
# %EFA% - The number of alarm frames in the event
|
||||
# %EST% - The total score of the event
|
||||
# %ESA% - The average score of the event
|
||||
# %ESM% - The maximum score of the event
|
||||
# %FN% - The name of the current filter that matched
|
||||
# %FP% - The path to the current filter that matched
|
||||
|
||||
# Change these to suit your own preferences
|
||||
subject = "ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)"
|
||||
body = "
|
||||
Hello,
|
||||
|
||||
An alarm has been detected on your installation of the ZoneMinder.
|
||||
|
||||
The details are as follows :-
|
||||
|
||||
Monitor : %MN%
|
||||
Event Id : %EI%
|
||||
Duration : %ED%
|
||||
Frames : %EF% (%EFA%)
|
||||
Scores : t%EST% m%ESM% a%ESA%
|
||||
|
||||
This alarm was matched by the %FN% filter and can be viewed at %EPS%
|
||||
|
||||
# %ZP% - The path to your ZoneMinder console
|
||||
# %MN% - The name of the monitor
|
||||
# %MET% - The total number of events for the monitor
|
||||
# %MEH% - The number of events for the monitor in the last hour
|
||||
# %MED% - The number of events for the monitor in the last day
|
||||
# %MEW% - The number of events for the monitor in the last week
|
||||
# %MEM% - The number of events for the monitor in the last month
|
||||
# %MEA% - The number of archived events for the monitor
|
||||
# %MP% - The path to the monitor window
|
||||
# %MPS% - The path to the monitor stream
|
||||
# %MPI% - The path to the monitor recent image
|
||||
# %EP% - The path to the event
|
||||
# %EPS% - The path to the event stream
|
||||
# %EPI% - The path to the event images
|
||||
# %EPI1% - The path to the first alarmed event image
|
||||
# %EPIM% - The path to the (first) event image with the highest score
|
||||
# %EI1% - Attach first alarmed event image
|
||||
# %EIM% - Attach (first) event image with the highest score
|
||||
# %EV% - Attach event mpeg video
|
||||
# %EI% - The id of the event
|
||||
# %EN% - The name of the event
|
||||
# %ET% - The time of the event
|
||||
# %ED% - The duration of the event
|
||||
# %EF% - The number of frames in the event
|
||||
# %EFA% - The number of alarm frames in the event
|
||||
# %EST% - The total score of the event
|
||||
# %ESA% - The average score of the event
|
||||
# %ESM% - The maximum score of the event
|
||||
# %FN% - The name of the current filter that matched
|
||||
# %FP% - The path to the current filter that matched
|
||||
|
||||
ZoneMinder
|
||||
"
|
|
@ -1,41 +0,0 @@
|
|||
#
|
||||
# This is the configuration file for notification messages
|
||||
#
|
||||
# The tags you can use in here are as follows
|
||||
# The path tags however may be over long for a message
|
||||
# destined for an SMS and will in any case probably not
|
||||
# direct you to a WAP compatible page (yet).
|
||||
# %ZP% - The path to your ZoneMinder console
|
||||
# %MN% - The name of the monitor
|
||||
# %MET% - The total number of events for the monitor
|
||||
# %MEH% - The number of events for the monitor in the last hour
|
||||
# %MED% - The number of events for the monitor in the last day
|
||||
# %MEW% - The number of events for the monitor in the last week
|
||||
# %MEM% - The number of events for the monitor in the last month
|
||||
# %MEA% - The number of archived events for the monitor
|
||||
# %MP% - The path to the monitor window
|
||||
# %MPS% - The path to the monitor stream
|
||||
# %MPI% - The path to the monitor recent image
|
||||
# %EP% - The path to the event
|
||||
# %EPS% - The path to the event stream
|
||||
# %EPI% - The path to the event images
|
||||
# %EPI1% - The path to the first alarmed event image
|
||||
# %EPIM% - The path to the (first) event image with the highest score
|
||||
# %EI1% - Attach first alarmed event image
|
||||
# %EIM% - Attach (first) event image with the highest score
|
||||
# %EV% - Attach event mpeg video
|
||||
# %EI% - The id of the event
|
||||
# %EN% - The name of the event
|
||||
# %ET% - The time of the event
|
||||
# %ED% - The duration of the event
|
||||
# %EF% - The number of frames in the event
|
||||
# %EFA% - The number of alarm frames in the event
|
||||
# %EST% - The total score of the event
|
||||
# %ESA% - The average score of the event
|
||||
# %ESM% - The maximum score of the event
|
||||
# %FN% - The name of the current filter that matched
|
||||
# %FP% - The path to the current filter that matched
|
||||
|
||||
# Change these to suit your own preferences
|
||||
subject = "ZoneMinder: Alarm - %MN%-%EI%"
|
||||
body = "ZM alarm detected - %ED% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score."
|
Loading…
Reference in New Issue