From 9c6b722722f8ce9c93480bc5cc9ca2857fb779b2 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 30 Aug 2011 12:38:04 -0400 Subject: [PATCH] CC-2694: Create command line program for viewing/dumping log files -check if each subsystem is actually installed on the machine. --- utils/airtime-log.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/airtime-log.php b/utils/airtime-log.php index c61087b23..062beed74 100644 --- a/utils/airtime-log.php +++ b/utils/airtime-log.php @@ -9,6 +9,8 @@ $log_files = array("media-monitor" => "/var/log/airtime/media-monitor/media-moni "playout" => "/var/log/airtime/pypo/pypo.log", "web" => "/var/log/airtime/zendphp.log"); +array_filter($log_files, "file_exists"); + function printUsage($userMsg = "") { global $opts; @@ -74,14 +76,15 @@ function tailSpecificLog($key){ } try { + $keys = implode("|", array_keys($log_files)); $opts = new Zend_Console_Getopt( array( 'view|v=s' => "Display log file\n" - ."\t\tmedia-monitor|playout|recorder|web (ALL by default)", + ."\t\t$keys (ALL by default)", 'dump|d-s' => "Collect all log files and compress into a tarball\n" - ."\t\tmedia-monitor|playout|recorder|web (ALL by default)", + ."\t\t$keys (ALL by default)", 'tail|t-s' => "View any new entries appended to log files in real-time\n" - ."\t\tmedia-monitor|playout|recorder|web (ALL by default)" + ."\t\t$keys (ALL by default)" ) ); $opts->parse();