Class: Sensu::Plugin::CLI

Inherits:
Object
  • Object
show all
Includes:
Mixlib::CLI
Defined in:
lib/sensu-plugin/cli.rb

Direct Known Subclasses

Sensu::Plugin::Check::CLI, Metric::CLI

Constant Summary collapse

@@autorun =

Behind-the-scenes stuff below. If you do something crazy like define two plugins in one script, the last one will ‘win’ in terms of what gets auto-run.

self

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.method_added(name) ⇒ Object



38
39
40
41
42
# File 'lib/sensu-plugin/cli.rb', line 38

def method_added(name)
  if name == :run
    @@autorun = self
  end
end

Instance Method Details

#format_output(status, output) ⇒ Object

Implementing classes should override this to produce appropriate output for their handler.



12
13
14
# File 'lib/sensu-plugin/cli.rb', line 12

def format_output(status, output)
  output
end

#runObject

Implementing classes must override this.



28
29
30
# File 'lib/sensu-plugin/cli.rb', line 28

def run
  unknown "Not implemented! You should override Sensu::Plugin::CLI#run."
end