Script(s) needed to monitor for JavaScript-errors and SSL-certificate

Hi,

I’ve been looking for a script to

a) monitor a page/URL for JavaScript errors

and

b) automatically check a host for a valid SSL-certificate (certificate expired, etc.)

The scripting language is not really important as I’m planning on running the script(s) via CRON on a Virtual Private Server.

Any input is appreciated. Thanks!