Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_ssl_cert_alternative
103675
File | Description |
---|---|
check_ssl_cert_alternative.pl | Perl check_ssl script. |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Perl script to check an SSL cerificate and warn and/or alarm if the certificate is due to expire.
Differs from other version of check_ssl_cert in that temporary files are not used (as per Nagios documentation). In addition, Date::Calc is not used (no separate perl plugins required).
It was written without me being aware that check_ssl_cert exists as it is not in the Networking section of Check Plugins.
Differs from other version of check_ssl_cert in that temporary files are not used (as per Nagios documentation). In addition, Date::Calc is not used (no separate perl plugins required).
It was written without me being aware that check_ssl_cert exists as it is not in the Networking section of Check Plugins.
Reviews (1)
byCWSI, May 5, 2015
Love the script. There's an issue with hostnames that have a hyphen in them however, so the likes of myserver.my-domain.com:443 causes a failure of the script.
I'm not familiar with Perl so could not work out exactly why, but the following REGEX drops everything before the hypen in the hostname (so it would try to check the expiry of domain.com:443 in my example above) -
if ($cmd_options{H} =~ /([\w+\.*]+\:\d+)/){
$hostname_port_number=$1;
Changing this to the below solved it for me, but I'm not sure if the author was trying to use the REGEX to clean up the hostname in some way so this fix may not be ideal, but it does work -
if ($cmd_options{H} =~ /([\w+\.*]+\:\d+)/){
$hostname_port_number=$cmd_options{H};
I'm not familiar with Perl so could not work out exactly why, but the following REGEX drops everything before the hypen in the hostname (so it would try to check the expiry of domain.com:443 in my example above) -
if ($cmd_options{H} =~ /([\w+\.*]+\:\d+)/){
$hostname_port_number=$1;
Changing this to the below solved it for me, but I'm not sure if the author was trying to use the REGEX to clean up the hostname in some way so this fix may not be ideal, but it does work -
if ($cmd_options{H} =~ /([\w+\.*]+\:\d+)/){
$hostname_port_number=$cmd_options{H};