I would like to check that a defined port on a host is closed, for example the 8080 port on host www.example.com. I tried something like:
check host www.example.com with address www.example.com
if not failed 8080 protocol http then alert
but I think I cannot use that syntax because the not keyword is not allowed there:
/etc/monit/conf.d/myhost:29: Error: syntax error 'failed'
Is there any way to do that without writing an external script?