Package: puppetmaster
Version: 0.24.5-3
Severity: normal
Hello,
i like to use the RRD reporttype of puppetmaster. /etc/puppet/puppet.conf
contains:
[puppetmasterd]
...
reports = store, log, rrdgraph
rrdgraph = true
rrdintervall = $runintervall
With the Ruby-RRD bindings in librrd-ruby1.8 Version 1.3.1-4 this did not work,
because librrd-ruby1.8 provides RRD.so but
/usr/lib/ruby/1.8/puppet/util/metric.rb
wants RRDTools.so
This Problem also exists in puppetmaster 0.25.4-2~bpo50+1 and librrd-ruby1.8
1.4.3-1~bpo50+1
Based in the patches under http://projects.reductivelabs.com/issues/2891
I create the attached Patch for the Puppet version in Lenny, witch worked for
me.
The patches under the link above may be appropriate for puppet 0.25.4
Regards,
Martin
-- System Information:
Debian Release: 5.0.4
APT prefers stable
APT policy: (900, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.24-etchnhalf.1-686-bigmem (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages puppet depends on:
ii adduser 3.110 add and remove users and groups
ii facter 1.5.1-0.1 a library for retrieving facts fro
ii libopenssl-ruby 4.2 OpenSSL interface for Ruby
ii libruby [libxmlrpc-ruby] 4.2 Libraries necessary to run Ruby 1.
ii libshadow-ruby1.8 1.4.1-8 Interface of shadow password for R
ii libxmlrpc-ruby 4.2 transitional dummy package
ii lsb-base 3.2-20 Linux Standard Base 3.2 init scrip
ii ruby 4.2 An interpreter of object-oriented
Versions of packages puppet recommends:
ii rdoc 4.2 Generate documentation from ruby s
puppet suggests no packages.
-- no debconf information
--- metric.rb.orig 2009-01-07 20:19:36.000000000 +0100
+++ metric.rb 2010-04-12 21:43:44.000000000 +0200
@@ -1,11 +1,12 @@
# included so we can test object types
require 'puppet'
+require 'RRD'
# A class for handling metrics. This is currently ridiculously hackish.
class Puppet::Util::Metric
# Load the library as a feature, so we can test its presence.
- Puppet.features.add :rrd, :libs => 'RRDtool'
+ Puppet.features.add :rrd, :libs => 'RRD'
attr_accessor :type, :name, :value, :label
attr_writer :values
@@ -25,7 +26,6 @@
start ||= Time.now.to_i - 5
- @rrd = RRDtool.new(self.path)
args = []
values.each { |value|
@@ -36,14 +36,17 @@
args.push "RRA:AVERAGE:0.5:1:300"
begin
- @rrd.create( Puppet[:rrdinterval].to_i, start, args)
+ RRD.create(self.path,
+ "--start", start.to_s,
+ "--step", Puppet[:rrdinterval].to_i,
+ *args)
rescue => detail
raise "Could not create RRD file %s: %s" % [path,detail]
end
end
def dump
- puts @rrd.info
+ puts RRD.info(self.path)
end
def graph(range = nil)
@@ -78,12 +81,12 @@
if range
args.push("--start",range[0],"--end",range[1])
else
- args.push("--start", Time.now.to_i - time, "--end", Time.now.to_i)
+ args.push("--start", (Time.now.to_i - time).to_s, "--end", Time.now.to_i.to_s)
end
begin
- #Puppet.warning "args = #{args}"
- RRDtool.graph( args )
+ #Puppet.warning "args = #{args.join("|")}"
+ RRD.graph( * args )
rescue => detail
Puppet.err "Failed to graph %s: %s" % [self.name,detail]
end
@@ -122,7 +125,6 @@
self.create(time - 5)
end
- @rrd ||= RRDtool.new(self.path)
# XXX this is not terribly error-resistant
args = [time]
@@ -135,7 +137,9 @@
arg = args.join(":")
template = temps.join(":")
begin
- @rrd.update( template, [ arg ] )
+ RRD.update(self.path,
+ "--template", template,
+ arg )
#system("rrdtool updatev %s '%s'" % [self.path, arg])
rescue => detail
raise Puppet::Error, "Failed to update %s: %s" % [self.name,detail]