Skip to content

Screenshots of the sensors ​

Every sensor kind has pictures of the real product watching a real target, in the light and the dark theme, embedded in its page under docs/sensors/. A person does not take them: a Playwright spec does, so they can be made again whenever the interface changes.

What is photographed ​

For each entry in ui/e2e/sensor-shots.ts the spec ui/e2e/91-sensor-screenshots.spec.ts writes four pictures into ui/e2e/screenshots/sensors/:

FileShows
<kind>-form-light.png, <kind>-form-dark.pngThe "Add sensor" form with the kind's parameters filled in, so a reader sees what there is to set.
<kind>-sensor-light.png, <kind>-sensor-dark.pngThe sensor's own page after at least three successful polls: health, channels, the charts and the last scans.

The spec makes the group, device and sensor through the API, so every case gets exactly the parameters it lists, and waits until the sensor has polled. The poll interval is a few seconds for local targets and ten seconds for Windows, so the whole run takes a few minutes.

Adding a sensor kind ​

Add one entry to SENSOR_SHOTS:

ts
{ kind: 'win_disk', target: 'winrm', params: () => ({ volume: 'C:' }) },

kind is the key from GET /api/v1/sensor-kinds; the display name for the form is read from there. target says where the sensor looks (below). params gives the parameters, and receives the ports of the web and TCP targets that the e2e runtime starts. name is optional and defaults to the kind's display name. Then embed the light picture in the kind's page under a "What it looks like" heading, as the existing pages do, and link the other three.

Targets ​

