summaryrefslogtreecommitdiff
path: root/lib/oxidized/node.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-05-07 12:23:36 +0300
committerSaku Ytti <saku@ytti.fi>2014-05-07 12:23:36 +0300
commit94926f53db8a7244f1af34e30607fdc2908ffa8e (patch)
tree06f5947a27a4d2f3854bf6b94ea1e606d49bf949 /lib/oxidized/node.rb
parenteff861dc81aed658cbccfcc2ea86b3d7f02d975d (diff)
Stats for node
So that we can easily check last time node failed/succceded etc
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r--lib/oxidized/node.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb
index 65f0c1f..d7de991 100644
--- a/lib/oxidized/node.rb
+++ b/lib/oxidized/node.rb
@@ -1,10 +1,11 @@
module Oxidized
require 'resolv'
+ require_relative 'node/stats'
class MethodNotFound < OxidizedError; end
class ModelNotFound < OxidizedError; end
class Node
attr_reader :name, :ip, :model, :input, :output, :group, :auth, :prompt, :vars
- attr_accessor :last, :running, :user, :msg, :from
+ attr_accessor :last, :running, :user, :msg, :from, :stats
alias :running? :running
def initialize opt
@name = opt[:name]
@@ -16,6 +17,7 @@ module Oxidized
@auth = resolve_auth opt
@prompt = resolve_prompt opt
@vars = opt[:vars]
+ @stats = Stats.new
# model instance needs to access node instance
@model.node = self