Probes (monitoring locations)
A probe is a remote monitoring location: a small PHP program running anywhere in the world that pulls check jobs from the platform, runs them with the same check library the main server uses, and pushes the results back. The main server itself is the location core. Probes are added by the administrator; users pick locations (or region pools) per monitor up to what their plan allows, and can run on-demand diagnostics from them.
Requirements
- PHP 8.1 or newer with the
curlandopensslextensions (json,mbstringas usual). No database, no web server. - Outbound HTTPS to the platform. Nothing inbound.
- The
pingbinary for ping monitors (otherwise they fall back to a TCP connect). - A copy of
probe/aim-probe.phpplus the check library: either the whole application folder, oraim-probe.phpwithincludes/checks/,includes/netguard.phpandincludes/diag.phpcopied next to it (checks/,netguard.phpanddiag.phpbeside the script). - For diagnostics:
diag.phpnext to the script, and on Linux theping,traceroute(ortracepath) andmtrprograms (tracertandpingon Windows; MTR is Linux only). Withoutdiag.phpthe probe runs checks only, and diagnostics sent to it end as No answer from this location in time.
Register
- Admin → Probes → Add a probe: code (short, e.g.
eu-de-1), name, region, country, city, max jobs per pull and whether Customers may pick this location. The admin gets a one-time registration token and the command to run. - On the probe machine:
mkdir -p /opt/aim-probe && cd /opt/aim-probe
# copy aim-probe.php, checks/, netguard.php and diag.php here, then:
php aim-probe.php --register https://your-monitor.example REGISTER_TOKEN
The probe exchanges the token for its own long-lived token (aimp_…) and writes probe.json (mode 600) with the URL, token, code, poll interval and the key that verifies self-update packages. Add --insecure while the platform still has a self-signed certificate.
- Run it:
php aim-probe.php --daemon # keeps running (use systemd below)
php aim-probe.php # one round: pull, check, push (for cron)
php aim-probe.php --status # reachable? pending jobs? spool size?
php aim-probe.php --update # fetch the current check library from the platform
systemd unit
[Unit]
Description=AllInOneMonitor probe
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=aim
WorkingDirectory=/opt/aim-probe
ExecStart=/usr/bin/php /opt/aim-probe/aim-probe.php --daemon
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
systemctl enable --now aim-probe. Without systemd, a cron line * * * * * cd /opt/aim-probe && php aim-probe.php >/dev/null 2>&1 runs one round a minute (with a 1-minute granularity; the daemon is better for 30-second monitors).
How a probe works
Every round (poll interval from the platform, default 10 s, 1 s while there is work):
- Heartbeat once a minute: version, load, memory, queue depth, checks done, spool size. Admin → Probes shows it; the platform marks a probe offline after 5 minutes of silence.
- Pull up to 25 jobs (never more than the probe's max jobs per pull) that the scheduler queued for this location. The platform answers with the monitor definitions (secrets decrypted for the transport only, over HTTPS, to the authenticated probe) and, when the probe has
diag.php, the diagnostics waiting for it. - Runs HTTP-type checks in parallel (
curl_multi, 20 at a time) and the others one by one. - Push the results; each result carries its own
checked_at. Diagnostic results are pushed straight away and never spooled.
Probe settings and health (Admin → Probes)
The list shows every probe with its code, name, location, IP, Network (ISP and ASN), status (with a draining badge), version, last seen, load / memory, Jobs/min (checks in the last hour divided by 60), Fail 24h (share of its checks in the last 24 hours that were down), its queue (jobs waiting for it, plus the queue the probe itself reported), public, max jobs and weight.
Click a probe for its page:
- Status, Version, Pending jobs (and how many monitors name it), Load / memory.
- Jobs per minute, Failure ratio (24 h) next to the platform average (shown red when it is above 5% and more than twice the average: a sign the probe or its network is the problem, not the targets), Job routing (takes jobs or draining, with its weight and max jobs per pull) and Network (ASN, ISP and network name).
- Charts of the last 24 hours: heartbeats (load and queue) and checks per hour with their failures.
- Probe settings: Name, Region, Country (ISO-2), City, Max jobs per pull (1–1000), Weight (1–100), ISP, ASN, Network name and Customers may pick this location.
The general Probe settings card on the list page holds the poll interval (3–300 s), the Core region label (the region name of the main server, default Primary), Probes update themselves when this installation is newer and the RDAP service used for ISP lookups.
ISP / ASN
The ISP and ASN of each probe feed the Regions and networks comparison on monitor pages and the ISP-specific problem note (Diagnostics). Fill them in by hand (ASN as AS13335 or 13335) or press Look up ISP / ASN (RDAP) on the probe page: the platform asks the RDAP service (default https://rdap.org/ip/, which forwards to the right regional registry) for the probe's IP and stores the network name, ASN, ISP (the registrant) and, when the probe has none yet, the country.
Weight and max jobs
The scheduler sends pool checks to the least busy probe: jobs waiting for it plus the queue it reported, divided by max jobs per pull × weight. Give a stronger machine a higher weight to give it a larger share.
Pools
Besides naming fixed probes, a monitor can use:
region:<Region>— any online public probe of that region (the main server counts when its region label matches), the least busy one for each check;auto:N— N probes from N different regions, chosen per check.
Users pick them in the monitor form's Location pools card; see Diagnostics → Location pools. Give every probe a Region so pools and failover can work: probes of the same region stand in for each other.
Draining a probe
Drain (on the probe page) takes a probe out of service without deleting it, for maintenance or a move:
- it gets no new jobs; its waiting checks move to the main server at once, and later checks go to another online probe of the same region (or the main server);
- its waiting diagnostics end as Probe is being drained and it is no longer offered on the Diagnostics page;
- it stays registered and keeps sending heartbeats, so it still shows as online.
Stop draining lets it take jobs again. Disable is the stronger option: the probe is switched off and its jobs go to the core until you Enable it. Delete removes it; monitors that used it fall back to the core.
Diagnostics jobs
A diagnostic started on the Diagnostics page becomes one job per location in the diag queue. The main server runs its own through the normal workers; a probe receives its diagnostics in the pull answer (at most 10 per round), runs them with diag.php and pushes the results at once. A location that has not answered after 6 minutes is marked No answer from this location in time. Runs are kept 30 days.
Failover
- Jobs are queued per location with a unique key per monitor, location and interval slot, so a probe that was offline never replays old slots.
- When a probe is marked offline, its pending jobs are moved to
coreat once and, for later slots, the scheduler swaps it for the least busy online probe of the same region (orcore) until it is back. A draining probe is treated the same way. Checks never stop; a monitor with several locations keeps its confirmation logic. - The administrator gets an e-mail when a probe goes offline.
- When the platform is unreachable from the probe, the probe keeps running the last job list it received, on each monitor's interval, and spools the results to
spool/*.jsonl. When the platform answers again the spool is pushed first (in batches of 200), so the history has no gap; a result is never lost because the app was down.
Self-update
The platform compares the probe's version with its own on every heartbeat. When Probes update themselves when this installation is newer is on (Admin → Probes, also under Admin → Settings) and a daemon probe is older, it downloads /api/probe/package: aim-probe.php, netguard.php, diag.php and the check files, signed with HMAC-SHA256 under the key handed over at registration. A package whose signature does not verify is refused. Files are written atomically; restart the service to use the new version (Restart=always plus the probe exiting on a rejected token covers the usual cases). --update does the same by hand, and is also the easy way to add diag.php to an older probe.
Users and locations
Users see public probes as locations on the monitor form, and in the API under GET /api/v1/locations. A monitor's results page and response chart break results down per location, and the status is decided across locations as described in Monitors.
একটি ক্লিক আমাদের এই ডকস উন্নত করতে সাহায্য করে।

