PortcheckR is a small CLI tool to check reachability of ports and services on a host, aggregate the results, and optionally send a report by email.
Features
- Check multiple targets with
-P port:PROTO:init(example:21:FTP:1). - Per-protocol handlers (FTP, SMTP/SMTPS, POP3/POP3S, IMAP/IMAPS, SSH, TELNET, HTTP/HTTPS, etc.) with a TCP fallback.
- Output combined report to stdout and optionally send it by email when
-Mis provided. - Use
--mail-testto force sending the report even when no NG (failure) occurred.
Requirements
- Rust (stable toolchain)
- Network access to target host and SMTP server when sending mail
- ICMP (ping) checks may require root privileges on some systems
Build
cargo build --releaseUsage examples
- Basic check and print:
./target/release/portcheck -H example.com -T 5 -U MyUnit -P 80:HTTP:1 -P 22:SSH:1- Send report by mail when an NG is detected (default mail server is localhost:25):
./target/release/portcheck -H host -T 5 -U MyUnit -P 21:FTP:1 -M ops@example.com -S mail.example.com:587 -F portcheck@example.com- Mail test: send report even if all checks are OK:
./target/release/portcheck -H host -T 5 -U MyUnit -P 80:HTTP:1 -M ops@example.com --mail-testContributing
- Open issues for bugs or feature requests. Pull requests are welcome.
License
- MIT. See the
LICENSEfile for details.