CC-2694: Create command line program for viewing/dumping log files

-check if each subsystem is actually installed on the machine.
This commit is contained in:
martin 2011-08-30 12:38:04 -04:00
parent 58f64b97ae
commit 9c6b722722

View File

@ -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();