Sha256: ae2ae989c57a14f6426ea5280ed20a87fc00ff4104fc029d6f597c75034c1f10

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

class Nagira < Sinatra::Base

  disable :protection
  enable :logging

  set :port, ENV['NAGIRA_PORT'].to_i if ENV['NAGIRA_PORT']
  set :bind, ENV['NAGIRA_BIND'] if ENV['NAGIRA_BIND']
  set :root, File.dirname(File.dirname(__FILE__))

  configure do
    set :format, :json
  end

  require 'sinatra/reloader'  if development?

  ##
  # Development and test environments use local files located in the
  # development tree: ./test/data.
  configure :development, :test do
    register Sinatra::Reloader
    also_reload("#{root}/*.rb")
    also_reload("#{root}/{config,app,lib}/**/*.rb")

    dir = File.expand_path(File.dirname(__FILE__) + '/../test/data/')

    set :nagios_cfg, "#{dir}/nagios.cfg"
    set :status_cfg, "#{dir}/status.dat"
    set :objects_cfg, "#{dir}/objects.cache"
    set :command_file, "/tmp/nagios.cmd"

    set :show_exceptions, false
  end


# configure :production do
#   # If your nagios.cfg file is in 'standard' location (in RH and
#   # Debian it usially installed under /etc/nagios(3)?) you don't need
#   # to define nagios_cfg.
#   set :nagios_cfg, nil
# end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nagira-0.4.0 config/environment.rb