Greetings,
I built this with my temperature page that I made up a year or 2 ago in mind. One of our Networks guys wanted to poll the system expiration date on his Cisco ISE appliances via API and have it displayed in a similar fashion (Green Yellow Red)
The challenge was that this value is stored in a String format that makes date time calculations difficult. This script pulls that value, converts it to a datetime format, and then when used as the data source for a custom table with HTML tags enabled, will display the value accordingly (greater than 90 days to expiration is green, 89-45 days is yellow, 45 days and under is red)
You do need to find the corresponding value in the APIPoller_XXX tables referenced and pull the ID number to drop into the script. I have only been able to make this work with a single ID per widget but we are only monitoring 4-5 certificates at the moment.
The formula could be manipulated for other formats. It's definitely not the best or most efficient way to do this but it does work! Hoping either this helps someone or brings in some suggestions for improvement. Thanks!