summaryrefslogtreecommitdiff
path: root/lib/oxidized/core.rb
diff options
context:
space:
mode:
authorAnton Aksola <anton.aksola@nebula.fi>2015-08-28 11:05:18 +0300
committerAnton Aksola <anton.aksola@nebula.fi>2015-08-28 11:05:18 +0300
commit0906e02a8538b698ed8bd7c72e6a09d3e809b67a (patch)
treed494ee43f71d41034efa98f5b5ab59ab5500207a /lib/oxidized/core.rb
parent18cf96b36e54cb52c678e4e6395e595b6f9b4159 (diff)
Initial implementation of the hook feature
The current implementation is modular and allows users to define hooks in several ways: * Use one of the built-in hook types (currently only 'exec') * Define their own Hook classes inside ~/.config/oxidized/hook Exec hook type runs a user defined command with or without shell. It populates a bunch of environment variables with metadata. The command can either be run as synchronous or asynchronous. The default is synchronous.
Diffstat (limited to 'lib/oxidized/core.rb')
-rw-r--r--lib/oxidized/core.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/oxidized/core.rb b/lib/oxidized/core.rb
index 71267dd..b70443c 100644
--- a/lib/oxidized/core.rb
+++ b/lib/oxidized/core.rb
@@ -6,6 +6,7 @@ module Oxidized
require 'oxidized/worker'
require 'oxidized/nodes'
require 'oxidized/manager'
+ require 'oxidized/hook'
class << self
def new *args
Core.new args
@@ -15,6 +16,7 @@ module Oxidized
class Core
def initialize args
Oxidized.mgr = Manager.new
+ Oxidized.Hooks = HookManager.from_config CFG
nodes = Nodes.new
@worker = Worker.new nodes
trap('HUP') { nodes.load }