diff options
author | mh <mh@immerda.ch> | 2009-11-02 00:18:46 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2009-11-02 00:18:46 +0100 |
commit | 2efa9ee240ccce9e7baf8e442972cdbc932ac0c1 (patch) | |
tree | ae2d71069ba2866135e6663e0e28de64f17c3fcf /files | |
parent | 1d77984858faec99f414eadeb03b95677ae1a6d2 (diff) |
parse the timestamps before substracting them
Diffstat (limited to 'files')
-rw-r--r-- | files/master/puppetlast | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/files/master/puppetlast b/files/master/puppetlast index 99a760e..752d6ca 100644 --- a/files/master/puppetlast +++ b/files/master/puppetlast @@ -5,6 +5,7 @@ # changed by admin+puppet(at)immerda.ch to fit our needs # require 'puppet' +require 'time' Puppet[:config] = "/etc/puppet/puppet.conf" Puppet.parse_config @@ -12,5 +13,5 @@ Puppet[:name] = "puppetmasterd" Puppet::Node::Facts.terminus_class = :yaml Puppet::Node::Facts.search("*").sort { |a,b| a.name <=> b.name }.each do |node| - puts "#{node.name} #{node.expired? ? 'cached expired, ' : ''}last checked #{((Time.now - node.values[:_timestamp]) / 60).floor} minutes ago" if (((Time.now - node.values[:_timestamp]) / 60).floor > 60 or (not ARGV[0].nil? and ARGV[0].to_s == '--all')) + puts "#{node.name} #{node.expired? ? 'cached expired, ' : ''}last checked #{((Time.now - Time.parse(node.values[:_timestamp])) / 60).floor} minutes ago" if (((Time.now - Time.parse(node.values[:_timestamp])) / 60).floor > 120 or (not ARGV[0].nil? and ARGV[0].to_s == '--all')) end |