Include Record Monitors in zmtrigger

This commit is contained in:
Isaac Connor 2020-11-11 16:12:30 -05:00
parent f855f207e2
commit 076d649189
1 changed files with 6 additions and 9 deletions

View File

@ -187,7 +187,7 @@ while (1) {
} else {
Fatal("Can't select: $!");
}
} # end if select returned activitiy
} # end if select returned activity
# Check polled connections
foreach my $connection ( @in_poll_connections ) {
@ -266,7 +266,7 @@ while (1) {
Debug('Checking for timed actions');
my $now = time();
foreach my $action_time ( sort( grep { $_ < $now } @action_times ) ) {
Info("Found " . scalar @{$actions{$action_time}} . "actions expiring at $action_time");
Info('Found '.(scalar @{$actions{$action_time}}).'actions expiring at '.$action_time);
foreach my $action ( @{$actions{$action_time}} ) {
my $connection = $action->{connection};
Info("Found action '$$action{message}'");
@ -319,7 +319,7 @@ exit;
sub loadMonitor {
my $monitor = shift;
Debug("Loading monitor $monitor");
Debug('Loading monitor '.$monitor);
zmMemInvalidate($monitor);
if ( zmMemVerify($monitor) ) { # This will re-init shared memory
@ -334,7 +334,7 @@ sub loadMonitors {
my %new_monitors = ();
my $sql = 'SELECT * FROM `Monitors`
WHERE find_in_set( `Function`, \'Modect,Mocord,Nodect\' )'.
WHERE find_in_set( `Function`, \'Modect,Mocord,Nodect,Record\' )'.
( $Config{ZM_SERVER_ID} ? ' AND `ServerId`=?' : '' )
;
my $sth = $dbh->prepare_cached( $sql )
@ -387,12 +387,9 @@ sub handleMessage {
}
# Force a reload
$monitor_reload_time = 0;
Info("Set monitor to $state");
Info('Set monitor to '.$state);
if ( $delay ) {
my $action_text = $id.'|'.( ($state eq 'enable')
? 'disable'
: 'enable'
);
my $action_text = $id.'|'.(($state eq 'enable') ? 'disable' : 'enable');
handleDelay($delay, $connection, $action_text);
}
} elsif ( $action =~ /^(on|off)(?:[ \+](\d+))?$/ ) {