diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 5c9416a..1daf4e7 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -107,7 +107,16 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - path: cacti/plugins/redfish + path: redfish-source + + - name: Install Redfish from release archive + run: | + set -euo pipefail + mkdir -p cacti/plugins/redfish + git -C redfish-source archive --format=tar HEAD | tar -xf - -C cacti/plugins/redfish + test ! -e cacti/plugins/redfish/tests + cp -a redfish-source/tests cacti/plugins/redfish/tests + cp redfish-source/phpunit.xml redfish-source/phpunit-integration.xml redfish-source/phpstan.neon cacti/plugins/redfish/ - name: Install PHP ${{ matrix.php }} uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 @@ -353,7 +362,16 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - path: cacti/plugins/redfish + path: redfish-source + + - name: Install Redfish from release archive + run: | + set -euo pipefail + mkdir -p cacti/plugins/redfish + git -C redfish-source archive --format=tar HEAD | tar -xf - -C cacti/plugins/redfish + test ! -e cacti/plugins/redfish/tests + cp -a redfish-source/tests cacti/plugins/redfish/tests + cp redfish-source/phpunit.xml redfish-source/phpunit-integration.xml redfish-source/phpstan.neon cacti/plugins/redfish/ - name: Install system dependencies run: | diff --git a/README.md b/README.md index 2d7b675..709afca 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Cacti 1.2 plugin that brings server power draw, inlet temperature, fan state, and power supply health from baseboard management controllers (BMCs) into Cacti as ordinary devices, data sources, and graphs, using Redfish with an optional IPMI fallback. Thold and Maint then alert on and suppress them, and a later phase adds rack-level power totals. -> **Status: in development, no release yet (0.1.0-dev).** Milestone 2 (foundation) is merged on `main`; milestone 3 (Cacti objects and alerting) is in review. This plugin is not affiliated with the Cacti project. It installs on Cacti 1.2.31 under PHP 8.2 or later, registers BMCs and credentials, reads power, temperatures, fans, and power supply health from each BMC over Redfish into its own cache, and shows collection health. Milestone 3 adds Cacti devices, per-member and summary graphs, and Thold and Maint support through ordinary data sources. It has been tested only against a fake BMC built from hand-written fixtures and the DMTF Redfish mockup server, never a real BMC. The design and research are in [docs/PLAN.md](docs/PLAN.md), [docs/research/](docs/research/), and [docs/decisions/](docs/decisions/). +> **Status: in development, no release yet (0.1.0-dev).** Milestones 2 (foundation) and 3 (Cacti objects and alerting) are merged on `main`. This plugin is not affiliated with the Cacti project. It installs on Cacti 1.2.31 under PHP 8.2 or later, registers BMCs and credentials, reads power, temperatures, fans, and power supply health from each BMC over Redfish into its own cache, and shows collection health. It adds Cacti devices, per-member and summary graphs, and Thold and Maint support through ordinary data sources. CI has exercised a fake BMC built from hand-written fixtures and the DMTF Redfish mockup server; no real BMC or pilot fleet has been qualified. The design and research are in [docs/PLAN.md](docs/PLAN.md), [docs/research/](docs/research/), and [docs/decisions/](docs/decisions/). ### What milestone 2 ships @@ -83,6 +83,10 @@ flowchart LR BMC credentials control out-of-band management of servers. The design keeps them out of command lines, logs, and pages, verifies TLS by default, runs any external command from an argument array with allowlisted subcommands, and uses read-only BMC accounts. See [docs/PLAN.md](docs/PLAN.md#security) and [SECURITY.md](SECURITY.md). +## Operator guide + +See [docs/operator-guide.md](docs/operator-guide.md) for installation prerequisites, vault and TLS setup, BMC registration, graph creation, alert intervals, backup, and failure handling. The guide does not declare a real vendor firmware line supported until a redacted capture from that firmware passes the suite. + ## How work is tracked - **Milestones** follow the plan's milestones. Each has an epic issue listing its sub-issues and exit evidence. diff --git a/docs/PLAN.md b/docs/PLAN.md index 52f0869..88be8b7 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -1,6 +1,6 @@ # Cacti 1.2 Redfish and IPMI Power and Thermal Plugin Plan -Status: in development, plan revision 2 (2026-11-15). Revision 2 adds the documentation and source research for milestone 1; see [Milestone 1 research](#milestone-1-research). Milestone 2 (foundation) is merged on `main`: the lifecycle and PHP guard, realms and settings, the BMC registry, the encrypted credential store, the read-only Redfish client with its TLS trust modes, discovery and the reading model, the collector, and the health, BMC, and credential pages, tested only against a fake BMC. Decisions are recorded in ADRs 0009 to 0014, and divergences from this plan are stated in place. Milestone 3 (Cacti objects and alerting) is in review: shipped templates, device creation or mapping ([ADR 0015](decisions/0015-attach-to-the-server-device-or-create-one-per-bmc.md)), per-member and summary graphs, Thold and Maint replays against pinned releases, the device permission suite, and a scale harness; its divergences are stated under [Cacti objects](#cacti-objects), [Alerting and maintenance](#alerting-and-maintenance), and [Performance](#performance). Milestone 4 and later are not done, and there is no release. Statements about the Redfish standard, BMC firmware, ipmitool, Cacti core, and Cacti plugins describe upstream behavior as observed on the date and revision named in each source. Anything that was not verified is marked as an assumption and has a research issue; items that need real BMC hardware or a running Cacti are marked *live*. Owner is not assigned; size estimates are in [research/estimates.md](research/estimates.md), and calendar time is not estimated. +Status: in development, plan revision 3 (2026-11-17). Revision 2 adds the documentation and source research for milestone 1; see [Milestone 1 research](#milestone-1-research). Milestone 2 (foundation) is merged on `main`: the lifecycle and PHP guard, realms and settings, the BMC registry, the encrypted credential store, the read-only Redfish client with its TLS trust modes, discovery and the reading model, the collector, and the health, BMC, and credential pages, tested against fake BMCs. Decisions are recorded in ADRs 0009 to 0015, and divergences from this plan are stated in place. Milestone 3 (Cacti objects and alerting) merged on 2026-11-17: shipped templates, device creation or mapping, per-member and summary graphs, Thold and Maint replays against pinned releases, the device permission suite, and a scale harness. The work has been exercised with fixture BMCs and the DMTF mockup server, not real BMC hardware. Its divergences are stated under [Cacti objects](#cacti-objects), [Alerting and maintenance](#alerting-and-maintenance), and [Performance](#performance). Milestone 4 and later are not done, and there is no release. Statements about the Redfish standard, BMC firmware, ipmitool, Cacti core, and Cacti plugins describe upstream behavior as observed on the date and revision named in each source. Anything that was not verified is marked as an assumption and has a research issue; items that need real BMC hardware or a running Cacti are marked *live*. Owner is not assigned; size estimates are in [research/estimates.md](research/estimates.md), and calendar time is not estimated. `plugin_redfish` is a Cacti 1.2 plugin that reads power draw, temperatures, fan state, and power supply health from server baseboard management controllers (BMCs) over Redfish, with IPMI as an optional fallback, and presents them as ordinary Cacti devices, data sources, and graphs. Thold and Maint then work on them unchanged, and a later phase adds rack-level totals. diff --git a/docs/operator-guide.md b/docs/operator-guide.md new file mode 100644 index 0000000..e9feb6a --- /dev/null +++ b/docs/operator-guide.md @@ -0,0 +1,62 @@ +# Redfish operator guide + +This guide covers the development version of plugin_redfish after milestones 2 and 3. There is no tagged release yet. CI tests Cacti 1.2.31 and the current 1.2.x branch on PHP 8.2 through 8.5, including the plugin's install and graph flows. Those jobs use fixture BMCs and the DMTF Redfish mockup server; they do not qualify a real vendor or firmware line. + +## Before installing + +- Use Cacti 1.2.31 or later and PHP 8.2 or later. The plugin deliberately refuses to install or enable on PHP versions below 8.2. +- Run Cacti's poller with network access to the BMC management network. The current collector uses HTTPS to Redfish on TCP 443. It does not use IPMI or UDP 623; IPMI is a later phase. +- Choose an account that can read the resources the plugin collects. Do not use an administrator account. Vendor-specific role names and permissions are not qualified against real BMC firmware yet; verify the account against the resources your BMC exposes. +- Decide how the poller and web server will read the credential key, and how the database and that key will be backed up together. + +## Install and prepare the vault + +Install the plugin under Cacti's `plugins/redfish` directory, then enable it through Cacti's Plugin Management page. The plugin checks its PHP requirement and creates its tables through Cacti's plugin API. After enabling it, open **Configuration → Settings → Redfish** and set the vault key path if you are not using `/etc/cacti/redfish-vault.key`. + +Create a 32-byte random key outside the web root. For a hexadecimal key file: + +```sh +openssl rand -hex 32 +``` + +Write the output to the configured path with permissions that let the web server and poller read it but prevent other users from reading or replacing it. Keep the containing directory writable only by root and the service account that owns the key. The plugin does not create or repair the key file. Back up the key with the Cacti database; a database restore without the matching key cannot decrypt stored passwords. + +Set the collector budget below Cacti's poller interval. The defaults are a 300-second collection interval and a 240-second collector budget. The collector handles unfinished BMCs on a later run. Keep the rediscovery interval, worker count, connection timeout, request timeout, and response-size limit appropriate for the management network; the settings page gives the valid range and default for each. + +## Configure TLS and register a BMC + +Keep certificate verification enabled. Use a CA bundle for a private certificate authority or pin the BMC's SPKI SHA-256 fingerprint. A per-BMC unverified setting disables peer verification for that BMC and leaves a warning on the health page; use it only as a temporary diagnostic exception on an isolated management network. + +Create a credential entry with the read-only account and password. Then add the BMC with its DNS name or management address, HTTPS port, credential, and TLS mode. Import files must refer to credentials by name and must not contain passwords. CSV import is an administrator action; review the rows and target addresses before importing. + +The BMC form and health page show collection state and data age. Investigate authentication, TLS, DNS, timeout, response-size, and stale-data warnings before creating alert thresholds. The current code has not been qualified against real BMC firmware. The vendor matrix in [research/vendor-matrix.md](research/vendor-matrix.md) records what is known and what remains unverified; do not infer firmware support from the mockup CI job. + +## Create a device and graphs + +On the BMC's page, choose **Create Device** to make a separate Cacti device, or **Add Graphs** to attach BMC queries to an existing server device. Review the plan before confirming. The plugin does not probe the BMC through Cacti's device availability checks. The creator needs both Redfish administration access and the Cacti device-management permission. A new device that the creator cannot see is rolled back. + +After provisioning, use Cacti's graph creation flow to add the Redfish summary and member graphs. A BMC member that becomes absent or disappears reads as unknown (`U`); the plugin keeps its graph and RRD history. After a firmware update or component replacement, run **Add Graphs** again to reindex current members. Remove obsolete graphs manually only after their history is no longer needed. + +## Configure alerts + +Redfish summary and per-member values are ordinary Cacti data sources. Create Thold thresholds for the values that matter to the site and use Maint schedules to suppress notifications during planned work. Choose a threshold duration of at least one collector interval so a repeated poll of the same cached reading does not appear to be a new observation. Keep the `age` threshold enabled if you need to detect a BMC that has stopped answering. Verify a threshold's firing and recovery behavior with your own Thold and Maint versions before relying on it operationally. + +## Back up, restore, and handle failures + +Back up the Cacti database, the Cacti configuration, the `rra/` files, and the exact vault key file as one recovery set. Store the key backup separately from the database backup and restrict access to each copy. Test restoration in a non-production Cacti instance before relying on the backup. Restoring only the database or losing the key requires re-entering BMC passwords; restoring the database without its RRD files loses graph history. + +For a restore drill, create an isolated Cacti instance with the same plugin version and restore copies of the database, Cacti configuration, and `rra/` files. Change the copied Cacti configuration to use the restored database host and database name. Before starting Cacti, apply a network rule that denies the test instance access to the production database and confirm that a connection attempt to that production host is blocked. Allow access only to the restored database. + +Install the matching vault key at the configured path and preserve its owner and restrictive permissions. Before contacting any BMC, use a temporary administrator-only PHP check to call the plugin's `CredentialStore::resolve()` for one restored credential. Discard the returned password immediately and record only success or failure; do not print or log the secret. The plugin has no UI action for this credential-only check. Then register a dedicated fixture BMC that the isolated instance can reach, using a fixture-only credential. Keep production BMC addresses disabled and unreachable from the test instance; do not send production credentials to the fixture. Record the credential-check result separately from fixture collection. Confirm that collection completes, the health page reports a current read, and a restored graph still has its history. + +Then repeat with the key unavailable: collection must fail closed, the Cacti pages must remain available, and the health page must report the credential failure. Record the Cacti, PHP, database, and plugin versions and the outcomes; do not put the key or passwords in the report. This is a procedure, not a completed restore drill. + +If the key is missing, unreadable, or invalid, collection fails closed; do not replace it with a new key and expect existing credentials to work. Restore the matching key or re-enter credentials. If a BMC is unavailable, the plugin retains cached readings and marks them stale; stale values become unknown rather than zero. Check the health page, poller logs, DNS, management-network reachability, account access, and certificate trust. Do not disable TLS verification globally to work around a certificate problem. + +Disabling the plugin stops collection. On uninstall, the default is to keep the plugin's tables. The uninstall setting can request table removal; export any needed BMC and credential metadata first. The plugin leaves Cacti devices, graphs, and BMC configuration in place. Removing the plugin does not shut down or reconfigure a BMC. + +## Compatibility and qualification limits + +No real vendor firmware line is currently declared supported. The development suite includes hand-written Dell, HPE, and Lenovo shapes and the DMTF mockup server, but those are test inputs, not real-device qualification. OpenBMC and other vendor families also need redacted captures and fixture runs before support can be stated. See [research/vendor-matrix.md](research/vendor-matrix.md) and issue [#19](https://github.com/somethingwithproof/plugin_redfish/issues/19). + +The plugin is not yet released. Phase 1 pilot reports, real-BMC latency measurements, backup/restore drills, and security qualification remain open. Do not use the current development build as evidence that a particular BMC, firmware, fleet size, or recovery procedure has been qualified.