# portscan

Source: https://www.pingtower.com/docs/addons/portscan/

Scan a host's ports and compare against a baseline. Needs nmap.

<span class="pill priv">privileged</span> Add `portscan` to `agent.enable_addons`. Needs the `nmap` binary on the box.

## Parameters

| Parameter | Default | Meaning |
| --- | --- | --- |
| `host`<span class="req">REQUIRED</span> | | Exactly one host. |
| `ports`<span class="req">REQUIRED</span> | | Ports or ranges to scan, up to 1024. |
| `baseline`<span class="req">REQUIRED</span> | | Ports expected open. |
| `max_rate` | `100`/s | Capped at 1000. |
| `host_timeout` | `60s` | |

An open port not in the baseline is **down**. A baseline port proved closed is **degraded**. A port the scan could not determine is degraded.

## Measurements

`open_ports`, `unexpected_ports`, `missing_ports`, `undetermined_ports`, `scan_ms`.

<div class="docs-callout warn"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2 1.5 13.5h13L8 2Z"/><path d="M8 6.5v3M8 11.5v.5"/></svg><div><span class="t">Scan only what you own</span>A port scan is a heavier network footprint than the other addons and is noticed by the target. Point it at your own hosts.</div>
</div>
