Hello,
We have installed a Icinga Web 2.8.2 product under Ubuntu 18.04.5 LTS server.
When I execute these commands:
/usr/lib/nagios/plugins/check_http --ssl -I my_web_server -t 30
/usr/lib/nagios/plugins/check_http --ssl=1.2 -I my_web_server -t 30
/usr/lib/nagios/plugins/check_http --ssl -S1.2 -I my_web_server -t 30
/usr/lib/nagios/plugins/check_http -S1.2 -I my_web_server -t 30
I get:
HTTP OK: HTTP/1.1 200 OK - 345630 bytes in 0.011 second response time |time=0.010609s;;;0.000000;30.000000 size=345630B;;;0
Perfect, all right!
But ICINGA, when monitoring, is launching this command:
/usr/lib/nagios/plugins/check_http -S 1.2 -I my_web_server -t 30
(there is a space between “-S” parameter and ssl version “1.2”)
/usr/lib/nagios/plugins/check_http -S 1.2 -I my_web_server -t 30
and it FAILS:
HTTP WARNING: HTTP/1.1 400 Bad Request - 513 bytes in 0.008 second response time |time=0.007763s;;;0.000000;30.000000 size=513B;;;0
However, this is ok:
/usr/lib/nagios/plugins/check_http -S1.2 -I my_web_server -t 30
ÂżHow can resolve this difficulty?
/etc/icinga2/hostsservices.conf:
object Service “Servicio HTTP: SSL/TLS version” {
import “generic-service”
host_name = “odcggn”
check_command = “check_http”
vars.notification.mail.users = [ “guigarnu” ]
vars.notification.period = “laboral”
check_period = “laboral”
vars.moncau = “0”
vars.tag = “ODC_SSL_VERSION”
check_interval = 1h + Math.random() * 30
retry_interval = 10m
max_check_attempts = 3
enable_flapping = 1
vars.tls = “1.2”
vars.ssl = “true”
vars.host_name = “my_web_server”
}
/etc/icinga2/conf.d/commands.conf:
…
object CheckCommand “check_http” {
import “plugin-check-command”
command = [ PluginDir + “/check_http” ]
timeout = 30
arguments = {
"-I" = {
value = "$host_name$"
order = 1
}
"-u" = {
value = "$url$"
order = 2
}
"-p" = {
value = "$port$"
order = 3
}
"-H" = {
value = "$virtual_host$"
order = 4
}
"-S" = {
value = "$tls$"
order = 5
}
"-r" = {
value = "$expected_regexp$"
order = 6
}
"-t" = {
value = "$timeout$"
order = 7
}
"-e" = {
value = "$expected$"
order = 8
}
"--ssl" = {
set_if = "$ssl$"
}
"-N" = {
set_if = "$nobody$"
}
}
}
…
http_version: 2.2
/usr/lib/nagios/plugins/check_http --version
check_http v2.2 (monitoring-plugins 2.2)
Any idea?
Thank you