Skip to content

Exit plugin with CRITICAL if no response #3

Closed
@prupert

Description

Currently, the plugin will exit with UNKNOWN if the web server does not respond correctly to the request for the Apache status page. In our use case we would like to have the CRITICAL exit code, as this indicates that Apache is unresponsive.

Would it be possible to make the exit code of the "" condition configurable? E.g.

Add the option

$options->arg(
  spec     => 'critical_on_failure|C',
  help     => 'exit with critical status when fetching status page failed',
  required => 0,
);

Add the condition at the end of the script

(...)
} else {

 if (defined($options->critical_on_failure)) {
    $status = 2;
  } else {
    $status = 3;
  }

  $plugin->plugin_exit( $status, $response->headers->title );

}

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions