source/code/plugins/agent_maintenance_script.rb
# Assign logger from log facility in omsadmin.conf
Assign logger from log facility in omsadmin.conf
Assign logger from log facility in omsadmin . conf
def init_logger
      return if !@logger.nil?  
      facility = case @LOG_FACILITY
          when "auth"     then Syslog::LOG_AUTHPRIV  
          when "authpriv" then Syslog::LOG_AUTHPRIV
          when "cron"     then Syslog::LOG_CRON
          when "daemon"   then Syslog::LOG_DAEMON
          when "ftp"      then Syslog::LOG_FTP
          when "kern"     then Syslog::LOG_KERN
          when "lpr"      then Syslog::LOG_LRP
          when "mail"     then Syslog::LOG_MAIL
          when "news"     then Syslog::LOG_NEWS
          when "security" then Syslog::LOG_SECURITY
          when "syslog"   then Syslog::LOG_SYSLOG
          when "user"     then Syslog::LOG_USER
          when "uucp"     then Syslog::LOG_UUCP
          when "local0"   then Syslog::LOG_LOCAL0
          when "local1"   then Syslog::LOG_LOCAL1
          when "local2"   then Syslog::LOG_LOCAL2
          when "local3"   then Syslog::LOG_LOCAL3
          when "local4"   then Syslog::LOG_LOCAL4
          when "local5"   then Syslog::LOG_LOCAL5
          when "local6"   then Syslog::LOG_LOCAL6
          when "local7"   then Syslog::LOG_LOCAL7
          else Syslog::LOG_LOCAL0
      end
      if !Syslog.opened?
        Syslog::Logger.syslog = Syslog.open("omsagent", Syslog::LOG_PID, facility)
      end
      @logger = Syslog::Logger.new
    end
def init_logger return if ! @logger . nil? facility = case @LOG_FACILITY when "auth" then Syslog :: LOG_AUTHPRIV when "authpriv" then Syslog :: LOG_AUTHPRIV when "cron" then Syslog :: LOG_CRON when "daemon" then Syslog :: LOG_DAEMON when "ftp" then Syslog :: LOG_FTP when "kern" then Syslog :: LOG_KERN when "lpr" then Syslog :: LOG_LRP when "mail" then Syslog :: LOG_MAIL when "news" then Syslog :: LOG_NEWS when "security" then Syslog :: LOG_SECURITY when "syslog" then Syslog :: LOG_SYSLOG when "user" then Syslog :: LOG_USER when "uucp" then Syslog :: LOG_UUCP when "local0" then Syslog :: LOG_LOCAL0 when "local1" then Syslog :: LOG_LOCAL1 when "local2" then Syslog :: LOG_LOCAL2 when "local3" then Syslog :: LOG_LOCAL3 when "local4" then Syslog :: LOG_LOCAL4 when "local5" then Syslog :: LOG_LOCAL5 when "local6" then Syslog :: LOG_LOCAL6 when "local7" then Syslog :: LOG_LOCAL7 else Syslog :: LOG_LOCAL0 end if ! Syslog . opened? Syslog :: Logger . syslog = Syslog . open ( "omsagent" , Syslog :: LOG_PID , facility ) end @logger = Syslog :: Logger . new end
Assign logger from log facility in omsadmin.conf
Assign logger from log facility in omsadmin . conf
# a logger has already been provided by initialize # Custom log facilities supported by both Ruby and bash logger # LOG_AUTH is deprecated # default logger will be local0