Create a host file in /etc/icinga2/conf.d/hosts eg website-ripe.conf
Create the host details
object Host "website-ripe" {
import "generic-host"
address = "ripe.net"
address6 = "::1"
vars.os = "Linux"
vars.sla = "24x7"
}
How to monitor a website over SSL (service)
object Service "httpS" {
host_name = "website-ripe"
vars.http_vhost = "ripe.net"
vars.http_address = "193.0.6.139"
vars.http_ssl = "1"
vars.http_sni = "1"
vars.http_warn_time = "5"
vars.http_critical_time = "10"
check_command = "http"
}
Monitoring the SSL key expiration date, give warning 30 before and alert at 14 days before. (service)
object Service "website-ripe-key-expire"{
host_name = "website-ripe"
check_command = "check-ssl-exp"
vars.days = 30,14
vars.url = "ripe.net"
}
Because it's not a default check -the -C (certificate) parameter is not available in Icinga- we need to create a custom checkCommand
object CheckCommand "check-ssl-exp" {
import "plugin-check-command"
command = PluginDir + "/check_http -H $url$ -C$daysquot;
}
Error:
[2014-07-30 12:58:00 +0200] critical/config:
Config error: Invalid value for attribute: Object 'check_ssl' (Type: 'CheckCommand') at /etc/icinga2/conf.d/hosts/website-ripe.conf:28 -> Attribute 'methods'
[2014-07-30 12:58:00 +0200] critical/config: 1 errors, 0 warnings.
Solution:
add import "plugin-check-command" ot the oject checkcommand section.
Create the host details
object Host "website-ripe" {
import "generic-host"
address = "ripe.net"
address6 = "::1"
vars.os = "Linux"
vars.sla = "24x7"
}
How to monitor a website over SSL (service)
object Service "httpS" {
host_name = "website-ripe"
vars.http_vhost = "ripe.net"
vars.http_address = "193.0.6.139"
vars.http_ssl = "1"
vars.http_sni = "1"
vars.http_warn_time = "5"
vars.http_critical_time = "10"
check_command = "http"
}
Monitoring the SSL key expiration date, give warning 30 before and alert at 14 days before. (service)
object Service "website-ripe-key-expire"{
host_name = "website-ripe"
check_command = "check-ssl-exp"
vars.days = 30,14
vars.url = "ripe.net"
}
Because it's not a default check -the -C (certificate) parameter is not available in Icinga- we need to create a custom checkCommand
object CheckCommand "check-ssl-exp" {
import "plugin-check-command"
command = PluginDir + "/check_http -H $url$ -C$daysquot;
}
Error:
[2014-07-30 12:58:00 +0200] critical/config:
Config error: Invalid value for attribute: Object 'check_ssl' (Type: 'CheckCommand') at /etc/icinga2/conf.d/hosts/website-ripe.conf:28 -> Attribute 'methods'
[2014-07-30 12:58:00 +0200] critical/config: 1 errors, 0 warnings.
Solution:
add import "plugin-check-command" ot the oject checkcommand section.
No comments:
Post a Comment