summaryrefslogtreecommitdiff
path: root/files/master/puppetlast
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-11-29 23:23:10 +0100
committermh <mh@immerda.ch>2010-11-29 23:23:10 +0100
commit5e24e0e85d354300078f0b10b80cbc44a0f76f10 (patch)
tree970a16e4a3b2510603a141b27557823d34a12f23 /files/master/puppetlast
parentbec32391d6678a9f52f71658d98a2700ddd31f60 (diff)
replace puppetlast with much more improved version
Diffstat (limited to 'files/master/puppetlast')
-rw-r--r--files/master/puppetlast26
1 files changed, 0 insertions, 26 deletions
diff --git a/files/master/puppetlast b/files/master/puppetlast
deleted file mode 100644
index af2ca77..0000000
--- a/files/master/puppetlast
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env ruby
-# Puppetlast, a script to output the last check-in time of nodes. Also outputs the cached configuration state, if expired or not.
-#
-# AJ "Fujin" Christensen <aj@junglist.gen.nz>
-# changed by admin+puppet(at)immerda.ch to fit our needs
-#
-require 'puppet'
-require 'time'
-
-Puppet[:config] = "/etc/puppet/puppet.conf"
-Puppet.parse_config
-Puppet::Node::Facts.terminus_class = :yaml
-
-all = false
-timeout = 120
-ARGV.each do |arg|
- if arg.to_s == '--all'
- all = true
- else
- timeout = arg.to_i
- end
-end
-
-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 - Time.parse(node.values[:_timestamp])) / 60).floor} minutes ago" if (((Time.now - Time.parse(node.values[:_timestamp])) / 60).floor > timeout or all)
-end