2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: CC-BY-SA-3.0
6 abort 'Error: Ruby >= 1.9.3 required.' if RUBY_VERSION < '1.9.3'
10 arv = Arvados.new(api_version: 'v1')
11 arv.node.list[:items].each do |node|
12 if node[:crunch_worker_state] != 'down'
13 ping_age = (Time.now - Time.parse(node[:last_ping_at])).to_i rescue -1
14 puts "#{node[:uuid]} #{node[:crunch_worker_state]} #{ping_age}"