I'm using an API call to query my registrar for my domains's expiry date. The data is returned as a string, formatted DD/MM/YYYY. Mostly, this is a future date.
I wish to fire a trigger when the expiry date is 20 days or less.
How can I calculate the difference in days between today and the date value of the string returned by script (this is actually a UserParameter)?
Zabbix is not able to do it. It'll be possible, if you are able to save string DD/MM/YYYY as UNIX timestamp (it's userparameter, so it will be easy). Then the trigger will be (20days = 20*24*60*60sec = 1728000sec):
Python one liner for converting DD/MM/YYY:
So your userparameter should be: