Nagios::Plugin::OverHTTP::Formatter - Moose role for output formatters


Nagios-Plugin-OverHTTP documentation  | view source Contained in the Nagios-Plugin-OverHTTP distribution.

Index


NAME

Top

Nagios::Plugin::OverHTTP::Formatter - Moose role for output formatters

VERSION

Top

This documentation refers to Nagios::Plugin::OverHTTP::Formatter version 0.14

SYNOPSIS

Top

  package My::Custom::Formatter;

  use Moose;

  with 'Nagios::Plugin::OverHTTP::Formatter'; # use the role (required)

  # Implement the formatter and define
  # any required methods

  no Moose; # unimport Moose

  1;

DESCRIPTION

Top

This module is a Moose role that defines the required API for formatters.

REQUIRED METHODS

Top

exit_code

This must return an integer which may be used as the exit status for the plugin.

stderr

This must return a string which may be used as the output to stderr. Returning a zero-length string will cause nothing to be printed to stderr.

stdout

This must return a string which may be used as the output to stdout. Returning a zero-length string will cause nothing to be printed to stdout.

ATTRIBUTES

Top

response

Required. This is the Nagios::Plugin::OverHTTP::Response object to format.

METHODS

Top

standard_status_exit_code

This provided method is useful to packages that consume this role. This method will take the status as the only argument and will return an integer representing the standard exit code for that status.

  # My::Custom::Formatter package
  sub exit_code {
      my ($self) = @_;

      # Just return the default
      return $self->standard_status_exit_code($self->response->status);
  }

DIAGNOSTICS

Top

Unable to change the status %s to exit code

The method standard_status_exit_code was called and the provided argument could not be converted into a known status.

DEPENDENCIES

Top

This module is dependent on the following modules:

* Carp
* Moose::Role 0.74
* Nagios::Plugin::OverHTTP::Library
* Readonly 1.03
* namespace::clean 0.04

AUTHOR

Top

Douglas Christopher Wilson, <doug at somethingdoug.com>

BUGS AND LIMITATIONS

Top

Please report any bugs or feature requests to bug-nagios-plugin-overhttp at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Nagios-Plugin-OverHTTP. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

LICENSE AND COPYRIGHT

Top


Nagios-Plugin-OverHTTP documentation  | view source Contained in the Nagios-Plugin-OverHTTP distribution.