#!/opt/perl/bin/perl use strict; use warnings; # Add in my file with the subroutine to generate the log file names # This is called by the loggers that output to log files - see logfile_FDO.conf require "/usr/fds/fdo/scripts/Get_LogFile.pl"; # should make this into a module require "/usr/fds/fdo/scripts/Check_Inhibits.pl"; # should make this into a module # Subroutine prototypes sub Get_LogFile($); #logfile takes "INFO" or "ERROR" sub Check_Inhibits($$$$); # PERL modules use Sys::Hostname; use File::Basename; use File::Copy; use Net::FTP; use Getopt::Long; use MIME::Lite; use Log::Dispatch::Email::MIMELite; use Log::Log4perl; # use Log::Log4perl qw(get_logger :no_extra_logdie_message) ; # initialize logger instance at the logfile category # which logs INFO and up messages to the screen and to a log file # and WARN and up message to an additional error log file Log::Log4perl->init("/usr/fds/fdo/scripts/log4perl_FDO.conf"); my($log) = Log::Log4perl->get_logger("logfile"); my($infoFileApp) = Log::Log4perl->appender_by_name("InfoFile"); my($errFileApp) = Log::Log4perl->appender_by_name("ErrFile"); my($infoLogFile) = $infoFileApp->filename(); my($errLogFile) = $errFileApp->filename(); $log->info("Execution Started"); $log->info("Log File: $infoLogFile"); $log->info("Error Log File: $errLogFile"); my($inhWarn) = Check_Inhibits("2009:016:22","2009:016:22:30", "/tmp/Test.inhibit.out", 30); print "inhMsg:\n $inhWarn"; $log->info("Execution Complete"); exit 1; # successful end