Dear Zabbix forum,
I would like to share you my solution to monitoring SSL certificate on each website.
That has been configured based on external check.
First of all, simple script has been prepared and placed in /externalcheck directory
Next, template has been prepared which execute that script once per day(value of Update interval):
Pls. note that if your host in Zabbix is different that FQDN of your web site you should replace{HOST.NAME} by FQDN. Last think is to setup a triggers, in my case as on picture below:

And result for host called Zabbix.com

I would like to share you my solution to monitoring SSL certificate on each website.
That has been configured based on external check.
First of all, simple script has been prepared and placed in /externalcheck directory
Code:
root@zabbix:/# cat /etc/zabbix/externalscripts/ssl_valid.sh
#!/bin/bash
#Prepared by Marcin 'szremo' Szremski'
SSL_DATE=$(echo | openssl s_client -servername $1 -connect $1:443 2>/dev/null | openssl x509 -noout -dates | grep notAfter | awk -F = '{ print $2 }' | awk 'BEGIN {OFS = "-"} {print $1,$2,$4}')
EXPTIME=$(date -d$SSL_DATE +%s)
TODAY=$(date +"%b-%d-%Y")
CURRENT=$(date -d$TODAY +%s)
NUM=$(($EXPTIME - $CURRENT))
RESULT=$(($NUM/86400))
echo $RESULT
Next, template has been prepared which execute that script once per day(value of Update interval):
Pls. note that if your host in Zabbix is different that FQDN of your web site you should replace{HOST.NAME} by FQDN. Last think is to setup a triggers, in my case as on picture below:
And result for host called Zabbix.com

em_lib.c:707:Expecting: TRUSTED CERTIFICATE
Comment