A target is defined in ui/e2e/sensor-targets.ts.

  • none is the e2e runtime's own web and TCP targets (ui/e2e/harness.ts). Cases for it always run.

  • winrm is a Windows Server reached over WinRM. It is described only by environment variables, the same ones the live Rust tests use: PROBEWARD_TEST_WINRM_HOST (an address, optionally with :port), PROBEWARD_TEST_WINRM_USER (user, DOMAIN\user or user@realm) and PROBEWARD_TEST_WINRM_PASSWORD. Without them the Windows cases are skipped and say why. PROBEWARD_TEST_WINRM_HIDE is an optional comma-separated list of further names to hide, such as the machine's host name.

  • hyperv is a Windows Server with the Hyper-V role and one small guest, for the win_hyperv_* kinds. It is described like winrm, with PROBEWARD_TEST_HYPERV_HOST, _USER and _PASSWORD, plus PROBEWARD_TEST_HYPERV_VM (the guest's name, for win_hyperv_vm; a case without it is skipped). PROBEWARD_TEST_HYPERV_HIDE is a comma-separated list of names to hide, each name or name=what to show instead (lab-host=hyperv-host,lab-vm=app-guest); a bare name is shown as hyperv-host. The address becomes 192.0.2.10, the domain EXAMPLE and the account monitor.

  • vsphere is an ESXi host or vCenter reached through its API, again described only by environment variables, the same ones the live Rust tests use: PROBEWARD_TEST_VSPHERE_HOST (an address), PROBEWARD_TEST_VSPHERE_USER and PROBEWARD_TEST_VSPHERE_PASSWORD. A case may also need names of the lab: PROBEWARD_TEST_VSPHERE_VM (a powered-on machine, for vmware_vm) and PROBEWARD_TEST_VSPHERE_DATASTORE (default datastore1). A case that needs a variable that is not set is skipped and says which. PROBEWARD_TEST_VSPHERE_HIDE is a comma-separated list of the host and machine names to hide; each entry is name or name=what to show instead (lab-host=esx1,lab-vm=app-vm), and a name also hides when DNS labels follow it. The root account of an ESXi host is not hidden, as it names nobody.

  • aws is a CloudWatch-compatible endpoint such as AWS Emulator in a container on this machine, described by the variables of the live tests: PROBEWARD_TEST_AWS_ENDPOINT (a URL with an IP address), _REGION, _KEY_ID, _SECRET and _PIN (the certificate's fingerprint). The run seeds the metrics it shows (a namespace Example/Web, 55 minutes of datapoints) with a signed PutMetricData, and the sensor's credential is made the group's AWS credential. The endpoint's address and port are shown as 192.0.2.10:9297. The key is only ever in a password field, which a picture does not show.

  • postgres, mysql and mssql are database servers. Each is described by PROBEWARD_TEST_PGQ_*, PROBEWARD_TEST_MYSQL_* or PROBEWARD_TEST_MSSQL_* with ADDR (host:port), USER and PASSWORD, the same variables the live tests use, and the login is made the group's secret credential as user:password. The first two are containers on the machine that takes the pictures and show their own address. The SQL Server target is a lab machine and is masked like the Windows one: its address becomes 192.0.2.10, the login monitor, and the names in PROBEWARD_TEST_MSSQL_HIDE DBSERVER.

  • netsvc is a machine that runs the protocol services: a directory, a RADIUS server, NTP, DHCP and SIP. It is described by environment variables too; the sensors of the LDAP, RADIUS, NTP, DHCP and SIP kinds look at it. PROBEWARD_TEST_NETSVC_HOST (an address) and PROBEWARD_TEST_NETSVC_PASSWORD (the one password every account has) are the machine; PROBEWARD_TEST_LDAP_BASE and PROBEWARD_TEST_LDAP_USER (the bind name, starting uid=) say where to search, as in the live tests; PROBEWARD_TEST_RADIUS_USER is the account for RADIUS; PROBEWARD_TEST_DHCP_VENDOR is the vendor class the DHCP server answers, with the optional PROBEWARD_TEST_DHCP_INTERFACE and PROBEWARD_TEST_DHCP_SERVER as in the live tests. PROBEWARD_TEST_NETSVC_HIDE is a comma-separated list of names to hide (host name, domain, organisation), and PROBEWARD_TEST_NETSVC_ACCOUNTS of account names to hide; the address and the rest of its network are rewritten to the documentation range. The bind login goes in as the group's secret credential and the RADIUS login as its RADIUS credential. The DHCP picture needs port 68, which the server the runtime starts may not bind as an ordinary user. Give the built binary the capability before the run, for instance from a container, and do not rebuild in between (a build replaces the file and the capability with it): docker run --rm -v "$PWD/target/debug:/t" python:3-slim python3 -c "import os, struct; os.setxattr('/t/probeward', 'security.capability', struct.pack('<IIIII', 0x02000001, 1 << 10, 0, 0, 0))". Without it the DHCP sensor fails with the message that says what it needs.

  • netem_ping, netem_trace, netem_ports and netem_qos are one lab machine with an address for each network impairment, described by the variables the live tests of the network quality sensors use (listed in docs/sensors/qos.md): PROBEWARD_TEST_NETEM_DELAY80J_LOSS2 for the ping picture, _CLEAN for the traceroute and port range pictures with _OPEN_PORT, and _DELAY100J with _REFLECTOR_PORT for the QoS picture. Every address of the machine's network is shown as the same host of 192.0.2.0/24.

  • Receivers. The snmp_trap and syslog kinds look at none: the runtime server the e2e harness starts listens for traps and syslog on loopback ports it picks (trapPort and syslogPort in the state), and the entry's feed function sends them messages from the loopback address, which is the device's address, once the sensor has polled (a receiver sensor watches a device from its first poll on). receiver-feed.ts has the senders. The addresses inside the messages are in the documentation ranges. Nothing about a lab is needed.

  • Flow collectors. The netflow and sflow kinds look at none as well: the runtime server's NetFlow and sFlow collectors listen on loopback ports the harness picks (flowPort and sflowPort in the state), with 5-second intervals (PROBEWARD_FLOW_INTERVAL_SECS), and the entry's feed function sends them half a minute of made-up traffic (IPFIX and sFlow datagrams, flow-feed.ts) between hosts of the documentation ranges, from the loopback address, once the sensor has polled. Nothing about a lab is needed.

  • iot is a machine that runs an MQTT broker, a Modbus TCP device and an OPC UA server; the sensors of the mqtt_broker, mqtt_topic, modbus and opcua kinds look at it. It is described by the variables the live Rust tests read: PROBEWARD_TEST_MQTT_HOST (the machine's address, which the Modbus and OPC UA cases use too), PROBEWARD_TEST_MQTT_USER and PROBEWARD_TEST_MQTT_PASSWORD (the broker login, made the group's login credential), PROBEWARD_TEST_MQTT_TOPIC (a topic holding a number) and the optional PROBEWARD_TEST_MQTT_ROUNDTRIP_TOPIC and PROBEWARD_TEST_MQTT_NAME; PROBEWARD_TEST_MODBUS_HOST and _PORT; PROBEWARD_TEST_OPCUA_HOST, _PORT and _NODE. The broker is reached over TLS without verifying its certificate, which comes from the lab's own authority. PROBEWARD_TEST_IOT_HIDE is a comma-separated list of names to hide (the lab's name, the machine's name), which topics and the broker's name may carry; the address becomes 192.0.2.40 and the login monitor. A case whose PROBEWARD_TEST_MODBUS_HOST or PROBEWARD_TEST_OPCUA_HOST is not set is skipped.

  • snmpsim_nas, snmpsim_printer and snmpsim_env are recordings of real devices (a Synology DiskStation, a Dell laser printer, an APC environment monitor) replayed by the lab's SNMP simulator, which answers each recording under an SNMPv2c community named after it. They are described by the variables the live Rust tests read: PROBEWARD_TEST_SNMPSIM_HOST (an address) and the optional PROBEWARD_TEST_SNMPSIM_PORT. The community, which is the recording's name, goes in as the group's SNMP credential; the address, the rest of its network and the community are rewritten in the pictures. The recordings are GPL and are never copied into the repository.

  • snmp_example is an agent the spec starts itself, for the sensor kinds that no recording of a real device exists for (the Cisco QoS class): net-snmp's snmpd on a loopback port serving crates/probeward-sensors/fixtures/snmprec/cisco-qos-example.snmprec, a recording written for the purpose, through the pass-agent.py next to it. Needs snmpd and python3 on the path, and nothing else; the case is skipped without them. The picture is of a made-up router and says so on its documentation page.

  • websvc is a web server with an identity server on it: the page load sensor looks at its HTTPS site, and the transaction sensor signs in to the identity server through the authorisation code flow. It is described by PROBEWARD_TEST_WEB_HOST (an address), PROBEWARD_TEST_WEB_USER and PROBEWARD_TEST_WEB_PASSWORD (an account of the identity server, made the group's login credential), PROBEWARD_TEST_WEB_REALM and PROBEWARD_TEST_WEB_CLIENT (the realm and a public client that allows the redirect address http://localhost/cb), and optionally PROBEWARD_TEST_WEB_KEYCLOAK_PORT (default 8080). PROBEWARD_TEST_WEB_HIDE is a comma-separated list of host and domain names to hide. The address becomes 192.0.2.10, the account monitor, the client web-app and the realm and the listed names example. The page load picture does not check the lab's certificate.

  • sshscript is a Linux server with a test account that has a normal shell and a small program, for the ssh_script kind, described by the variables of its live tests: PROBEWARD_TEST_SSH_SCRIPT_HOST, _USER, _PASSWORD (made the group's SSH credential), _COMMAND (the program's path) and _HOST_KEY (its fingerprint, shown as a made-up one). PROBEWARD_TEST_SSH_SCRIPT_HIDE lists names to hide. The address becomes 192.0.2.30 and the account monitor.

  • dockersvc is a Docker host with its API on the TLS port, for the docker_container kind: PROBEWARD_TEST_DOCKER_HOST, _CERT_FILE, _KEY_FILE and _CA_FILE (PEM files, made the group's TLS client credential) and PROBEWARD_TEST_DOCKER_SHOT, the container to photograph, shown as orders-api. PROBEWARD_TEST_DOCKER_HIDE lists names to hide, PROBEWARD_TEST_DOCKER_PORT is the port if it is not 2376, and the address becomes 192.0.2.31.

A new kind of lab machine is a new key in TargetName (in sensor-shots.ts) and a new entry in TARGETS: what it is called, its group and intervals, the credential to create, and the words to hide. Read the values from the environment and never write them into a file.

Keeping the lab out of the pictures ​

Addresses, host names, domain names and account names of a lab machine must not appear in a picture. The device is named neutrally (Windows server), and before each shot the spec rewrites the text of the page: the address becomes 192.0.2.10, the domain EXAMPLE, the account monitor and the names in PROBEWARD_TEST_WINRM_HIDE WINSERVER, including any DNS suffix after them. Only whole words are rewritten, so a name that is also an ordinary word leaves the product's text alone. A built-in account (administrator, admin, guest) is hidden only together with its domain (DOMAIN\administrator): on its own it names nobody, and hiding it turned "administrators" into "monitors". A mutation observer keeps doing so while the live stream redraws. The spec then reads the page text back and fails the test if anything that should be hidden is still there. This cannot see the inside of a chart, so choose parameters whose output does not name the machine, and always look at every picture before committing it.

Regenerating ​

sh
just dev-up
cd ui
PROBEWARD_TEST_WINRM_HOST=... PROBEWARD_TEST_WINRM_USER=... PROBEWARD_TEST_WINRM_PASSWORD=... \
  pnpm e2e --project=runtime -g "sensor screenshots"

Run on its own like this, the spec creates the administrator itself. The whole suite (pnpm e2e) produces the same pictures at its end.

The variables of every target, and the _HIDE lists, are described in live tests.

AGPL-3.0-only