Sometimes you need to monitor a connection between two hosts, a single service or a host. This script check a connection using Nmap, and requires the IP and the port of the service.
Use a log file
Using a log file can be useful to generate reports, but also for checking the last status of the connection. If we don’t check last status, the script will notify for every check. We don’t want that; we want to be notified when the connection is unsuccessful and when it’s back.