職場サーバで、SSLのサーバ証明書の発行の仕組みが変わったため、 証明書が失効となってしまった。このおかげで一部サービスが動かなかったので、 反省としてサーバ証明書の監視をやってみた。
(( /etc/nagios-plugins/config/https-cert.cfg ))
# 'check_https_cert' command definition
define command{
command_name check_https_cert
command_line LANG=C /usr/lib/nagios/plugins/check_http
--ssl --certificate 50
-H '$HOSTADDRESS$' -I '$HOSTADDRESS$'
}
(( /etc/nagios3/conf.d/xxx_nagios2.cfg ))
define host{
use generic-host
host_name host-xxx
alias host-xxx
address xxx.example.com
check_command check_http
normal_check_interval 10
retry_check_interval 2
notification_interval 10
}
define service{
use generic-service
host_name host-xxx
service_description CERT
check_command check_https_cert
normal_check_interval 120 ; 2時間周期で十分だろう
retry_check_interval 10
notification_interval 120
}