Server Monitor

The guy who wrote my monitring scripts is AWOL and I need to update my scripts. cURL works fine for monitoring http (port 80) and https (port 443) but I haven’t figured out how best to monitor:

ftp (port 21)
smtp (port 26 or 25)
pop (port 110)
mysql (port 3306)

Any guidance would be highly appreciated.

You could use nmap via exec or system.

nmap -p 21 myftp.com