From a67c34fcad314329d84da2ea32baace90836293a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 21 Jan 2018 17:14:32 -0500 Subject: [PATCH] Allow specifiying storagearea to audit --- scripts/zmaudit.pl.in | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index 87cea1af1..7ce797bc2 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -67,6 +67,7 @@ my $continuous = 0; my $monitor_id = 0; my $version; my $force = 0; +my $storage_id = undef; logInit(); @@ -76,6 +77,7 @@ GetOptions( interactive =>\$interactive, monitor_id =>\$monitor_id, report =>\$report, + storage_id =>\$storage_id, version =>\$version ) or pod2usage(-exitstatus => -1); @@ -194,9 +196,17 @@ MAIN: while( $loop ) { my $fs_monitors; - foreach my $Storage ( - ZoneMinder::Storage->find( ($Config{ZM_SERVER_ID} ? ( ServerId => $Config{ZM_SERVER_ID} ) : () ) ), - ) { + my @Storage_Areas; + if ( defined $storage_id ) { + @Storage_Areas = ZoneMinder::Storage->find( Id=>$storage_id ); + } elsif ( $Config{ZM_SERVER_ID} ) { + @Storage_Areas = ZoneMinder::Storage->find( ServerId => $Config{ZM_SERVER_ID} ); + } else { + @Storage_Areas = ZoneMinder::Storage->find(); + } + + + foreach my $Storage ( @Storage_Areas ) { Debug('Checking events in ' . $Storage->Path() ); if ( ! chdir( $Storage->Path() ) ) { Error( 'Unable to change dir to ' . $Storage->Path() );