NMAP specific port tracking

I have an unRaid server hosting a few non Home Assistant VM’s.
I would like to track them to see if they have gone down.
One is at 192.168.1.12:5901
I know that using nmap I can ping it using nmap -p 5901 192.168.1.12 and the result is
PORT STATE SERVICE
5901/tcp open vnc-1

How might I develop an automation to tell me if it working or not.
Thanks

You’d want to use a command line sensor with a value template to parse the results:

1 Like