🐧 Linux • Monitor any TCP port • Alert on consecutive timeout & restored

Port_Alert Linux: Monitor TCP Services and Get Alerts (Timeout / Restored)

Port_Alert Linux monitors TCP service connectivity (MySQL/MSSQL/SSH/FTP/HTTP/SMTP/DNS/ORACLE and more) and alerts you only when connection timeouts happen consecutively — then sends another alert when service is restored. No repeated alerts during continuous failure.

How it works

  • Monitors TCP services such as FTP (21), SSH (22), SMTP (25), DNS (53), HTTP (80), MSSQL (1433), MySQL (3306) — or any custom TCP port.
  • Detects consecutive TCP connection timeouts.
  • Sends alert only when status changes: Normal → Timeout, then Timeout → Normal (restored).
  • No repeated alerts while the service remains in timeout state.
  • Writes timeout records to a log file with timestamp, and can mail the log file daily.
  • “I am Alive” periodic mail notification option to confirm the program is running.
  • SMS/Email alerts can be sent from our server, and you can also configure alternative SMTP to send email alerts.

Installation & run (Linux)

Download, unzip, edit config files, then run the program. After you test OK, you can run in background with silent mode.

# Download and unzip
wget https://www.sms4mail.com/download/portalert_linux.zip
unzip portalert_linux.zip
cd portalert

# Edit config files
nano portalert_host.txt
nano portalert_setup.txt
nano portalert_email.txt   # optional (alternative SMTP)

# Run
./portalert

# Silent background mode (after testing OK)
./portalert -s &

Tip: TCP ports are numerical identifiers in host-to-host communications. Monitoring TCP ports is monitoring the server’s TCP services.

Configuration files

These files are included in the Linux download zip.

FilePurpose
portalert_host.txtHost + port definitions (what to monitor)
portalert_setup.txtAccount setup for receiving SMS and Email alerts
portalert_email.txtOptional alternative SMTP configuration for email alerts
portalertLinux executable program

Alert text examples

Example messages showing “Timeout” and “Restored” states.

TCP TIMEOUT
Description + Host/IP:Port + timeout start/end time
[2019-08-25 13:59:12] 🔴 TCP TIMEOUT
Host: NY MYSQL Server
IP: 192.168.1.1
Port: 3306
Timeouts: 5 consecutive
Duration: 2019-08-25 13:57:56 to 2019-08-25 13:59:12
RESTORED
Sent when the status returns to normal
[2019-08-25 14:01:18] 🟢 RESTORED
Host: NY MYSQL Server
IP: 192.168.1.1
Port: 3306
Status: Back to normal

SMTP options (Email delivery)

  • Use SMS4Mail server delivery (default), or configure alternative SMTP for email alerts.
  • Local SMTP server
  • Gmail / Yahoo (use App Password instead of email password)
  • SendGrid SMTP relay (API key as password; no security concern; 100/day free tier)
SMTP setup guides