munin_plugin 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,25 +4,38 @@ A friendly API for creating munin plugins in ruby.
4
4
 
5
5
  Here's the example from the munin site, implmeneted with munin_plugin:
6
6
 
7
- #!/usr/bin/env ruby -rubygems
7
+ #!/usr/bin/env ruby
8
8
 
9
- require 'munin_plugin'
9
+ require 'rubygems' # or something else
10
+ require 'munin_plugin'
10
11
 
11
- munin_plugin do
12
- graph_title "Load average"
13
- graph_vlabel "load"
14
- load.label "load"
12
+ munin_plugin do
13
+ graph_title "Load average"
14
+ graph_vlabel "load"
15
+ load.label "load"
15
16
 
16
- collect do
17
- load.value `cat /proc/loadavg`.split(" ")[1]
18
- end
17
+ collect do
18
+ load.value `cat /proc/loadavg`.split(" ")[1]
19
19
  end
20
+ end
20
21
 
21
22
  That's it.
22
23
 
24
+ Save your file as loadavg and run it with ./loadavg.
25
+
26
+ Example output:
27
+
28
+ [james@ubuntu munin_plugin (master)]$ examples/loadavg config
29
+ graph_title Load average
30
+ graph_vlabel load
31
+ load.label load
32
+
33
+ [james@ubuntu munin_plugin (master)]$ examples/loadavg
34
+ load.value 0.03
35
+
23
36
  = Install
24
37
 
25
- sudo gem install munin_plugin
38
+ sudo gem install munin_plugin
26
39
 
27
40
  == Copyright
28
41
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,5 +1,6 @@
1
- #!/usr/bin/env ruby -rubygems
1
+ #!/usr/bin/env ruby
2
2
 
3
+ require 'rubygems' # or rip or whatever
3
4
  require 'munin_plugin'
4
5
 
5
6
  munin_plugin do
@@ -1,5 +1,7 @@
1
1
  class MuninPlugin
2
2
  class Attribute
3
+ undef_method :load, :type
4
+
3
5
  attr_reader :name, :args
4
6
 
5
7
  def initialize(*args)
@@ -24,7 +26,7 @@ class MuninPlugin
24
26
  end
25
27
 
26
28
  class Collector
27
- undef_method :load
29
+ undef_method :load, :type
28
30
 
29
31
  def initialize(&block)
30
32
  instance_eval(&block)
@@ -0,0 +1,46 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{munin_plugin}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["James Golick"]
12
+ s.date = %q{2010-01-05}
13
+ s.description = %q{Friendly API for creating munin plugins in ruby.}
14
+ s.email = %q{jamesgolick@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "examples/loadavg",
27
+ "lib/munin_plugin.rb",
28
+ "munin_plugin.gemspec"
29
+ ]
30
+ s.homepage = %q{http://github.com/jamesgolick/munin_plugin}
31
+ s.rdoc_options = ["--charset=UTF-8"]
32
+ s.require_paths = ["lib"]
33
+ s.rubygems_version = %q{1.3.5}
34
+ s.summary = %q{Friendly API for creating munin plugins in ruby.}
35
+
36
+ if s.respond_to? :specification_version then
37
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
38
+ s.specification_version = 3
39
+
40
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
41
+ else
42
+ end
43
+ else
44
+ end
45
+ end
46
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: munin_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Golick
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-04 00:00:00 -08:00
12
+ date: 2010-01-05 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -31,6 +31,7 @@ files:
31
31
  - VERSION
32
32
  - examples/loadavg
33
33
  - lib/munin_plugin.rb
34
+ - munin_plugin.gemspec
34
35
  has_rdoc: true
35
36
  homepage: http://github.com/jamesgolick/munin_plugin
36
37
  licenses: []