Back to home page

EIC code displayed by LXR

 
 

    


Warning, /swf-monitor/docs/PANDA_SERVER_REPORTER.md is written in an unsupported language. File is not indexed.

0001 # PanDA server host reporter
0002 
0003 A reporter agent on the PanDA server host (pandaserver01) delivers
0004 server-side observations to swf-monitor for the platform-health
0005 component and view (SNAPPER_PLATFORM.md). It complements what the PanDA
0006 database shows from outside the host: request rates and outcomes at the
0007 web tier, daemon liveness, and host resources. The agent is a
0008 standalone script in the house pattern — Python standard library only,
0009 local state file, periodic run, HTTPS delivery to a swf-monitor REST
0010 ingest under a token — and it is read-only with respect to PanDA.
0011 
0012 ## Functions
0013 
0014 Each run covers one 5-minute interval and posts one record.
0015 
0016 | Function | Source on the host | Fields delivered |
0017 |---|---|---|
0018 | Web-tier request accounting | `/var/log/panda/panda_server_access_log` | requests per endpoint (updateJob, getJob, harvester, others); HTTP status split (2xx, 4xx, 5xx); request duration percentiles where logged |
0019 | Web-tier error markers | `/var/log/panda/panda_server_error_log` | counts of worker-saturation markers, SSL read failures, WSGI errors, per interval |
0020 | Daemon liveness and log freshness | `/var/log/panda/panda-*.log`, process table | for each PanDA daemon (Watcher, copyArchive, JobGenerator, JEDI daemons, MCP): process present, seconds since last log line, restart count since last run |
0021 | Watcher activity | `/var/log/panda/panda-Watcher.log` | lost-heartbeat kills per interval, oldest heartbeat age seen |
0022 | Service state | `systemctl status` (unprivileged view) | active/inactive per PanDA unit: panda_httpd, panda_daemon, panda_jedi, panda_mcp |
0023 | Host resources | `/proc`, `df` | load average, memory, root and /var volume use, httpd and python process counts |
0024 | Database reachability from the server host | TCP connect and a timed trivial query | connect latency, query latency, failure flag |
0025 | Web-tier occupancy | Apache `mod_status` on localhost | busy and idle workers, scoreboard — not enabled today (see below) |
0026 | System journal events | `journalctl` | daemon crashes, OOM kills, unit restarts — not readable today (see below) |
0027 
0028 Every failure to read a source is delivered as a field, never dropped;
0029 an unreachable swf-monitor buffers records locally and posts the
0030 backlog on the next run. The component's freshness watch reports a
0031 silent reporter.
0032 
0033 ## Access inventory
0034 
0035 Verified on 2026-08-25 for the account that will run the reporter
0036 (uid `wenauseic`, group `eic`):
0037 
0038 Available without additional privilege:
0039 
0040 - All PanDA logs: `/var/log/panda/` is world-writable with world-readable
0041   files, including the web-tier access and error logs and every daemon
0042   log.
0043 - PanDA configuration: `/etc/panda/panda_server.cfg` and
0044   `panda_jedi.cfg` are readable.
0045 - Process table, `/proc`, `df`, unprivileged `systemctl` views.
0046 - Outbound HTTPS to swf-monitor (`pandaserver02.sdcc.bnl.gov`, verified)
0047   and TCP to the database host (`pandadb01.sdcc.bnl.gov:5432`, verified).
0048   `psql` is installed; the system `python3` (3.11) has no `psycopg2`, so
0049   the database check uses `psql` in a subprocess or a TCP connect only.
0050 - Scheduling: cron is permitted for the account (`/etc/cron.deny` is
0051   empty; no `cron.allow`), so a cron entry runs the reporter today with
0052   no request. Unprivileged systemd user units exist but do not persist
0053   across logout without linger.
0054 
0055 Privileged access: the account holds passwordless sudo
0056 (`(root) NOPASSWD: ALL`, verified 2026-08-25). Not yet set, and set by
0057 the reporter's install step under that access:
0058 
0059 - Lingering user session (`Linger=no` today), so that a user systemd
0060   unit persists across logout; alternatively a system unit, as the
0061   swf-monitor bots on pandaserver02 are installed.
0062 - System journal: the account is not in `systemd-journal`; daemon
0063   crash, OOM, and unit restart events are read once it is.
0064 - Root-only logs: `/var/log/messages` (`/var/log/httpd/` is empty;
0065   PanDA's web tier logs under `/var/log/panda/`).
0066 - Apache `mod_status`: not enabled (no listener on localhost:80).
0067 
0068 Host note: the root volume is 12 GB at 64% use, /var is 32 GB at 40%;
0069 the account's home is on the shared EIC NFS volume at 91% use. The
0070 reporter's state and buffer files are kept small and rotated.
0071 
0072 ## Privileged setup at install
0073 
0074 Each step is one root action, read-only in effect except the last:
0075 
0076 1. **Persistent service** — a system unit under `/etc/systemd/system/`
0077    with `Restart=always`, or `loginctl enable-linger wenauseic` with a
0078    user unit. Either replaces the cron form.
0079 2. **`systemd-journal` group membership** — adds daemon crash, OOM, and
0080    unit restart events to the report.
0081 3. **Apache `mod_status` on localhost** — one httpd configuration
0082    fragment (`ExtendedStatus On`, `/server-status` allowed from
0083    127.0.0.1 only). Adds direct web-tier occupancy: busy and idle
0084    workers against `MaxRequestWorkers`, the saturation signal the logs
0085    only show indirectly.
0086 4. **Service control** — `systemctl status|restart` on `panda_httpd`,
0087    `panda_daemon`, `panda_jedi`, `panda_mcp`, for the operations step
0088    beyond monitoring: the worker releaser (SNAPPER_PLATFORM.md, Worker
0089    release for stalled jobs) and daemon restarts on a silent-daemon
0090    detection. Operational control stays behind the platform's
0091    proposal and action-stream conventions; the access alone changes
0092    nothing.
0093 
0094 Every install action on this host is announced and recorded in the
0095 action stream before it is taken.
0096 
0097 ## Delivery
0098 
0099 The reporter posts to a swf-monitor REST ingest endpoint authenticated
0100 by a per-host token, in the arrangement the GPU worker host uses. The
0101 ingest stores the record as the server-side fields of the platform
0102 component; the component publication on the 5-minute refresh merges
0103 them with the database-side fields. Token and endpoint live in the
0104 reporter's environment file, mode 600.
0105 
0106 ## Related
0107 
0108 - SNAPPER_PLATFORM.md — the platform-health component, view, and
0109   correlation functions this reporter feeds.
0110 - [SNAPPER.md](SNAPPER.md) — Snapper operations in SWF.
0111 - [ERROR_ATTRIBUTION.md](ERROR_ATTRIBUTION.md) — the error-label
0112   correction service that consumes the same observations.