Ported from upa/deadman (MIT License)
deadman is a host monitoring tool using ICMP Ping and TCP Ping. It checks whether hosts are alive via ICMP Echo or TCP SYN and displays results in real-time through a terminal UI.
This version is implemented in PowerShell 5.1+ (recommended: PowerShell 7+), using the System.Console API for terminal rendering. Works on Windows, macOS, and Linux.
- π Real-time ping monitoring of multiple hosts
- π Unicode bar chart display for RTT history (βββββ βββ)
- π¨ Color-coded: green = alive, red = no response
- β‘ Supports both sync (sequential) and async (parallel) ping modes
- οΏ½ TCP ping support:
Test-NetConnectionon Windows,hping3on macOS/Linux - οΏ½π Configuration file format fully compatible with the original
- π Optional logging functionality
- π Key interaction:
rto reset statistics,qto quit - π Automatic terminal size detection and redraw
- PowerShell 5.1 or later (PowerShell 7+ recommended for best experience)
- Windows 10 / Windows Server 2016+: Windows PowerShell 5.1 is built-in
- Windows:
winget install Microsoft.PowerShell(for PowerShell 7) - macOS:
brew install powershell - Linux: See official installation guide
- Async mode uses
Start-ThreadJobon PowerShell 7+ orStart-Jobon PowerShell 5.1 - TCP ping on macOS/Linux requires hping3 (
brew install hping/apt install hping3) - TCP ping on macOS/Linux requires
sudo(root privileges) to send raw packets:sudo pwsh ./deadman.ps1 ... - TCP ping on Windows uses the built-in
Test-NetConnectioncmdlet
| OS | PowerShell 5.1 | PowerShell 7+ |
|---|---|---|
| Windows Server 2019 | β | β |
| Windows Server 2022 | β | β |
| Windows 10 | β | β |
| Windows 11 | β | β |
- Windows Terminal (recommended): Full Unicode bar chart support (βββββ βββ), best visual experience
- conhost (legacy console): Automatically falls back to ASCII characters (
_.:β+=@#) for RTT bar chart - To enable Unicode in conhost, run
chcp 65001before executing the script, or use a font like Cascadia Code
# Clone the project
git clone https://github.com/pichuang/deadman-pwsh.git
cd deadman-pwsh
# Start with default config file (sync mode)
./deadman.ps1 -ConfigFile deadman.conf
# Async mode (ping all targets simultaneously)
./deadman.ps1 -ConfigFile deadman.conf -AsyncMode
# Custom RTT scale at 20ms with logging enabled
./deadman.ps1 -ConfigFile deadman.conf -Scale 20 -LogDir ./logs| Parameter | Alias | Type | Description |
|---|---|---|---|
-ConfigFile |
string | Configuration file path (required) | |
-Scale |
-s |
int | RTT bar chart scale, default 10 (milliseconds) |
-AsyncMode |
-a |
switch | Enable async ping mode |
-BlinkArrow |
-b |
switch | Blink arrow indicator in async mode |
-LogDir |
-l |
string | Log directory path |
The configuration file format is fully compatible with the original deadman:
#
# deadman configuration file
# Format: name address [options]
#
# === Basic targets ===
googleDNS 8.8.8.8
quad9 9.9.9.9
# === Separator (use --- or more hyphens) ===
---
# === IPv6 targets ===
googleDNS-v6 2001:4860:4860::8888
# === Specify source interface ===
local-eth0 192.168.1.1 source=eth0
# === TCP ping targets ===
web-https 10.0.0.1 via=tcp port=443
web-http 10.0.0.2 via=tcp port=80
| Option | Description |
|---|---|
source=interface |
Specify the source network interface for ping |
via=tcp |
Use TCP SYN ping instead of ICMP |
port=number |
TCP port number (requires via=tcp) |
Note: The original advanced options such as SSH relay (
relay=), SNMP (via=snmp), netns, and VRF are parsed but not used in this version. They will not produce errors.
| Key | Action |
|---|---|
r |
Reset all target statistics |
q |
Quit the program |
Uses Pester 5 test framework:
# Install Pester (if not already installed)
Install-Module -Name Pester -MinimumVersion 5.0 -Force -Scope CurrentUser
# Run all tests
Invoke-Pester ./tests/ -Output Detailed
# Run a specific test file
Invoke-Pester ./tests/ConfigParser.Tests.ps1 -Output Detailed
# Exclude tests requiring network access
Invoke-Pester ./tests/ -Output Detailed -ExcludeTag 'Network'deadman-pwsh/
βββ deadman.ps1 # Single-file program (all classes, parser, UI, and main loop)
βββ deadman.conf # Example configuration file
βββ LICENSE # MIT License
βββ SECURITY.md # Security policy and vulnerability reporting
βββ README.md # English documentation
βββ README.zh-tw.md # Chinese (Traditional) documentation
βββ .github/
β βββ CODEOWNERS # Auto-assign reviewers
β βββ dependabot.yml # Automated dependency updates
β βββ pull_request_template.md # PR checklist template
β βββ workflows/
β βββ ci.yml # CI tests (Windows Server 2022/2025 Γ PS 5.1/7)
β βββ sast.yml # SAST (CodeQL + PSScriptAnalyzer)
β βββ fuzzing.yml # Fuzz testing (property-based)
β βββ scorecard.yml # OpenSSF Scorecard analysis
β βββ release.yml # Release with SLSA provenance
β βββ pr-assign.yml # Auto-assign PR assignee/reviewer
βββ tests/
βββ ConfigParser.Tests.ps1 # Config parser unit tests
βββ ConsoleUI.Tests.ps1 # Console UI unit tests
βββ PingTarget.Tests.ps1 # PingTarget unit tests
βββ Integration.Tests.ps1 # Integration tests
βββ WindowsCompat.Tests.ps1 # Windows compatibility tests
βββ Fuzz.Tests.ps1 # Fuzz / property-based tests
Note:
deadman.ps1is fully self-contained β just download this single file anddeadman.confto get started.
| Workflow | Purpose | Schedule |
|---|---|---|
| CI | Pester tests on Windows Server 2022/2025 Γ PS 5.1/7 (4 matrix) | Push/PR |
| SAST | CodeQL (Actions security) + PSScriptAnalyzer (SARIF β Code Scanning) | Push/PR + Weekly |
| Fuzzing | 20 property-based fuzz tests (injection, Unicode, edge cases) | Push/PR + Weekly |
| Scorecard | OpenSSF Scorecard analysis β scorecard.dev | Push + Weekly |
| Release | Build zip + SHA-256 + SLSA provenance (Sigstore) | Tag push (yyyymmdd) |
| PR Auto-Assign | Auto-assign assignee + CODEOWNERS reviewer | PR open/reopen |
- Require 1 PR review approval (CODEOWNERS enforced)
- Require 4 CI status checks to pass
- Dismiss stale reviews on new commits
- No force push / branch deletion
- Conversation resolution required
Create a date-based tag to trigger a release:
git tag -a 20260419 -m "Release 20260419"
git push origin 20260419The release workflow will:
- Build a zip archive (
deadman-pwsh-20260419.zip) - Generate SHA-256 checksums
- Create SLSA provenance attestation (
.sigstore.json) - Publish to GitHub Releases
Verify a release:
sha256sum -c checksums-sha256.txt
gh attestation verify deadman-pwsh-20260419.zip -o pichuangSee SECURITY.md for vulnerability reporting policy.
| Feature | Original (Python) | This Version (PowerShell) |
|---|---|---|
| Language | Python 3 + curses | PowerShell 5.1+ |
| UI Framework | curses | System.Console API |
| Ping Implementation | subprocess (ping command) | Test-Connection Cmdlet |
| Async | asyncio | ThreadJob (PS7+) / Start-Job (PS5.1) |
| SSH Relay | β | β (config compatible, but not used) |
| SNMP Ping | β | β |
| RouterOS API | β | β |
| netns / VRF | β | β |
| TCP Ping (hping3) | β | β (Windows: tnc, macOS/Linux: hping3) |
| SIGHUP Reload | β | β (SIGHUP not supported on Windows) |
MIT License β same as the original
- upa/deadman β Original Python version
- Original design and implementation: Interop Tokyo ShowNet NOC team