Merge pull request #93 from pliablepixels/92-opt-eventnotification

92 opt eventnotification
This commit is contained in:
Isaac Connor 2018-03-29 11:31:02 -04:00 committed by GitHub
commit ce1499d70f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View File

@ -400,7 +400,22 @@ our @options = (
type => $types{boolean},
category => 'system',
},
# PP - Google reCaptcha settings
{
name => 'ZM_OPT_USE_EVENTNOTIFICATION',
default => 'no',
description => 'Enable 3rd party Event Notification Server',
help => q`
zmeventnotification is a 3rd party event notification server
that is used to get notifications for alarms detected by ZoneMinder
in real time. zmNinja requires this server for push notifications to
mobile phones. This option only enables the server if its already installed.
Please visit https://github.com/pliablepixels/zmeventserver for installation
instructions.
`,
type => $types{boolean},
category => 'system',
},
# Google reCaptcha settings
{
name => 'ZM_OPT_USE_GOOG_RECAPTCHA',
default => 'no',
@ -424,7 +439,6 @@ our @options = (
},
{
name => 'ZM_OPT_GOOG_RECAPTCHA_SITEKEY',
default => '...Insert your recaptcha site-key here...',
description => 'Your recaptcha site-key',
help => q`You need to generate your keys from
the Google reCaptcha website.

View File

@ -104,6 +104,10 @@ my @daemons = (
'zmtelemetry.pl'
);
if ($Config{ZM_OPT_USE_EVENTNOTIFICATION}) {
push @daemons,'zmeventnotification.pl';
}
my $command = shift @ARGV;
if( ! $command ) {
print( STDERR "No command given\n" );

View File

@ -232,6 +232,7 @@ if ( $command =~ /^(?:start|restart)$/ ) {
# This is now started unconditionally
runCommand('zmdc.pl start zmfilter.pl');
if ( $Config{ZM_RUN_AUDIT} ) {
if ( $Server and exists $$Server{'zmaudit'} and ! $$Server{'zmaudit'} ) {
Debug("Not running zmaudit.pl because it is turned off for this server.");
@ -256,6 +257,9 @@ if ( $command =~ /^(?:start|restart)$/ ) {
if ( $Config{ZM_TELEMETRY_DATA} ) {
runCommand('zmdc.pl start zmtelemetry.pl');
}
if ($Config{ZM_OPT_USE_EVENTNOTIFICATION} ) {
runCommand('zmdc.pl start zmeventnotification.pl');
}
if ( $Server and exists $$Server{'zmstats'} and ! $$Server{'zmstats'} ) {
Debug("Not running zmstats.pl because it is turned off for this server.");
} else {