Module: Oxidized

Defined in:
lib/oxidized.rb,
lib/oxidized/cli.rb,
lib/oxidized/job.rb,
lib/oxidized/core.rb,
lib/oxidized/hook.rb,
lib/oxidized/jobs.rb,
lib/oxidized/node.rb,
lib/oxidized/nodes.rb,
lib/oxidized/config.rb,
lib/oxidized/string.rb,
lib/oxidized/worker.rb,
lib/oxidized/manager.rb,
lib/oxidized/version.rb,
lib/oxidized/input/cli.rb,
lib/oxidized/input/ftp.rb,
lib/oxidized/input/ssh.rb,
lib/oxidized/input/exec.rb,
lib/oxidized/input/http.rb,
lib/oxidized/input/tftp.rb,
lib/oxidized/node/stats.rb,
lib/oxidized/output/git.rb,
lib/oxidized/source/csv.rb,
lib/oxidized/source/sql.rb,
lib/oxidized/input/input.rb,
lib/oxidized/model/model.rb,
lib/oxidized/output/file.rb,
lib/oxidized/output/http.rb,
lib/oxidized/source/http.rb,
lib/oxidized/input/telnet.rb,
lib/oxidized/model/outputs.rb,
lib/oxidized/output/output.rb,
lib/oxidized/source/source.rb,
lib/oxidized/output/gitcrypt.rb

Defined Under Namespace

Classes: CLI, CSV, Config, Core, Exec, FTP, Git, GitCrypt, HTTP, Hook, HookManager, Http, Input, InvalidConfig, Job, Jobs, Manager, MethodNotFound, Model, ModelNotFound, NoConfig, Node, NodeNotFound, Nodes, NotSupported, Output, OxidizedError, OxidizedFile, PromptUndetect, SQL, SSH, Source, String, TFTP, Telnet, Worker

Constant Summary collapse

Directory =
File.expand_path(File.join(File.dirname(__FILE__), '../'))
VERSION =
'0.28.0'.freeze
VERSION_FULL =
'0.28.0'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.HooksObject

Returns the value of attribute Hooks.



72
73
74
# File 'lib/oxidized/config.rb', line 72

def Hooks
  @Hooks
end

.mgrObject

Returns the value of attribute mgr.



72
73
74
# File 'lib/oxidized/config.rb', line 72

def mgr
  @mgr
end

Class Method Details

.asetusObject



18
19
20
# File 'lib/oxidized.rb', line 18

def self.asetus
  @@asetus
end

.asetus=(val) ⇒ Object



22
23
24
# File 'lib/oxidized.rb', line 22

def self.asetus=(val)
  @@asetus = val
end

.configObject



26
27
28
# File 'lib/oxidized.rb', line 26

def self.config
  asetus.cfg
end

.loggerObject



30
31
32
# File 'lib/oxidized.rb', line 30

def self.logger
  @@logger
end

.logger=(val) ⇒ Object



34
35
36
# File 'lib/oxidized.rb', line 34

def self.logger=(val)
  @@logger = val
end

.new(*args) ⇒ Object



3
4
5
# File 'lib/oxidized/core.rb', line 3

def new(*args)
  Core.new args
end

.setup_loggerObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/oxidized.rb', line 38

def self.setup_logger
  FileUtils.mkdir_p(Config::Log) unless File.directory?(Config::Log)
  self.logger = if config.has_key?('use_syslog') && config.use_syslog
                  require 'syslog/logger'
                  Syslog::Logger.new('oxidized')
                else
                  require 'logger'
                  if config.has_key?('log')
                    Logger.new(File.expand_path(config.log))
                  else
                    Logger.new(STDERR)
                  end
                end
  logger.level = Logger::INFO unless config.debug
end

.version_setObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/oxidized/version.rb', line 4

def self.version_set
  version_full = %x(git describe --tags).chop rescue ""
  version      = %x(git describe --tags --abbrev=0).chop rescue ""

  return false unless [version, version_full].none?(&:empty?)

  Oxidized.send(:remove_const, :VERSION)
  Oxidized.send(:remove_const, :VERSION_FULL)
  const_set(:VERSION, version)
  const_set(:VERSION_FULL, version_full)
  file = File.readlines(__FILE__)
  file[1] = "  VERSION = '%s'.freeze\n" % VERSION
  file[2] = "  VERSION_FULL = '%s'.freeze\n" % VERSION_FULL
  File.write(__FILE__, file.join)
end