SSL確認 https確認

12/20で切れるSSL証明書があったのでnagiosでの証明書確認を組み込んでみたもののエラーが来ずにおかしいとおもっていたら…
check_http -Hとすべきところ-hでヘルプになってました。設定ミス、しかしエラーこないのではまってた。

commands.cfg

#SSL Port
define command{
command_name check_https
command_line $USER1$/check_http -H $HOSTADDRESS$ --ssl
}
#Certificate check 30 days
define command{
command_name check_cert
command_line $USER1$/check_http -H $HOSTADDRESS$ --ssl -C 30
}


services.cfg

define service{
use generic-service
host_name www.verisign.co.jp, www.geotrust.co.jp
service_description HTTPS
check_command check_https
}
define service{
use generic-service
host_name www.verisign.co.jp, www.geotrust.co.jp
service_description HTTPS-CERT
check_command check_cert
}


コマンドでの確認はこちら(verisign.co.jpの場合)

$ /usr/local/nagios/libexec/check_http -H xxx.xxx.xxx.xxx -C 30 --ssl
WARNING - Certificate expires in 1 day(s) (12/20/2006 04:49).
$ /usr/local/nagios/libexec/check_http -H www.verisign.co.jp -C 30 -ssl
OK - Certificate will expire on 03/08/2007 23:59.


んでsslディレクトリにindex.htmlとかがないと403 Forbiddenなエラーがくるのでtouch index.htmlしておきました。こっちも動いてなかったりorz

参考
http://trombik.mine.nu/~cherry/w/index.php/2006/07/26/693/monitoring-ssl-cert-with-nagios
http://www.m3a.org/wiki/index.php?UNIX%2FTools%2FNagios%2Fcheck_http
http://d.hatena.ne.jp/no_ri/20060206
check_http -S -v -C 0 -H www.example.com
でいけるっぽ