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", }