From 050475667aff291f5690c10ba2362dcef4f6a5d2 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Fri, 10 Oct 2014 09:22:21 +0300 Subject: [PATCH] nagios: Added $expect option support for HTTPs service target. --- nagios/manifests/target.pp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nagios/manifests/target.pp b/nagios/manifests/target.pp index 3623bc4..bce857c 100644 --- a/nagios/manifests/target.pp +++ b/nagios/manifests/target.pp @@ -101,10 +101,21 @@ class nagios::target::http inherits nagios::target { # Configure https service target. # -class nagios::target::https inherits nagios::target { +# === Parameters +# +# $expect: +# Comma-delimited list of strings, at least one of them is +# expected in the first (status) line of the server response +# (default: HTTP/1.) If specified skips all other status line +# logic (ex: 3xx, 4xx, 5xx processing) +# +class nagios::target::https($expect=undef) inherits nagios::target { @@nagios::service { "${::homename}_https": - command => "check_http!--ssl", + command => $expect ? { + undef => "check_http!--ssl", + default => "check_http!--ssl --expect='${expect}'", + }, description => "HTTPS", }