From 5e99c25048ab4544fd973a1f1cc4d4beccf770ef Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 9 May 2014 13:25:23 -0400 Subject: Check new and old path for clog when generating mail report. Bump. --- config/mailreport/mail_reports.inc | 8 +++++++- config/mailreport/mailreport.xml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc index 5d9e74b2..2742844b 100644 --- a/config/mailreport/mail_reports.inc +++ b/config/mailreport/mail_reports.inc @@ -1243,7 +1243,13 @@ function mail_report_get_log($logfile, $tail, $grepfor) { if(isset($config['system']['usefifolog'])) { exec("/usr/sbin/fifolog_reader {$logfile}{$grepline} | /usr/bin/tail -n {$tail}", $logarr); } else { - exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail -n {$tail}", $logarr); + if (is_executable("/usr/local/sbin/clog")) { + exec("/usr/local/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail -n {$tail}", $logarr); + } elseif (is_executable("/usr/local/sbin/clog")) { + exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail -n {$tail}", $logarr); + } else { + $logarr = array("Cannot locate clog which is required for reading log files."); + } } } return($logarr); diff --git a/config/mailreport/mailreport.xml b/config/mailreport/mailreport.xml index fe6899d4..9239f82e 100644 --- a/config/mailreport/mailreport.xml +++ b/config/mailreport/mailreport.xml @@ -37,7 +37,7 @@ ]]> mailreport - 2.0.11 + 2.0.12 Status: Email Reports /usr/local/bin/ -- cgit v1.2.3