Class: Sensu::Plugin::CLI
- Inherits:
-
Object
- Object
- Sensu::Plugin::CLI
- Includes:
- Mixlib::CLI
- Defined in:
- lib/sensu-plugin/cli.rb
Direct Known Subclasses
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
-
#format_output(status, output) ⇒ Object
Implementing classes should override this to produce appropriate output for their handler.
-
#run ⇒ Object
Implementing classes must override this.
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 |
#run ⇒ Object
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 |