summaryrefslogtreecommitdiff
path: root/lib/oxidized/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r--lib/oxidized/node.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb
index 740834a..de04c98 100644
--- a/lib/oxidized/node.rb
+++ b/lib/oxidized/node.rb
@@ -28,6 +28,25 @@ module Oxidized
[status, config]
end
+ def serialize
+ h = {
+ :name => @name,
+ :ip => @ip,
+ :group => @group,
+ :model => @model.class.to_s,
+ :last => nil,
+ }
+ if @last
+ h[:last] = {
+ :start => @last.start,
+ :end => @last.end,
+ :status => @last.status,
+ :time => @last.time,
+ }
+ end
+ h
+ end
+
private
def resolve_prompt opt