From 9c9eaa6851fbdc2470202d6fdfe979cbe4f10068 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 2 Jun 2017 12:35:01 -0400 Subject: [PATCH] move test for MIN_AGE up. Don't need to constantly check for it because it won't change. --- scripts/zmaudit.pl.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index 58b4a2739..6cf2af2e3 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -111,6 +111,10 @@ if ( ($report + $interactive + $continuous) > 1 ) { pod2usage(-exitstatus => -1); } +if ( ! exists $Config{ZM_AUDIT_MIN_AGE} ) { + Fatal('ZM_AUDIT_MIN_AGE is not set in config.'); +} + my $dbh = zmDbConnect(); chdir( EVENT_PATH ); @@ -145,12 +149,8 @@ MAIN: while( $loop ) { sleep 1; } # end if - if ( ! exists $Config{ZM_AUDIT_MIN_AGE} ) { - Fatal('ZM_AUDIT_MIN_AGE is not set in config.'); - } - my $db_monitors; - my $monitorSelectSql = "select Id from Monitors order by Id"; + my $monitorSelectSql = 'select Id from Monitors order by Id'; my $monitorSelectSth = $dbh->prepare_cached( $monitorSelectSql ) or Fatal( "Can't prepare '$monitorSelectSql': ".$dbh->errstr() ); my $eventSelectSql = 'SELECT Id, (unix_timestamp() - unix_timestamp(StartTime)) as Age