Sha256: ae90f32fd72403caca732c7cc0755795452d0af48857b4de29aa614464956ef4

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

require 'thread'
require 'mixlib/cli'
require 'daemons/daemonize'
require 'spanx/logger'
require 'spanx/runner'

class Spanx::CLI::Analyze < Spanx::CLI

  banner 'Usage: spanx analyze [options]'
  description 'Analyze IP traffic and save blocked IPs into Redis'

  option :daemonize,
         :short => '-d',
         :long => '--daemonize',
         :boolean => true,
         :default => false

  option :config_file,
         :short => '-c CONFIG',
         :long => '--config CONFIG',
         :description => 'Path to config file (YML)',
         :required => true

  option :debug,
         :short => '-g',
         :long => '--debug',
         :description => 'Log status to STDOUT',
         :boolean => true,
         :required => false,
         :default => false

  option :audit_file,
         :short => '-a AUDIT',
         :long  => '--audit AUDIT_FILE',
         :description => 'Historical record of IP blocking decisions',
         :required => false

  option :help,
         :short => '-h',
         :long => '--help',
         :description => 'Show this message',
         :on => :tail,
         :boolean => true,
         :show_options => true,
         :exit => 0

  def run(argv = ARGV)
    generate_config(argv)
    Spanx::Runner.new("analyzer", config).run
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spanx-0.3.0 lib/spanx/cli/analyze.rb