summaryrefslogtreecommitdiffstats
path: root/lib/puppet/reports/rrdgraph.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-30 22:30:27 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-30 22:30:27 +0000
commit34e779fcf2bfed1c6874084af6c99e072c4ecc7f (patch)
treec8d6cf6d26d8b6dfda7b7fe8f814f0e29cfd66de /lib/puppet/reports/rrdgraph.rb
parent24f07e0686cc9d81452d33daf215fa050ec89129 (diff)
downloadpuppet-34e779fcf2bfed1c6874084af6c99e072c4ecc7f.tar.gz
puppet-34e779fcf2bfed1c6874084af6c99e072c4ecc7f.tar.xz
puppet-34e779fcf2bfed1c6874084af6c99e072c4ecc7f.zip
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
Diffstat (limited to 'lib/puppet/reports/rrdgraph.rb')
-rw-r--r--lib/puppet/reports/rrdgraph.rb20
1 files changed, 20 insertions, 0 deletions
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 "<html><body>"
+ report.metrics.each do |name, metric|
+ metric.store(time)
+
+ metric.graph
+
+ of.puts "<img src=%s.png><br>" % name
+ end
+
+ of.puts "</body></html>"
+ }
+end
+
+# $Id$