How to create a timeline view showing if the website is ON or OFF?

I have several sites to monitor and I’m trying to create a timeline series to show whether the site is ON or OFF. I receive the HTML codes from Zabbix, I need, for example, codes 302 and 503 to show as “ON” and 404 to show as “OFF”. Is there any way to do this or a better way? Thanks in advance.