From 5e378c92936b2f4fc74816aff947c349c32d24d9 Mon Sep 17 00:00:00 2001 From: Jens Rehsack Date: Tue, 7 Aug 2012 12:13:21 +0200 Subject: [PATCH] move some defaults from code to global configuration defaults and add resonable new ones --- etc/check_web2.json | 14 +++++++++++++- lib/WWW/Mechanize/Script/Util.pm | 16 +++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/etc/check_web2.json b/etc/check_web2.json index 578cfc4..3482662 100644 --- a/etc/check_web2.json +++ b/etc/check_web2.json @@ -5,12 +5,24 @@ "response_code" : 2, "min_bytes_code" : 2, "max_bytes_code" : 1, + "regex_forbid_code" : 2, + "regex_require_code" : 2, + "text_forbid_code" : 2, "text_require_code" : 2, "min_elapsed_time_code" : 1, - "max_elapsed_time_code" : 2 + "max_elapsed_time_code" : 2, + "ignore_case" : true, + "text_forbid" : [ + "Premature end of script headers", + "Error processing directive", + "XML Parsing partner document", + "sun.io.MalformedInputException", + "an error occurred while processing this directive" + ] }, "request" : {} }, + "script_dirs" : ["/data/devel/Vodafone/vzapp-nagios/nagios-plugins/check_web_config"], "summary" : { "template" : "[% CODE_NAME; IF MESSAGES.size > 0 %] - [% MESSAGES.join(', '); END %]\n", "target" : "-" diff --git a/lib/WWW/Mechanize/Script/Util.pm b/lib/WWW/Mechanize/Script/Util.pm index bdff6be..5a6b54d 100644 --- a/lib/WWW/Mechanize/Script/Util.pm +++ b/lib/WWW/Mechanize/Script/Util.pm @@ -71,19 +71,9 @@ sub load_config _HASH( $_[0] ) and %opts = %{ $_[0] }; my %cfg = ( defaults => { - terse => 'failed_only', - save_output => 'yes', # report ... - show_html => 'yes', # report ... - check => { - ignore_case => 'yes', - text_forbid => [ - 'Premature end of script headers', - 'Error processing directive', - 'XML Parsing partner document', - 'sun.io.MalformedInputException', - 'an error occurred while processing this directive' - ], - }, + terse => 'failed_only', + save_output => 'yes', # report ... + show_html => 'yes', # report ... }, request => { agent => { -- 2.11.4.GIT