From 34e779fcf2bfed1c6874084af6c99e072c4ecc7f Mon Sep 17 00:00:00 2001 From: luke Date: Fri, 30 Jun 2006 22:30:27 +0000 Subject: Significantly redoing metrics. There are now no class variables for metrics, nor no class methods for it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1350 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/reports/rrdgraph.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/puppet/reports/rrdgraph.rb (limited to 'lib/puppet/reports') diff --git a/lib/puppet/reports/rrdgraph.rb b/lib/puppet/reports/rrdgraph.rb new file mode 100644 index 000000000..29eca4aeb --- /dev/null +++ b/lib/puppet/reports/rrdgraph.rb @@ -0,0 +1,20 @@ +require 'puppet' + +Puppet::Server::Report.newreport(:rrdgraph) do |report| + time = Time.now.to_i + + File.open(File.join(Puppet[:rrddir],"index.html"),"w") { |of| + of.puts "" + report.metrics.each do |name, metric| + metric.store(time) + + metric.graph + + of.puts "
" % name + end + + of.puts "" + } +end + +# $Id$ -- cgit