<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.kitsnet.us/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Psmode</id>
	<title>KitsNet - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kitsnet.us/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Psmode"/>
	<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/wiki/Special:Contributions/Psmode"/>
	<updated>2026-12-05T10:24:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2722</id>
		<title>KitsNet Operations:Monitoring:MegaRAID Physical Drive IO Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2722"/>
		<updated>2026-11-27T17:47:47Z</updated>

		<summary type="html">&lt;p&gt;Psmode: Updates after deployment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Design and implementation guide&#039;&#039;&#039; · Revision 1.3 · 27 November 2026 · Deployed on Wort and Zaya&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Page placement !! Service !! Target systems !! Validation state&lt;br /&gt;
|-&lt;br /&gt;
| Child of [[KitsNet Operations:Monitoring:Zabbix]] || Physical storage monitoring || &amp;lt;code&amp;gt;wort&amp;lt;/code&amp;gt; (Agent 2) and &amp;lt;code&amp;gt;zaya&amp;lt;/code&amp;gt; (Zabbix server and frontend) || Live discovery, history, graphs and dashboard data verified through the Zabbix API.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Production deployment, 27 November 2026 ==&lt;br /&gt;
&lt;br /&gt;
Open [http://zaya.lan.kitsnet.us/zabbix/zabbix.php?action=host.dashboard.view&amp;amp;hostid=10461&amp;amp;dashboardid=90&amp;amp;from=now-15m&amp;amp;to=now the Wort physical-drive dashboard] or choose &#039;&#039;Monitoring → Hosts → KVM Host → Dashboards → MegaRAID physical drives&#039;&#039;. The host&#039;s technical name is &amp;lt;code&amp;gt;wort.lan.kitsnet.us&amp;lt;/code&amp;gt;. The overview contains separate response-time and reporting widgets. The other four pages show operations, throughput, response time and queue depth for each discovered drive.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Commissioning check !! Observed on Wort and Zaya&lt;br /&gt;
|-&lt;br /&gt;
| Template and discovery || Template &amp;lt;code&amp;gt;10603&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;Templates/Monitoring&amp;lt;/code&amp;gt;, host &amp;lt;code&amp;gt;10461&amp;lt;/code&amp;gt;, dashboard &amp;lt;code&amp;gt;90&amp;lt;/code&amp;gt;. The existing nine template links were preserved. Both discovery rules were supported.&lt;br /&gt;
|-&lt;br /&gt;
| Physical inventory || 13 reporting drives, 6 hardware virtual drives, 78 performance series, 13 availability items, 13 metadata items and 52 graphs. Each overview widget selected 13 current items. A browser kiosk fit at 1920 × 1080 remains an operator display check.&lt;br /&gt;
|-&lt;br /&gt;
| Linux inventory || 142 Linux logical volumes indexed at commissioning. The entry for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt; contained four WWN-based physical keys and &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt;. The envelope records the last successful LVM resolution time in &amp;lt;code&amp;gt;lvm_resolved_at&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Sampling || 83 consecutive production poll-duration timestamps spaced five seconds apart. Median 175.1 ms, 95th percentile 198.5 ms and maximum 484.6 ms. Five separately timed probes, each using a fresh Python process and private baseline, averaged 115.5 ms process-tree CPU per poll, approximately 2.31% of one logical CPU at this cadence. These are commissioning measurements. Impact on guest latency during a full backup window and physical database growth have not been measured.&lt;br /&gt;
|-&lt;br /&gt;
| Retention || Seven days of full-resolution numeric history and 365 days of trends. Server-wide history and trend overrides were disabled. The raw master items have zero history.&lt;br /&gt;
|-&lt;br /&gt;
| Controller || DPM was OFF at the start of deployment and is ON for production. The installed firmware and both existing StorCLI versions support this collection design.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The source and exported template are under &amp;lt;code&amp;gt;src/megaraid-monitoring&amp;lt;/code&amp;gt; in KNdkr. For deployment on Wort run &amp;lt;code&amp;gt;sudo bash install-agent.sh&amp;lt;/code&amp;gt; from that directory. It installs the native inventory service, five-minute timer, change-request path, runtime directories and two fixed Agent 2 user parameters. The installer validates the agent configuration and reloads its user parameters. DPM activation remains a separate administrator action. For a second installation, import &amp;lt;code&amp;gt;kitsnet-megaraid-zabbix-7.0.yaml&amp;lt;/code&amp;gt; under &#039;&#039;Data collection → Templates&#039;&#039;, review the import preview and link the template to the intended host. A deployment token is only used for Zabbix configuration.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;sudo -u zabbix /usr/local/libexec/kitsnet-megaraid probe&amp;lt;/code&amp;gt; to collect two five-second samples against an isolated baseline. Use &amp;lt;code&amp;gt;systemctl start kitsnet-megaraid-inventory.service&amp;lt;/code&amp;gt; for an immediate rescan. Stop both &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.path&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.timer&amp;lt;/code&amp;gt; when decommissioning the collector.&lt;br /&gt;
&lt;br /&gt;
Wort&#039;s SNMP subagent and MegaRAID Storage Manager framework now run under native systemd units. The framework loads &amp;lt;code&amp;gt;libjsig.so&amp;lt;/code&amp;gt; from the selected JVM. The native &amp;lt;code&amp;gt;msm_profile.service&amp;lt;/code&amp;gt; validates the vendor environment on demand. It exits after validation. The six invalid-URL messages from &amp;lt;code&amp;gt;kitsnet-vm-startup-complete.target&amp;lt;/code&amp;gt; came from a prose &amp;lt;code&amp;gt;Documentation=&amp;lt;/code&amp;gt; setting. The text is now a comment in the live target and its KNdkr source. A fresh reload produced none of the three SysV warnings or six target warnings.&lt;br /&gt;
&lt;br /&gt;
== Purpose and operator view ==&lt;br /&gt;
&lt;br /&gt;
An operator investigating a slow virtual disk needs to identify the physical disk involved, find its bay and parent virtual drive, and compare it with its peers. The proposed design polls controller 0 every five seconds, discovers its physical disks automatically, creates a graph set for each disk and shows all current disks on one host dashboard. The primary index is the physical drive&#039;s worldwide name (WWN). A replacement in the same bay receives a new history. A drive moved to another bay on the same host retains its history.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; is MegaRAID virtual drive &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt;. One member is WD serial &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt;, WWN &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt;, enclosure 21, slot 14. The parent appears in Linux as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;. Its partition supplies VG &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt; and LV &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. The operator should be able to start with any of these identifiers and find the physical disk. The counters measure work at that disk. Attributing that work to an individual guest or Linux LV requires counters at the corresponding higher layer.&lt;br /&gt;
&lt;br /&gt;
== Verified platform and sampling budget ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Verified on 27 November 2026 !! Implementation consequence&lt;br /&gt;
|-&lt;br /&gt;
| Wort || Broadcom/Avago MegaRAID SAS 9361-8i, controller 0, firmware package &amp;lt;code&amp;gt;24.21.0-0132&amp;lt;/code&amp;gt;. Twelve SATA HDDs and one CacheCade SATA SSD. || Native per-drive counters are available on the installed firmware.&lt;br /&gt;
|-&lt;br /&gt;
| Legacy StorCLI || &amp;lt;code&amp;gt;/usr/local/sbin/storcli64&amp;lt;/code&amp;gt;, version 1.23.02. Its MegaCLI-compatible &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt; interface returned live data. || Pin this absolute path for DPM reads. The Zabbix service account successfully used non-interactive sudo for both reads with &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Inventory StorCLI || &amp;lt;code&amp;gt;/opt/MegaRAID/storcli/storcli64&amp;lt;/code&amp;gt;, version 007.2612. Its JSON reports include physical identities and explicit virtual-drive membership. Its DPM query returned “DPM Feature is not supported” even with the legacy DPM setting ON. || Use this binary for inventory. A generic controller capability flag is insufficient to confirm the DPM query path.&lt;br /&gt;
|-&lt;br /&gt;
| Monitoring || Agent 2 on Wort and server/frontend on Zaya run 7.0.32. Wort&#039;s active endpoint is &amp;lt;code&amp;gt;zabbix.lan.kitsnet.us&amp;lt;/code&amp;gt;. || Target Zabbix 7.0 templates, dependent discovery, graph prototypes and template dashboards.&lt;br /&gt;
|-&lt;br /&gt;
| Test state || DPM was restored to OFF. Disk reports can return retained values in this state. || A valid sample requires both reports to say &amp;lt;code&amp;gt;Performance Monitor: ON&amp;lt;/code&amp;gt;. Keep the existing SMART health checks.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The five-second test read &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; in sequence as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. All 12 polls returned all 13 drives. Each pair took 39–45 ms elapsed and averaged 37 ms of CPU time, equivalent to 0.74% of one core or about 0.05% of the 16-CPU host. The backup volume sustained 111.8 MiB/s, compared with 111.6 MiB/s during 15-second polling. Average read latency was 1.74 and 1.58 ms respectively. The short test establishes feasibility during the observed backup workload. Sustained application tail latency and database retention cost require commissioning measurements.&lt;br /&gt;
&lt;br /&gt;
The proposed collector also checks physical identities on either side of the two reads. Three four-command trials, with DPM OFF and retained reports, took 92–100 ms each including process startup. Budget and benchmark the complete collector with DPM ON during construction. The 37 ms CPU result covers the two live DPM reads only.&lt;br /&gt;
&lt;br /&gt;
== Collection and discovery architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort, five-second path                         Zaya, Zabbix 7.0&lt;br /&gt;
PDList → extended counters → running averages → PDList&lt;br /&gt;
    confirm identity, validate DPM, form intervals&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.dpm ───────→ dependent metric prototypes&lt;br /&gt;
                                                        │&lt;br /&gt;
Wort, five-minute inventory                             ├── per-drive graph prototypes&lt;br /&gt;
    StorCLI physical + virtual JSON, LVM reports        └── template dashboard on Wort&lt;br /&gt;
    validate and atomically publish inventory&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.inventory ─→ server-side LLD JavaScript&lt;br /&gt;
                                                └→ metadata and parent references&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only the two master items request data from Agent 2. Each DPM report covers all drives. The server or its assigned proxy runs low-level discovery (LLD), extracts values and instantiates prototypes. The slow inventory worker runs independently so an inventory scan cannot hold the five-second check open. One template link to the existing Wort host is sufficient.&lt;br /&gt;
&lt;br /&gt;
=== Controller commands and privilege boundary ===&lt;br /&gt;
&lt;br /&gt;
As an operator on Wort, enable DPM once at commissioning and verify the readback. Record the previous setting first. Monitoring reads have no reason to call the setter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 set dpm=on&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The steady five-second path uses these calls in order. &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt; suppresses the per-invocation CLI logfile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ext -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ra  -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inventory worker uses the following fixed read commands. Check the embedded &amp;lt;code&amp;gt;Command Status.Status&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Success&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Controller&amp;lt;/code&amp;gt; for 0 before using &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt;. Check the legacy reports for &amp;lt;code&amp;gt;Exit Code: 0x00&amp;lt;/code&amp;gt; as well as the process exit status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/eall/sall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/vall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0 show eventloginfo J&lt;br /&gt;
lsblk --json --paths --output NAME,KNAME,PKNAME,TYPE,MAJ:MIN,WWN&lt;br /&gt;
sudo -n /usr/sbin/pvs --segments --reportformat json -o pv_name,vg_name,lv_name,lv_uuid&lt;br /&gt;
sudo -n /usr/sbin/lvs -a --segments --reportformat json -o vg_name,lv_name,lv_uuid,lv_path,segtype,devices&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use fixed argument lists, a fixed locale, an execution deadline and root-owned executable paths. An inventory systemd service may run these read commands as root and publish a group-readable file for Agent 2. For the fast path, permit only the exact read commands needed by &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; if additional access is required. Revalidate under the running service&#039;s SELinux context during commissioning.&lt;br /&gt;
&lt;br /&gt;
== Drive identity and volume attribution ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Rule !! Use in Zabbix&lt;br /&gt;
|-&lt;br /&gt;
| Physical key || Normalize a valid 16-hex-digit ATA WWN to lowercase and prefix &amp;lt;code&amp;gt;w_&amp;lt;/code&amp;gt;. If a disk genuinely lacks a WWN, use &amp;lt;code&amp;gt;s_&amp;lt;/code&amp;gt; plus the SHA-256 digest of the trimmed model, a NUL byte and the trimmed serial. Reject placeholder or duplicate identities. || Immutable item-key argument on this host. Full WWN, serial and model remain searchable.&lt;br /&gt;
|-&lt;br /&gt;
| Controller address || Preserve controller number, enclosure, slot and DID as separate values. Join both DPM reports to a confirmed physical identity using all available address fields. || Bay, DID and parent names are labels. A moved disk can acquire new labels while keeping its item key.&lt;br /&gt;
|-&lt;br /&gt;
| Direct RAID parents || For every &amp;lt;code&amp;gt;/c0/vN&amp;lt;/code&amp;gt;, join its &amp;lt;code&amp;gt;PDs for VD N&amp;lt;/code&amp;gt; list to the physical inventory by enclosure:slot and DID. Check DG against the DG/VD record. Preserve every match and the OS drive name when present. || Display &amp;lt;code&amp;gt;c0/vN Name&amp;lt;/code&amp;gt;. A parent-ID tag uses delimited tokens, e.g. &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt;, for exact membership searches using “contains”.&lt;br /&gt;
|-&lt;br /&gt;
| CacheCade || The SSD is a direct member of &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. Cached VDs are consumers of that cache. || Show the cache VD as its parent. A consumer list, if displayed, is a separate relationship.&lt;br /&gt;
|-&lt;br /&gt;
| Spare, unconfigured or unreported disk || Keep each identifiable, inventory-visible disk in discovery. Allow an empty parent array for a spare/unassigned disk. Record the controller state and whether DPM reports a row. || Display the role and a data-availability status. A missing row is unknown. A reported zero is a valid value.&lt;br /&gt;
|-&lt;br /&gt;
| Linux LVM || Join each parent VD&#039;s OS disk to its partition/PV by Linux device identity. Collect the set of distinct LV UUIDs with extents on those PVs. || Keep the full PV/VG/LV list in a text item for the physical disk. Avoid truncating a large VG into a tag or graph title.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For LVM, resolve device aliases by major:minor, identify partition parents from &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and group &amp;lt;code&amp;gt;pvs&amp;lt;/code&amp;gt; rows by PV. Ignore free segments with empty LV names. For stacked LVs, resolve &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; segment dependencies recursively through component LVs to PVs, with a visited set. Retain direct and dependent roles in the metadata. Present an incomplete map as such if an unfamiliar segment type cannot be resolved. A Linux LV that spans RAID volumes can appear under multiple parents. Some parent VDs have no Linux LV. Linux names such as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; are current observations and can change on boot.&lt;br /&gt;
&lt;br /&gt;
=== Acceptance inventory from Wort ===&lt;br /&gt;
&lt;br /&gt;
The build must discover these records from the controller. This table is a point-in-time comparison for the first import. It must never become a configured list of devices.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Bay !! DID !! Physical WWN !! Serial !! Direct RAID parent !! Linux disk / VG&lt;br /&gt;
|-&lt;br /&gt;
| 21:13 || 17 || &amp;lt;code&amp;gt;5000c500ebb8561f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZDP9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:14 || 14 || &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:15 || 16 || &amp;lt;code&amp;gt;5001b448bc70bc7f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;214101A000F1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt; || Controller cache&lt;br /&gt;
|-&lt;br /&gt;
| 21:16 || 12 || &amp;lt;code&amp;gt;5000cca095c3d53a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8ED1R&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:17 || 20 || &amp;lt;code&amp;gt;5000c500e82d443a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0QHAB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:18 || 18 || &amp;lt;code&amp;gt;50014ee2bab34493&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K1JJ1DYX&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:19 || 15 || &amp;lt;code&amp;gt;50014ee216fddd9f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WX32D95FVCAC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:21 || 19 || &amp;lt;code&amp;gt;50014ee2100846f2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K3SJT2L8&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:22 || 27 || &amp;lt;code&amp;gt;5000cca095dbba95&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYZZKF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:16 || 25 || &amp;lt;code&amp;gt;5000cca095c3d2b9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8DRBR&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:17 || 24 || &amp;lt;code&amp;gt;5000c500ebb8d227&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZSRK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:18 || 23 || &amp;lt;code&amp;gt;5000c500e82d43dc&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0PZBD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:19 || 26 || &amp;lt;code&amp;gt;5000cca095dba2c3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYTMVF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Agent-side implementation specification ==&lt;br /&gt;
&lt;br /&gt;
=== Inventory and replacement handling ===&lt;br /&gt;
&lt;br /&gt;
# Run a boot-triggered and then five-minute inventory timer. Read the controller event-log sequence before and after both StorCLI inventory calls. When the sequence changes mid-scan, retry from the beginning with a bounded retry count. The verified JSON field is &amp;lt;code&amp;gt;Newest Sequence Number&amp;lt;/code&amp;gt;. Also record the reboot sequence.&lt;br /&gt;
# Require a complete, internally consistent PD/VD inventory. Compare the physical summary keys with detailed records, validate unique identities and locations, and verify the member references. Publish by atomic rename on the same filesystem to &amp;lt;code&amp;gt;/run/kitsnet-megaraid/inventory.json&amp;lt;/code&amp;gt;. Preserve the last good map on an error and expose the error and inventory age separately.&lt;br /&gt;
# On a five-second sample, read &amp;lt;code&amp;gt;-PDList&amp;lt;/code&amp;gt; before and after &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt;. Parse enclosure, slot, DID, WWN and drive sequence number. Compare the two observations and the cached identity. Quarantine changed, unknown or conflicting locations for that interval. Coalesce an inventory refresh request on an unknown or changed address. The periodic timer provides an independent retry.&lt;br /&gt;
# For a WWN-less drive, qualify a serial/model fallback using matching identity reads on both sides of the DPM sample (for SATA members, &amp;lt;code&amp;gt;smartctl -j -i -d megaraid,DID /dev/bus/0&amp;lt;/code&amp;gt;). Cache the durable identity at discovery. A transiently missing WWN on a previously identified disk is an identity conflict. Suppress that disk&#039;s sample until it is resolved. The fallback&#039;s extra cost belongs in commissioning.&lt;br /&gt;
# Invalidate counter baselines on controller or agent restarts, changes to the physical identity map, and DPM disable/enable events. Never give a newly arrived drive the previous occupant&#039;s last reading. Reconfiguration of logical drives can change parent labels by the next successful inventory refresh.&lt;br /&gt;
&lt;br /&gt;
=== Reference inventory normalizer ===&lt;br /&gt;
&lt;br /&gt;
The following Python 3.9 function is the RAID part of the inventory producer. Pass it the checked &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;/c0/eall/sall&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/c0/vall&amp;lt;/code&amp;gt;. It ran against Wort&#039;s reports and returned all 13 physical identities. The service wrapper adds capture time, LVM references, identity guard metadata and error reporting before publishing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import hashlib&lt;br /&gt;
import re&lt;br /&gt;
&lt;br /&gt;
def disk_key(wwn, model, serial):&lt;br /&gt;
    wwn = wwn.lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
    if re.fullmatch(r&amp;quot;[0-9a-f]{16}&amp;quot;, wwn) and wwn not in {&amp;quot;0&amp;quot; * 16, &amp;quot;f&amp;quot; * 16}:&lt;br /&gt;
        return &amp;quot;w_&amp;quot; + wwn&lt;br /&gt;
    if not model or not serial or serial.upper() in {&amp;quot;N/A&amp;quot;, &amp;quot;UNKNOWN&amp;quot;, &amp;quot;NONE&amp;quot;, &amp;quot;-&amp;quot;}:&lt;br /&gt;
        raise ValueError(&amp;quot;missing durable disk identity&amp;quot;)&lt;br /&gt;
    digest = hashlib.sha256((model + &amp;quot;\0&amp;quot; + serial).encode(&amp;quot;utf-8&amp;quot;)).hexdigest()&lt;br /&gt;
    return &amp;quot;s_&amp;quot; + digest&lt;br /&gt;
&lt;br /&gt;
def inventory(pd_report, vd_report, controller=&amp;quot;c0&amp;quot;):&lt;br /&gt;
    # Arguments are the checked Response Data objects for one controller.&lt;br /&gt;
    drives, by_location = {}, {}&lt;br /&gt;
    bays, dids, seen_paths = set(), set(), set()&lt;br /&gt;
    expected_paths = {k for k in pd_report if re.fullmatch(r&amp;quot;Drive /c\d+/e\d+/s\d+&amp;quot;, k)}&lt;br /&gt;
    for label, detail in pd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;Drive (/c\d+/e(\d+)/s(\d+)) - Detailed Information&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        path, eid, slot = match.groups()&lt;br /&gt;
        row = pd_report[&amp;quot;Drive &amp;quot; + path][0]&lt;br /&gt;
        attrs = detail[&amp;quot;Drive &amp;quot; + path + &amp;quot; Device attributes&amp;quot;]&lt;br /&gt;
        bay = eid + &amp;quot;:&amp;quot; + slot&lt;br /&gt;
        if path.split(&amp;quot;/&amp;quot;)[1] != controller or row[&amp;quot;EID:Slt&amp;quot;] != bay:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent controller or bay&amp;quot;)&lt;br /&gt;
        did = str(row[&amp;quot;DID&amp;quot;])&lt;br /&gt;
        model = attrs[&amp;quot;Model Number&amp;quot;].strip()&lt;br /&gt;
        serial = attrs[&amp;quot;SN&amp;quot;].strip()&lt;br /&gt;
        wwn = str(attrs.get(&amp;quot;WWN&amp;quot;, &amp;quot;&amp;quot;)).strip().lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
        key = disk_key(wwn, model, serial)&lt;br /&gt;
        loc = (bay, did)&lt;br /&gt;
        if key in drives or bay in bays or did in dids:&lt;br /&gt;
            raise ValueError(&amp;quot;duplicate disk identity or address&amp;quot;)&lt;br /&gt;
        bays.add(bay)&lt;br /&gt;
        dids.add(did)&lt;br /&gt;
        seen_paths.add(&amp;quot;Drive &amp;quot; + path)&lt;br /&gt;
        size = re.fullmatch(r&amp;quot;(\d+)\s*B&amp;quot;, attrs[&amp;quot;Logical Sector Size&amp;quot;].strip())&lt;br /&gt;
        if not size or int(size[1]) &amp;lt; 1:&lt;br /&gt;
            raise ValueError(&amp;quot;unknown logical sector size&amp;quot;)&lt;br /&gt;
        drives[key] = dict(id=key, wwn=wwn if key.startswith(&amp;quot;w_&amp;quot;) else &amp;quot;&amp;quot;,&lt;br /&gt;
                           serial=serial, model=model, controller=controller,&lt;br /&gt;
                           bay=bay, did=did, sector_bytes=int(size[1]),&lt;br /&gt;
                           dg=str(row[&amp;quot;DG&amp;quot;]), state=row[&amp;quot;State&amp;quot;], media=row[&amp;quot;Med&amp;quot;],&lt;br /&gt;
                           parents=[])&lt;br /&gt;
        by_location[loc] = key&lt;br /&gt;
&lt;br /&gt;
    for label, rows in vd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;/&amp;quot; + re.escape(controller) + r&amp;quot;/v(\d+)&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        vd = match[1]&lt;br /&gt;
        row = rows[0]&lt;br /&gt;
        dg, reported_vd = row[&amp;quot;DG/VD&amp;quot;].split(&amp;quot;/&amp;quot;)&lt;br /&gt;
        if vd != reported_vd:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent virtual drive identity&amp;quot;)&lt;br /&gt;
        parent = dict(id=controller + &amp;quot;/v&amp;quot; + vd, name=row[&amp;quot;Name&amp;quot;] or &amp;quot;VD&amp;quot; + vd,&lt;br /&gt;
                      raid=row[&amp;quot;TYPE&amp;quot;], os=vd_report[&amp;quot;VD&amp;quot; + vd + &amp;quot; Properties&amp;quot;]&lt;br /&gt;
                      .get(&amp;quot;OS Drive Name&amp;quot;, &amp;quot;N/A&amp;quot;))&lt;br /&gt;
        for member in vd_report[&amp;quot;PDs for VD &amp;quot; + vd]:&lt;br /&gt;
            loc = (member[&amp;quot;EID:Slt&amp;quot;], str(member[&amp;quot;DID&amp;quot;]))&lt;br /&gt;
            drive = drives[by_location[loc]]&lt;br /&gt;
            if drive[&amp;quot;dg&amp;quot;] != dg:&lt;br /&gt;
                raise ValueError(&amp;quot;membership changed during inventory&amp;quot;)&lt;br /&gt;
            if parent[&amp;quot;id&amp;quot;] not in [p[&amp;quot;id&amp;quot;] for p in drive[&amp;quot;parents&amp;quot;]]:&lt;br /&gt;
                drive[&amp;quot;parents&amp;quot;].append(parent)&lt;br /&gt;
&lt;br /&gt;
    for drive in drives.values():&lt;br /&gt;
        drive[&amp;quot;parents&amp;quot;].sort(key=lambda p: int(p[&amp;quot;id&amp;quot;].split(&amp;quot;/v&amp;quot;)[1]))&lt;br /&gt;
        if drive[&amp;quot;state&amp;quot;] == &amp;quot;Onln&amp;quot; and drive[&amp;quot;dg&amp;quot;].isdigit() and not drive[&amp;quot;parents&amp;quot;]:&lt;br /&gt;
            raise ValueError(&amp;quot;online member has no virtual-drive mapping&amp;quot;)&lt;br /&gt;
    if not drives or seen_paths != expected_paths:&lt;br /&gt;
        raise ValueError(&amp;quot;empty or incomplete controller inventory&amp;quot;)&lt;br /&gt;
    return dict(schema=1, complete=True, drives=drives)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Five-second sample and rate calculation ===&lt;br /&gt;
&lt;br /&gt;
Parse &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; by enclosure/slot/DID section. Its seven numeric columns, in order, are sectors read, sectors written, sectors written with Force Unit Access (FUA), read commands, write commands, write-FUA commands and flush commands. Parse each &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; row as enclosure, slot, DID, aggregate IOPS, queue depth, transfer rate (MB/s) and response time (ms). Validate field counts, numeric ranges and unique addresses in each report. The two reports are successive controller snapshots; their values can represent different averaging intervals.&lt;br /&gt;
&lt;br /&gt;
For each disk, keep the last accepted extended counters, current physical key, sequence, sector size and an acquisition timestamp from the host monotonic clock. Publish the counter baseline atomically, once per successful sample, under a nonblocking single-writer lock. Allow less than five seconds for all fast-path commands combined. On overlap, report a collection failure and preserve the baseline. Keep probes run manually for tests from modifying the production baseline.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
elapsed_seconds = current.monotonic_time - previous.monotonic_time&lt;br /&gt;
read_iops       = change(read_commands) / elapsed_seconds&lt;br /&gt;
write_iops      = change(write_commands) / elapsed_seconds&lt;br /&gt;
read_Bps        = change(read_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
write_Bps       = change(write_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
response_ms     = running_average.response_time_ms&lt;br /&gt;
queue_depth     = running_average.queue_depth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the logical sector size of the physical member. The 13 verified members report 512 bytes. Preserve the separate FUA and flush counters in the master record. Label the two write rates as the native &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt; column. Validate the firmware&#039;s treatment of FUA before adding it to a combined write total. Read/write IOPS and bytes/s are interval rates. Response time and queue depth are firmware running averages. Wort reports up to 100 commands for this average, so a lightly used disk can represent a different time window.&lt;br /&gt;
&lt;br /&gt;
An initial sample establishes a baseline. After a reboot, DPM transition, ambiguous identity, counter decrease/wrap, collector state loss, or interval longer than twice the configured poll period, clear the affected baseline and wait for two contiguous samples. Publish a gap for affected rates. On a failed command, DPM OFF, stale inventory beyond 15 minutes, or a missing disk row, record availability explicitly and omit invalid numbers. A genuine idle drive with unchanged, valid counters has zero rates. Retained data read while DPM is OFF is stale even when the CLI exits successfully.&lt;br /&gt;
&lt;br /&gt;
=== JSON contracts and Agent 2 keys ===&lt;br /&gt;
&lt;br /&gt;
The inventory envelope contains &amp;lt;code&amp;gt;schema&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;complete&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;collected_at&amp;lt;/code&amp;gt; (Unix seconds), &amp;lt;code&amp;gt;drives&amp;lt;/code&amp;gt; keyed by physical identity, and a separate LVM coverage status. Each drive adds an &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array with PV, VG, LV name, LV UUID and relation. An empty array with complete coverage means “no mapped LV”. The inventory reader indicates failure if the cache is stale or corrupt. The LLD rule below consumes only a complete RAID inventory. Failure to resolve LVM updates the LVM status independently.&lt;br /&gt;
&lt;br /&gt;
The example below shows one drive in a five-second master payload. The numbers illustrate the field types. In production &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt; counts eligible DPM members and &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt; counts validated members. Missing drives appear in &amp;lt;code&amp;gt;status_by_id&amp;lt;/code&amp;gt; even when their metric record is absent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;schema&amp;quot;: 1, &amp;quot;sampled_at&amp;quot;: 1795796160, &amp;quot;ok&amp;quot;: 1, &amp;quot;dpm_on&amp;quot;: 1,&lt;br /&gt;
  &amp;quot;expected&amp;quot;: 13, &amp;quot;reported&amp;quot;: 13, &amp;quot;poll_ms&amp;quot;: 96, &amp;quot;inventory_age_s&amp;quot;: 42,&lt;br /&gt;
  &amp;quot;status_by_id&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: 1},&lt;br /&gt;
  &amp;quot;drives&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: {&lt;br /&gt;
    &amp;quot;read_iops&amp;quot;: 62.2, &amp;quot;write_iops&amp;quot;: 0, &amp;quot;read_Bps&amp;quot;: 29320192,&lt;br /&gt;
    &amp;quot;write_Bps&amp;quot;: 0, &amp;quot;response_ms&amp;quot;: 1.613, &amp;quot;queue_depth&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_sectors&amp;quot;: 1336328, &amp;quot;write_sectors&amp;quot;: 0, &amp;quot;write_fua_sectors&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_ops&amp;quot;: 1399, &amp;quot;write_ops&amp;quot;: 0, &amp;quot;write_fua_ops&amp;quot;: 0, &amp;quot;flush_ops&amp;quot;: 0&lt;br /&gt;
  }}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use two fixed Agent 2 user parameters. The proposed helper runs as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. Its inventory mode reads the atomically published file, verifies freshness and outputs the envelope. Its sample mode performs the guarded DPM read. On DPM OFF return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on=0&amp;lt;/code&amp;gt; and no numeric disk data. When the DPM state itself cannot be read, omit &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt; and a short diagnostic. For known eligible disks, return availability 0 on a global failure. Emit only JSON on standard output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
UserParameter=kitsnet.megaraid.inventory,/usr/local/libexec/kitsnet-megaraid inventory&lt;br /&gt;
UserParameter=kitsnet.megaraid.dpm,/usr/local/libexec/kitsnet-megaraid sample&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zabbix server implementation ==&lt;br /&gt;
&lt;br /&gt;
Create template &amp;lt;code&amp;gt;KitsNet MegaRAID physical drives by agent 2&amp;lt;/code&amp;gt; in the same local template group as the existing KitsNet monitoring templates. Link it to the existing Wort host. Verify the Agent 2 active hostname matches that host&#039;s technical name. Keep all IDs, enclosure addresses and logical volume names out of template constants.&lt;br /&gt;
&lt;br /&gt;
=== Master items, discovery and life cycle ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Object !! Type / key !! Interval or master !! Information type and settings&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive inventory || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.inventory&amp;lt;/code&amp;gt; || 1m, cached inventory refreshed every 5m || Text. Master history 0; the discovery rule, LVM items and inventory health use the incoming value.&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive DPM sample || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.dpm&amp;lt;/code&amp;gt; || 5s || Text. Master history 0. The collector deadline must fit the agent/server item timeout. Expose a separate diagnostic text item if the master fails.&lt;br /&gt;
|-&lt;br /&gt;
| Discover MegaRAID physical drives || Dependent discovery rule / &amp;lt;code&amp;gt;kitsnet.megaraid.pd.discovery&amp;lt;/code&amp;gt; || Inventory master || JavaScript below, then &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Disable lost resources after 1h, delete after 30d, subject to KitsNet retention policy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A drive added just after an inventory scan should normally appear within about six minutes (five-minute scan plus one-minute master polling), plus server scheduling and agent active-check refresh where applicable. The new rates start on the next two valid samples. An inventory failure must fail discovery preprocessing; returning an empty successful list would mark every existing disk lost. Keep daily housekeeping and history-retention policies in mind when retiring disks.&lt;br /&gt;
&lt;br /&gt;
=== Server-side discovery code ===&lt;br /&gt;
&lt;br /&gt;
Paste this into the JavaScript preprocessing step of the dependent LLD rule. It runs in the Zabbix server or proxy preprocessing engine and returns a root array of native LLD macro objects. Sorting by physical key gives stable results for the heartbeat step. The code handles multiple RAID parents and unassigned members.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var root = JSON.parse(value);&lt;br /&gt;
if (root.schema !== 1 || root.complete !== true ||&lt;br /&gt;
        !root.drives || typeof root.drives !== &#039;object&#039; || Array.isArray(root.drives)) {&lt;br /&gt;
    throw &#039;Incomplete physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var ids = Object.keys(root.drives).sort();&lt;br /&gt;
if (!ids.length) {&lt;br /&gt;
    throw &#039;Empty physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var rows = [];&lt;br /&gt;
for (var i = 0; i &amp;lt; ids.length; i++) {&lt;br /&gt;
    var key = ids[i];&lt;br /&gt;
    var d = root.drives[key];&lt;br /&gt;
    if (!/^(w_[a-f0-9]{16}|s_[a-f0-9]{64})$/.test(key) ||&lt;br /&gt;
            d.id !== key || !d.controller || !d.bay || !Array.isArray(d.parents)) {&lt;br /&gt;
        throw &#039;Invalid physical-drive identity or mapping&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    var labels = [];&lt;br /&gt;
    var refs = [];&lt;br /&gt;
    for (var j = 0; j &amp;lt; d.parents.length; j++) {&lt;br /&gt;
        var parent = d.parents[j];&lt;br /&gt;
        if (!parent.id || !parent.name) {&lt;br /&gt;
            throw &#039;Incomplete virtual-drive reference&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        labels.push(parent.id + &#039; &#039; + parent.name);&lt;br /&gt;
        refs.push(parent.id);&lt;br /&gt;
    }&lt;br /&gt;
    rows.push({&lt;br /&gt;
        &#039;{#PDKEY}&#039;: key, &#039;{#WWN}&#039;: d.wwn, &#039;{#SERIAL}&#039;: d.serial,&lt;br /&gt;
        &#039;{#DISPLAY}&#039;: d.serial || d.wwn, &#039;{#MODEL}&#039;: d.model,&lt;br /&gt;
        &#039;{#CTRL}&#039;: d.controller, &#039;{#BAY}&#039;: d.bay, &#039;{#DID}&#039;: String(d.did),&lt;br /&gt;
        &#039;{#MEDIA}&#039;: d.media, &#039;{#DG}&#039;: d.dg,&lt;br /&gt;
        &#039;{#PARENTS}&#039;: labels.length ? labels.join(&#039;, &#039;) : &#039;Unassigned (&#039; + d.state + &#039;)&#039;,&lt;br /&gt;
        &#039;{#PARENTIDS}&#039;: refs.length ? &#039;|&#039; + refs.join(&#039;|&#039;) + &#039;|&#039; : &#039;|&#039;&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(rows);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Item prototypes and tags ===&lt;br /&gt;
&lt;br /&gt;
Create the following item prototypes under the discovery rule. All are &#039;&#039;Dependent item&#039;&#039;. Use key prefix &amp;lt;code&amp;gt;kitsnet.megaraid.pd.&amp;lt;/code&amp;gt; and append &amp;lt;code&amp;gt;[{#PDKEY}]&amp;lt;/code&amp;gt;. For example, the full read-IOPS key is &amp;lt;code&amp;gt;kitsnet.megaraid.pd.read_iops[{#PDKEY}]&amp;lt;/code&amp;gt;. A key&#039;s stable argument is the physical identity. Names and tags can change as discovery observes new locations and parent names.&lt;br /&gt;
&lt;br /&gt;
For a fast numeric item the extraction path is &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;].FIELD&amp;lt;/code&amp;gt;. Replace &amp;lt;code&amp;gt;FIELD&amp;lt;/code&amp;gt; with the field in the table. Set JSONPath &#039;&#039;Custom on fail → Discard value&#039;&#039; for missing metrics. Rate calculation already took place against the collector&#039;s monotonic clock. Applying &#039;&#039;Change per second&#039;&#039; again would differentiate a rate a second time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key suffix / field !! Source master and preprocessing !! Value type / unit !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ops/s&amp;lt;/code&amp;gt; || Two distinct items for read and write command rates.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;Bps&amp;lt;/code&amp;gt; || Two distinct items for read and write bytes per second.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; || Controller running-average response time.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), no unit || Controller running-average queue depth.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt; || DPM / &amp;lt;code&amp;gt;$.status_by_id[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Numeric (unsigned), value map 1 Reporting / 0 Unavailable || Keep missing, disabled or stale data distinct from an idle disk. Use discard unchanged with a 1m heartbeat after extracting the status.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;metadata&amp;lt;/code&amp;gt; || Inventory / &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Text, discard unchanged with a 1d heartbeat || Full identity, bay, model, serial, sector size, direct RAID parents, Linux mappings and their coverage.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Name a read-IOPS item &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Read IOPS&amp;lt;/code&amp;gt;. Use the corresponding metric label for the other prototypes. Apply the tags &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pd={#PDKEY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;serial={#SERIAL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wwn={#WWN}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;controller={#CTRL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bay={#BAY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parent_vd={#PARENTIDS}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;media={#MEDIA}&amp;lt;/code&amp;gt; and a fixed &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag for each type. Use &amp;lt;code&amp;gt;metric=response_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;metric=available&amp;lt;/code&amp;gt; exactly as specified for the dashboard. Search &amp;lt;code&amp;gt;parent_vd&amp;lt;/code&amp;gt; with &#039;&#039;Contains&#039;&#039; and the token &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt; to get all four backup members. For an unusually large parent list, keep the complete references in metadata and constrain the summary label/tag to Zabbix field limits.&lt;br /&gt;
&lt;br /&gt;
Create controller-level dependent items on the DPM master for &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;poll_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;inventory_age_s&amp;lt;/code&amp;gt;. Give these keys the prefix &amp;lt;code&amp;gt;kitsnet.megaraid.collector.&amp;lt;/code&amp;gt; and use &amp;lt;code&amp;gt;$.FIELD&amp;lt;/code&amp;gt;. Use numeric (unsigned) for status and counts, numeric (float) for durations; units &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; as applicable. Add a diagnostic string and slow inventory/LVM coverage health. A per-disk &amp;lt;code&amp;gt;available=0&amp;lt;/code&amp;gt; on a known spare can be expected; flag missing reports for eligible online members.&lt;br /&gt;
&lt;br /&gt;
Configure a controller collection problem on 30 seconds without a fresh &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt; item or persistent &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;. For example, use &amp;lt;code&amp;gt;nodata(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=1 or max(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=0&amp;lt;/code&amp;gt;. Alert on stale inventory over 15 minutes and on sustained eligible member count mismatch. Give per-drive availability triggers a dependency on the controller collection problem to avoid 13 duplicate events. Keep latency warning thresholds unset until normal ranges have been observed for the HDD and SSD workloads.&lt;br /&gt;
&lt;br /&gt;
=== Reverse lookup from a Linux logical volume ===&lt;br /&gt;
&lt;br /&gt;
Publish an &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; object in the slow inventory envelope. Build it from each drive&#039;s resolved &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array. Use the LV UUID as the dictionary key and store &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt;, sorted unique physical keys, direct VD IDs and a last-resolved timestamp. For example, the index entry for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt; should contain &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt; and all four &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; member WWNs. Resolve multiply mapped or stacked LVs before deduplicating. This permits a lookup by LV name in Latest data without tagging hundreds of physical metrics with that name.&lt;br /&gt;
&lt;br /&gt;
Add a second dependent discovery rule, &amp;lt;code&amp;gt;kitsnet.megaraid.lv.discovery&amp;lt;/code&amp;gt;, using the same inventory master. Apply the following JavaScript and &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Publish &amp;lt;code&amp;gt;lvm_complete=true&amp;lt;/code&amp;gt; only after the LVM map validates. An unavailable LVM scan should preserve the last known associations while physical-drive discovery continues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var inv = JSON.parse(value);&lt;br /&gt;
if (inv.schema !== 1 || inv.complete !== true || inv.lvm_complete !== true ||&lt;br /&gt;
        !inv.lvs || typeof inv.lvs !== &#039;object&#039; || Array.isArray(inv.lvs)) {&lt;br /&gt;
    throw &#039;Incomplete Linux LV index&#039;;&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(Object.keys(inv.lvs).sort().map(function (uuid) {&lt;br /&gt;
    var lv = inv.lvs[uuid];&lt;br /&gt;
    if (!/^[A-Za-z0-9-]+$/.test(uuid) || lv.uuid !== uuid || !lv.vg || !lv.name) {&lt;br /&gt;
        throw &#039;Invalid Linux LV identity&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    return {&#039;{#LVUUID}&#039;: uuid, &#039;{#VG}&#039;: lv.vg, &#039;{#LVNAME}&#039;: lv.name};&lt;br /&gt;
}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under this rule, create the dependent text item prototype &amp;lt;code&amp;gt;kitsnet.megaraid.lv.members[{#LVUUID}]&amp;lt;/code&amp;gt;, named &amp;lt;code&amp;gt;LV {#VG}/{#LVNAME} / physical drives&amp;lt;/code&amp;gt;. Its master is the inventory item. Use JSONPath &amp;lt;code&amp;gt;$.lvs[&#039;{#LVUUID}&#039;]&amp;lt;/code&amp;gt;, retain on change with a daily heartbeat, and tag the item with &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lv&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lv_uuid&amp;lt;/code&amp;gt;. The reverse index adds zero controller queries.&lt;br /&gt;
&lt;br /&gt;
=== History and sampling cost ===&lt;br /&gt;
&lt;br /&gt;
At 13 drives, six performance metrics produce 78 numeric items, 15.6 new performance values/s and 1,347,840 values/day. Status, metadata and collector health are additional. Proposed starting retention is 7d of numeric history and 365d of hourly trends, subject to the Zaya database policy. Seven days is about 9.4 million performance samples before database compression or housekeeping. Preserve full resolution only where it serves diagnosis. Use 0 history on both raw master items and omit trends for text. Confirm global housekeeping overrides and database growth on Zaya before expanding retention.&lt;br /&gt;
&lt;br /&gt;
== Per-drive graphs and single-screen dashboard ==&lt;br /&gt;
&lt;br /&gt;
Set each graph-prototype widget to 12 dashboard grid units high. Zabbix divides this evenly among the four rows, giving the thirteenth drive the same chart height as the first twelve. At 11 units the fourth row receives only two units and can acquire an internal scrollbar.&lt;br /&gt;
&lt;br /&gt;
The two Honeycomb widgets format the discovered item name into four lines for the bay, serial or WWN, parent virtual drive and metric. Each line gets its own space in the tile. The measurement appears below them. Both overview widgets use the same formatting, including for newly discovered drives. At the operator&#039;s Chrome window size, all 26 tiles displayed their full labels before hovering.&lt;br /&gt;
&lt;br /&gt;
Each graph-prototype widget requires its own string field named &amp;lt;code&amp;gt;reference&amp;lt;/code&amp;gt;. The deployed widgets use &amp;lt;code&amp;gt;PDOPS&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PDBPS&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PDLAT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PDQUE&amp;lt;/code&amp;gt;. Zabbix uses each reference to pass the dashboard time range to that widget&#039;s 13 child graphs. If the reference is missing, the drive titles appear but the graphs report missing &amp;lt;code&amp;gt;from&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;to&amp;lt;/code&amp;gt; parameters. Verify the repair by opening all four graph pages with &#039;&#039;Last 1 hour&#039;&#039; selected.&lt;br /&gt;
&lt;br /&gt;
Create graph prototypes inside the same discovery rule as the item prototypes. Use one graph per unit so latency remains legible during a high-throughput read. Include &amp;lt;code&amp;gt;{#BAY} {#DISPLAY} / {#PARENTS}&amp;lt;/code&amp;gt; in each graph name. Include &amp;lt;code&amp;gt;{#PDKEY}&amp;lt;/code&amp;gt; in the detailed graph name or description wherever the frontend supports it; the constituent item keys always carry it. Use a zero minimum and an automatic maximum. Read lines use blue (&amp;lt;code&amp;gt;2563EB&amp;lt;/code&amp;gt;) and write lines use orange (&amp;lt;code&amp;gt;D97706&amp;lt;/code&amp;gt;) throughout.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Graph prototype !! Item prototypes on left Y axis !! What to compare&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Operations&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || Read/write workload across mirrors or parity members.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Throughput&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || Transfer rate at the physical disk.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Response time&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || Drill into the drive whose response time increased.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Queue depth&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || Check for outstanding work at the same time.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Create the template dashboard &amp;lt;code&amp;gt;MegaRAID physical drives&amp;lt;/code&amp;gt;. Link the template to Wort once. Open the inherited dashboard from &#039;&#039;Monitoring → Hosts → Wort → Dashboards&#039;&#039;. Use the dashboard time picker (default last 15 minutes). Select the graph prototype object when configuring each graph widget. Selecting an individual discovered graph would pin the dashboard to a single physical disk.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dashboard page !! Native widgets and configuration !! Acceptance on Wort&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;All physical drives&#039;&#039;&#039; (default) || A compact header shows collector state and reported/expected counts. Below it, two &#039;&#039;Honeycomb&#039;&#039; widgets share the remaining viewport, one for response time and one for reporting status. Each uses the template host context, item pattern &amp;lt;code&amp;gt;PD *&amp;lt;/code&amp;gt;, item tag &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt; and exactly one &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag (&amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt;). Primary label uses &amp;lt;code&amp;gt;{ITEM.NAME}&amp;lt;/code&amp;gt;, secondary label uses the value. Use an explicit value map or labelled colors for availability. || All 13 drive cells in the status view and all 13 reporting latency cells in one 1920×1080 kiosk viewport at 100% zoom, without scrolling, paging or a hidden-cell ellipsis. Status remains visible if a latency value ages out.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOPS by drive&#039;&#039;&#039; || One full-width &#039;&#039;Graph prototype&#039;&#039; widget, source &#039;&#039;Graph prototype&#039;&#039;, select the Operations prototype, set 4 columns × 4 rows, dashboard time period, legend hidden for the overview. || Thirteen individually labelled mini-graphs on a single screen. Four members map to &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; and the cache SSD is labelled &amp;lt;code&amp;gt;CacheCade_0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Throughput by drive&#039;&#039;&#039;, &#039;&#039;&#039;Response time by drive&#039;&#039;&#039;, &#039;&#039;&#039;Queue depth by drive&#039;&#039;&#039; || Three additional pages with one full-width 4 × 4 graph-prototype widget each, selecting the respective prototype. Use matching order and time period. || Operators can compare siblings over the same time window or open the individual discovered graph at full size, with its legend.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Discovery populates both widget types automatically. The graph pages have 16 slots at the initial layout and Zabbix automatically pages the 17th graph. The default honeycombs reflow as the disk count grows; their capacity depends on widget dimensions and the frontend&#039;s 32-pixel minimum cell size. Validate that the overview fits the intended display after major expansion. Set a frontend refresh interval offered by 7.0, such as 10 seconds. The five-second agent sampling interval remains independent of browser refresh. For missing data, use the status panel and freshness trigger alongside the last displayed latency.&lt;br /&gt;
&lt;br /&gt;
== Construction, commissioning and recovery ==&lt;br /&gt;
&lt;br /&gt;
=== Build sequence ===&lt;br /&gt;
&lt;br /&gt;
# Package the collector, inventory worker, systemd service/timer and fixed Agent 2 include. Suggested names are &amp;lt;code&amp;gt;/usr/local/libexec/kitsnet-megaraid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.timer&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/zabbix/zabbix_agent2.d/kitsnet-megaraid.conf&amp;lt;/code&amp;gt;. Keep immutable code root-owned, cached inventory group-readable to &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; and mutable baseline files in a separate directory writable by the collector.&lt;br /&gt;
# Create the 7.0 template in the Zabbix frontend in the order master items, health items, discovery rule, item prototypes, graph prototypes, dashboard, triggers. Use the JavaScript and table settings above. Export the complete template as Zabbix 7.0 YAML, including the template dashboard and prototype references. Preserve export UUIDs when revising it. Import first on a test host or test server; review the import diff before linking production.&lt;br /&gt;
# Enable and inspect the inventory service. Confirm all 13 physical keys, six parent VDs and the LVM relationship for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. Compare physical identities with the acceptance table. Reconcile by WWN if firmware or local enumeration has changed.&lt;br /&gt;
# Record the initial DPM setting, enable collection as an administrator, then verify Agent 2 permissions using its service account. Keep DPM setters outside the polling key. Validate both text keys and their JSON, then enable the five-second master. Sample test commands are shown below; during construction provide a non-mutating test mode or a separate baseline directory for manual checks.&lt;br /&gt;
# Allow discovery and two contiguous valid samples. Open &#039;&#039;Monitoring → Latest data&#039;&#039;, filter the physical key or parent tag, inspect one disk&#039;s graph set, and verify the host dashboard at the intended display resolution. Record template revision, command versions, expected count, retention policy and operators&#039; acceptance in this page&#039;s revision history.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status kitsnet-megaraid-inventory.timer&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.inventory&lt;br /&gt;
sudo -u zabbix /usr/local/libexec/kitsnet-megaraid probe&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply hist &#039;-physdrv[21:14]&#039; -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acceptance tests ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Test !! Expected result&lt;br /&gt;
|-&lt;br /&gt;
| Inventory and LLD || Exactly 13 unique physical-key rows, 13 discovered metadata items, 78 performance items and 52 graphs (four per drive). Four HDD keys map to &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt;. One SSD maps to &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. The explicit WWN/serial pairs match the inventory.&lt;br /&gt;
|-&lt;br /&gt;
| Counters and units || For two samples from an active backup disk, recompute read IOPS and bytes/s from raw deltas and elapsed seconds. Compare with the stored item values within rounding. Include 4 KiB sectors in fixtures, plus FUA and flush activity. RA response time is in ms.&lt;br /&gt;
|-&lt;br /&gt;
| Automatic additions || In a fixture or test host add a 14th physical identity and a parent. One discovery cycle creates its metrics, tags and four graphs and adds it to the dashboard. Hardware changes on Wort are unnecessary for this test.&lt;br /&gt;
|-&lt;br /&gt;
| Move, swap and shared membership || Move one WWN to a new bay and change its DID: keys and history persist. Replace the disk in its old bay with a new WWN: new history starts after the new baseline. A drive with two parent VDs appears once with both parent IDs. A spare appears with its role and empty parent list.&lt;br /&gt;
|-&lt;br /&gt;
| Lost/stale inventory || Inject a bad JSON response, duplicate WWN, contradictory DID or incomplete VD membership. Last good inventory survives, affected data is withheld, and global discovery does not delete drives. LVM-only failure marks LVM coverage incomplete.&lt;br /&gt;
|-&lt;br /&gt;
| DPM OFF or reset || Retained CLI output produces an unavailable status and gaps. On re-enable, counter wrap or collector restart, the first valid sample seeds a fresh baseline; no spike is emitted.&lt;br /&gt;
|-&lt;br /&gt;
| Dashboard and delivery || At 1920×1080 all installed disks appear on the overview and IOPS graphs page. Check availability for an idle disk and a missing-report fixture. Confirm one Agent 2 fast request every five seconds and no per-drive shell executions for the WWN-equipped fleet.&lt;br /&gt;
|-&lt;br /&gt;
| Operational overhead || Across a representative backup window and a busy VM workload, record guarded collector elapsed/CPU time, missed five-second intervals, Zabbix queue delay, DB history growth, and host/application latency including p95/p99 where available. Compare DPM OFF, ON with no polling and ON at 5s. Investigate material workload changes before acceptance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting and rollback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;The modern StorCLI reports DPM unsupported.&#039;&#039;&#039; Check the executable path. The successful combination on Wort is legacy StorCLI with &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt;. Firmware updates are a separate maintenance decision.&lt;br /&gt;
* &#039;&#039;&#039;The CLI returns figures that no longer move.&#039;&#039;&#039; Check the DPM header, expected/reported count, inventory age and sample timestamp. Compare counter deltas on an active member. A successful exit alone is insufficient.&lt;br /&gt;
* &#039;&#039;&#039;A bay is associated with the wrong identity or volume.&#039;&#039;&#039; Inspect fresh PD/VD inventory and the two identity guards. Force an inventory refresh. Keep the affected disk unavailable until the join is unambiguous; historical records retain the old physical key.&lt;br /&gt;
* &#039;&#039;&#039;Rollback.&#039;&#039;&#039; Disable the two master items or unlink the template while retaining history according to site policy. Stop the proposed inventory timer and remove the Agent 2 include through the normal change process. Restore the recorded DPM state; if the original state was OFF, run &amp;lt;code&amp;gt;sudo -n /usr/local/sbin/storcli64 /c0 set dpm=off&amp;lt;/code&amp;gt; and verify &amp;lt;code&amp;gt;/c0 show dpm&amp;lt;/code&amp;gt;. Verify controller and VD health and continued SMART health monitoring. Review history retention before any “unlink and clear” operation.&lt;br /&gt;
&lt;br /&gt;
== Document control ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Revision !! Date !! Record&lt;br /&gt;
|-&lt;br /&gt;
| 0.1 || 27 November 2026 || Design for review. Live controller, inventory normalization and host polling measurements verified. Record the template export revision, production acceptance date and measured retention cost when the build is commissioned.&lt;br /&gt;
|-&lt;br /&gt;
| 1.0 || 27 November 2026 || Production collector and Zabbix 7.0 template deployed. Recorded discovery counts, dashboard checks, native systemd units and live polling measurements.&lt;br /&gt;
|-&lt;br /&gt;
| 1.1 || 27 November 2026 || Corrected all four graph widget references. Verified in Chrome that each graph page rendered 13 charts with the selected one-hour range and no time-period errors.&lt;br /&gt;
|-&lt;br /&gt;
| 1.2 || 27 November 2026 || Wrapped the two Honeycomb labels across four lines. Compared both copies of all 13 identities and their parent names with live discovery and visually checked the overview in Chrome.&lt;br /&gt;
|-&lt;br /&gt;
| 1.3 || 27 November 2026 || Increased the four graph widgets to 12 grid units. In Chrome at the operator&#039;s window size, all 52 graph images measured 144 pixels high and each thirteenth graph fit fully within its panel.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[KitsNet Operations:Monitoring:Zabbix]]&lt;br /&gt;
* [[KitsNet Operations:Services:Docker:High Availability NAS:Monitoring|KitsNet NAS HA Monitoring]] — local precedent for Agent 2 master items and Zabbix dependent items.&lt;br /&gt;
* [[KitsNet Operations:External Packages:Linux:MegaRAID Storage Manager]] — KitsNet&#039;s storage-management software notes.&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery Zabbix 7.0 low-level discovery] and [https://www.zabbix.com/documentation/7.0/en/manual/config/items/itemtypes/dependent_items dependent items].&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery/graph_prototypes Zabbix graph prototypes], [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/graph_prototype graph prototype widget] and [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/honeycomb honeycomb widget].&lt;br /&gt;
* [https://docs.broadcom.com/doc/pub-005681 Broadcom 12Gb/s MegaRAID SAS Software User Guide]. The command path and report behavior above were verified on the actual 9361-8i.&lt;br /&gt;
* Validation record, Wort, 27 November 2026: native &amp;lt;code&amp;gt;-DpmStat&amp;lt;/code&amp;gt; live captures, lookup of all PDs and VDs, five-second polling trials, off-state identity-guard timings and LVM inventory.&lt;br /&gt;
&lt;br /&gt;
[[Category:KitsNet Services]]&lt;br /&gt;
[[Category:Architecture]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_I/O_Monitoring&amp;diff=2721</id>
		<title>KitsNet Operations:Monitoring:MegaRAID Physical Drive I/O Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_I/O_Monitoring&amp;diff=2721"/>
		<updated>2026-11-27T17:01:38Z</updated>

		<summary type="html">&lt;p&gt;Psmode: (username removed) (log details removed)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[KitsNet Operations:Monitoring:MegaRAID Physical Drive IO Monitoring]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2720</id>
		<title>KitsNet Operations:Monitoring:MegaRAID Physical Drive IO Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2720"/>
		<updated>2026-11-27T17:01:38Z</updated>

		<summary type="html">&lt;p&gt;Psmode: (username removed) (log details removed)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Design and implementation guide&#039;&#039;&#039; · Revision 0.1 · 27 November 2026 · Proposed for construction&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Page placement !! Service !! Target systems !! Validation state&lt;br /&gt;
|-&lt;br /&gt;
| Child of [[KitsNet Operations:Monitoring:Zabbix]] || Physical storage monitoring || &amp;lt;code&amp;gt;wort&amp;lt;/code&amp;gt; (Agent 2) and &amp;lt;code&amp;gt;zaya&amp;lt;/code&amp;gt; (Zabbix server and frontend) || Controller telemetry and discovery inputs verified. Template, collector service, graphs and dashboard are proposed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Purpose and operator view ==&lt;br /&gt;
&lt;br /&gt;
An operator investigating a slow virtual disk needs to identify the physical disk involved, find its bay and parent virtual drive, and compare it with its peers. The proposed design polls controller 0 every five seconds, discovers its physical disks automatically, creates a graph set for each disk and shows all current disks on one host dashboard. The primary index is the physical drive&#039;s worldwide name (WWN). A replacement in the same bay receives a new history. A drive moved to another bay on the same host retains its history.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; is MegaRAID virtual drive &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt;. One member is WD serial &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt;, WWN &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt;, enclosure 21, slot 14. The parent appears in Linux as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;. Its partition supplies VG &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt; and LV &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. The operator should be able to start with any of these identifiers and find the physical disk. The counters measure work at that disk. Attributing that work to an individual guest or Linux LV requires counters at the corresponding higher layer.&lt;br /&gt;
&lt;br /&gt;
== Verified platform and sampling budget ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Verified on 27 November 2026 !! Implementation consequence&lt;br /&gt;
|-&lt;br /&gt;
| Wort || Broadcom/Avago MegaRAID SAS 9361-8i, controller 0, firmware package &amp;lt;code&amp;gt;24.21.0-0132&amp;lt;/code&amp;gt;. Twelve SATA HDDs and one CacheCade SATA SSD. || Native per-drive counters are available on the installed firmware.&lt;br /&gt;
|-&lt;br /&gt;
| Legacy StorCLI || &amp;lt;code&amp;gt;/usr/local/sbin/storcli64&amp;lt;/code&amp;gt;, version 1.23.02. Its MegaCLI-compatible &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt; interface returned live data. || Pin this absolute path for DPM reads. The Zabbix service account successfully used non-interactive sudo for both reads with &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Inventory StorCLI || &amp;lt;code&amp;gt;/opt/MegaRAID/storcli/storcli64&amp;lt;/code&amp;gt;, version 007.2612. Its JSON reports include physical identities and explicit virtual-drive membership. Its DPM query returned “DPM Feature is not supported” even with the legacy DPM setting ON. || Use this binary for inventory. A generic controller capability flag is insufficient to confirm the DPM query path.&lt;br /&gt;
|-&lt;br /&gt;
| Monitoring || Agent 2 on Wort and server/frontend on Zaya run 7.0.32. Wort&#039;s active endpoint is &amp;lt;code&amp;gt;zabbix.lan.kitsnet.us&amp;lt;/code&amp;gt;. || Target Zabbix 7.0 templates, dependent discovery, graph prototypes and template dashboards.&lt;br /&gt;
|-&lt;br /&gt;
| Test state || DPM was restored to OFF. Disk reports can return retained values in this state. || A valid sample requires both reports to say &amp;lt;code&amp;gt;Performance Monitor: ON&amp;lt;/code&amp;gt;. Keep the existing SMART health checks.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The five-second test read &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; in sequence as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. All 12 polls returned all 13 drives. Each pair took 39–45 ms elapsed and averaged 37 ms of CPU time, equivalent to 0.74% of one core or about 0.05% of the 16-CPU host. The backup volume sustained 111.8 MiB/s, compared with 111.6 MiB/s during 15-second polling. Average read latency was 1.74 and 1.58 ms respectively. The short test establishes feasibility during the observed backup workload. Sustained application tail latency and database retention cost require commissioning measurements.&lt;br /&gt;
&lt;br /&gt;
The proposed collector also checks physical identities on either side of the two reads. Three four-command trials, with DPM OFF and retained reports, took 92–100 ms each including process startup. Budget and benchmark the complete collector with DPM ON during construction. The 37 ms CPU result covers the two live DPM reads only.&lt;br /&gt;
&lt;br /&gt;
== Collection and discovery architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort, five-second path                         Zaya, Zabbix 7.0&lt;br /&gt;
PDList → extended counters → running averages → PDList&lt;br /&gt;
    confirm identity, validate DPM, form intervals&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.dpm ───────→ dependent metric prototypes&lt;br /&gt;
                                                        │&lt;br /&gt;
Wort, five-minute inventory                             ├── per-drive graph prototypes&lt;br /&gt;
    StorCLI physical + virtual JSON, LVM reports        └── template dashboard on Wort&lt;br /&gt;
    validate and atomically publish inventory&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.inventory ─→ server-side LLD JavaScript&lt;br /&gt;
                                                └→ metadata and parent references&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only the two master items request data from Agent 2. Each DPM report covers all drives. The server or its assigned proxy runs low-level discovery (LLD), extracts values and instantiates prototypes. The slow inventory worker runs independently so an inventory scan cannot hold the five-second check open. One template link to the existing Wort host is sufficient.&lt;br /&gt;
&lt;br /&gt;
=== Controller commands and privilege boundary ===&lt;br /&gt;
&lt;br /&gt;
As an operator on Wort, enable DPM once at commissioning and verify the readback. Record the previous setting first. Monitoring reads have no reason to call the setter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 set dpm=on&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The steady five-second path uses these calls in order. &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt; suppresses the per-invocation CLI logfile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ext -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ra  -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inventory worker uses the following fixed read commands. Check the embedded &amp;lt;code&amp;gt;Command Status.Status&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Success&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Controller&amp;lt;/code&amp;gt; for 0 before using &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt;. Check the legacy reports for &amp;lt;code&amp;gt;Exit Code: 0x00&amp;lt;/code&amp;gt; as well as the process exit status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/eall/sall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/vall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0 show eventloginfo J&lt;br /&gt;
lsblk --json --paths --output NAME,KNAME,PKNAME,TYPE,MAJ:MIN,WWN&lt;br /&gt;
sudo -n /usr/sbin/pvs --segments --reportformat json -o pv_name,vg_name,lv_name,lv_uuid&lt;br /&gt;
sudo -n /usr/sbin/lvs -a --segments --reportformat json -o vg_name,lv_name,lv_uuid,lv_path,segtype,devices&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use fixed argument lists, a fixed locale, an execution deadline and root-owned executable paths. An inventory systemd service may run these read commands as root and publish a group-readable file for Agent 2. For the fast path, permit only the exact read commands needed by &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; if additional access is required. Revalidate under the running service&#039;s SELinux context during commissioning.&lt;br /&gt;
&lt;br /&gt;
== Drive identity and volume attribution ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Rule !! Use in Zabbix&lt;br /&gt;
|-&lt;br /&gt;
| Physical key || Normalize a valid 16-hex-digit ATA WWN to lowercase and prefix &amp;lt;code&amp;gt;w_&amp;lt;/code&amp;gt;. If a disk genuinely lacks a WWN, use &amp;lt;code&amp;gt;s_&amp;lt;/code&amp;gt; plus the SHA-256 digest of the trimmed model, a NUL byte and the trimmed serial. Reject placeholder or duplicate identities. || Immutable item-key argument on this host. Full WWN, serial and model remain searchable.&lt;br /&gt;
|-&lt;br /&gt;
| Controller address || Preserve controller number, enclosure, slot and DID as separate values. Join both DPM reports to a confirmed physical identity using all available address fields. || Bay, DID and parent names are labels. A moved disk can acquire new labels while keeping its item key.&lt;br /&gt;
|-&lt;br /&gt;
| Direct RAID parents || For every &amp;lt;code&amp;gt;/c0/vN&amp;lt;/code&amp;gt;, join its &amp;lt;code&amp;gt;PDs for VD N&amp;lt;/code&amp;gt; list to the physical inventory by enclosure:slot and DID. Check DG against the DG/VD record. Preserve every match and the OS drive name when present. || Display &amp;lt;code&amp;gt;c0/vN Name&amp;lt;/code&amp;gt;. A parent-ID tag uses delimited tokens, e.g. &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt;, for exact membership searches using “contains”.&lt;br /&gt;
|-&lt;br /&gt;
| CacheCade || The SSD is a direct member of &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. Cached VDs are consumers of that cache. || Show the cache VD as its parent. A consumer list, if displayed, is a separate relationship.&lt;br /&gt;
|-&lt;br /&gt;
| Spare, unconfigured or unreported disk || Keep each identifiable, inventory-visible disk in discovery. Allow an empty parent array for a spare/unassigned disk. Record the controller state and whether DPM reports a row. || Display the role and a data-availability status. A missing row is unknown. A reported zero is a valid value.&lt;br /&gt;
|-&lt;br /&gt;
| Linux LVM || Join each parent VD&#039;s OS disk to its partition/PV by Linux device identity. Collect the set of distinct LV UUIDs with extents on those PVs. || Keep the full PV/VG/LV list in a text item for the physical disk. Avoid truncating a large VG into a tag or graph title.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For LVM, resolve device aliases by major:minor, identify partition parents from &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and group &amp;lt;code&amp;gt;pvs&amp;lt;/code&amp;gt; rows by PV. Ignore free segments with empty LV names. For stacked LVs, resolve &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; segment dependencies recursively through component LVs to PVs, with a visited set. Retain direct and dependent roles in the metadata. Present an incomplete map as such if an unfamiliar segment type cannot be resolved. A Linux LV that spans RAID volumes can appear under multiple parents. Some parent VDs have no Linux LV. Linux names such as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; are current observations and can change on boot.&lt;br /&gt;
&lt;br /&gt;
=== Acceptance inventory from Wort ===&lt;br /&gt;
&lt;br /&gt;
The build must discover these records from the controller. This table is a point-in-time comparison for the first import. It must never become a configured list of devices.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Bay !! DID !! Physical WWN !! Serial !! Direct RAID parent !! Linux disk / VG&lt;br /&gt;
|-&lt;br /&gt;
| 21:13 || 17 || &amp;lt;code&amp;gt;5000c500ebb8561f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZDP9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:14 || 14 || &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:15 || 16 || &amp;lt;code&amp;gt;5001b448bc70bc7f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;214101A000F1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt; || Controller cache&lt;br /&gt;
|-&lt;br /&gt;
| 21:16 || 12 || &amp;lt;code&amp;gt;5000cca095c3d53a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8ED1R&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:17 || 20 || &amp;lt;code&amp;gt;5000c500e82d443a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0QHAB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:18 || 18 || &amp;lt;code&amp;gt;50014ee2bab34493&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K1JJ1DYX&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:19 || 15 || &amp;lt;code&amp;gt;50014ee216fddd9f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WX32D95FVCAC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:21 || 19 || &amp;lt;code&amp;gt;50014ee2100846f2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K3SJT2L8&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:22 || 27 || &amp;lt;code&amp;gt;5000cca095dbba95&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYZZKF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:16 || 25 || &amp;lt;code&amp;gt;5000cca095c3d2b9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8DRBR&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:17 || 24 || &amp;lt;code&amp;gt;5000c500ebb8d227&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZSRK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:18 || 23 || &amp;lt;code&amp;gt;5000c500e82d43dc&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0PZBD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:19 || 26 || &amp;lt;code&amp;gt;5000cca095dba2c3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYTMVF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Agent-side implementation specification ==&lt;br /&gt;
&lt;br /&gt;
=== Inventory and replacement handling ===&lt;br /&gt;
&lt;br /&gt;
# Run a boot-triggered and then five-minute inventory timer. Read the controller event-log sequence before and after both StorCLI inventory calls. When the sequence changes mid-scan, retry from the beginning with a bounded retry count. The verified JSON field is &amp;lt;code&amp;gt;Newest Sequence Number&amp;lt;/code&amp;gt;. Also record the reboot sequence.&lt;br /&gt;
# Require a complete, internally consistent PD/VD inventory. Compare the physical summary keys with detailed records, validate unique identities and locations, and verify the member references. Publish by atomic rename on the same filesystem to &amp;lt;code&amp;gt;/run/kitsnet-megaraid/inventory.json&amp;lt;/code&amp;gt;. Preserve the last good map on an error and expose the error and inventory age separately.&lt;br /&gt;
# On a five-second sample, read &amp;lt;code&amp;gt;-PDList&amp;lt;/code&amp;gt; before and after &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt;. Parse enclosure, slot, DID, WWN and drive sequence number. Compare the two observations and the cached identity. Quarantine changed, unknown or conflicting locations for that interval. Coalesce an inventory refresh request on an unknown or changed address. The periodic timer provides an independent retry.&lt;br /&gt;
# For a WWN-less drive, qualify a serial/model fallback using matching identity reads on both sides of the DPM sample (for SATA members, &amp;lt;code&amp;gt;smartctl -j -i -d megaraid,DID /dev/bus/0&amp;lt;/code&amp;gt;). Cache the durable identity at discovery. A transiently missing WWN on a previously identified disk is an identity conflict. Suppress that disk&#039;s sample until it is resolved. The fallback&#039;s extra cost belongs in commissioning.&lt;br /&gt;
# Invalidate counter baselines on controller or agent restarts, changes to the physical identity map, and DPM disable/enable events. Never give a newly arrived drive the previous occupant&#039;s last reading. Reconfiguration of logical drives can change parent labels by the next successful inventory refresh.&lt;br /&gt;
&lt;br /&gt;
=== Reference inventory normalizer ===&lt;br /&gt;
&lt;br /&gt;
The following Python 3.9 function is the RAID part of the inventory producer. Pass it the checked &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;/c0/eall/sall&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/c0/vall&amp;lt;/code&amp;gt;. It ran against Wort&#039;s reports and returned all 13 physical identities. The service wrapper adds capture time, LVM references, identity guard metadata and error reporting before publishing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import hashlib&lt;br /&gt;
import re&lt;br /&gt;
&lt;br /&gt;
def disk_key(wwn, model, serial):&lt;br /&gt;
    wwn = wwn.lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
    if re.fullmatch(r&amp;quot;[0-9a-f]{16}&amp;quot;, wwn) and wwn not in {&amp;quot;0&amp;quot; * 16, &amp;quot;f&amp;quot; * 16}:&lt;br /&gt;
        return &amp;quot;w_&amp;quot; + wwn&lt;br /&gt;
    if not model or not serial or serial.upper() in {&amp;quot;N/A&amp;quot;, &amp;quot;UNKNOWN&amp;quot;, &amp;quot;NONE&amp;quot;, &amp;quot;-&amp;quot;}:&lt;br /&gt;
        raise ValueError(&amp;quot;missing durable disk identity&amp;quot;)&lt;br /&gt;
    digest = hashlib.sha256((model + &amp;quot;\0&amp;quot; + serial).encode(&amp;quot;utf-8&amp;quot;)).hexdigest()&lt;br /&gt;
    return &amp;quot;s_&amp;quot; + digest&lt;br /&gt;
&lt;br /&gt;
def inventory(pd_report, vd_report, controller=&amp;quot;c0&amp;quot;):&lt;br /&gt;
    # Arguments are the checked Response Data objects for one controller.&lt;br /&gt;
    drives, by_location = {}, {}&lt;br /&gt;
    bays, dids, seen_paths = set(), set(), set()&lt;br /&gt;
    expected_paths = {k for k in pd_report if re.fullmatch(r&amp;quot;Drive /c\d+/e\d+/s\d+&amp;quot;, k)}&lt;br /&gt;
    for label, detail in pd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;Drive (/c\d+/e(\d+)/s(\d+)) - Detailed Information&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        path, eid, slot = match.groups()&lt;br /&gt;
        row = pd_report[&amp;quot;Drive &amp;quot; + path][0]&lt;br /&gt;
        attrs = detail[&amp;quot;Drive &amp;quot; + path + &amp;quot; Device attributes&amp;quot;]&lt;br /&gt;
        bay = eid + &amp;quot;:&amp;quot; + slot&lt;br /&gt;
        if path.split(&amp;quot;/&amp;quot;)[1] != controller or row[&amp;quot;EID:Slt&amp;quot;] != bay:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent controller or bay&amp;quot;)&lt;br /&gt;
        did = str(row[&amp;quot;DID&amp;quot;])&lt;br /&gt;
        model = attrs[&amp;quot;Model Number&amp;quot;].strip()&lt;br /&gt;
        serial = attrs[&amp;quot;SN&amp;quot;].strip()&lt;br /&gt;
        wwn = str(attrs.get(&amp;quot;WWN&amp;quot;, &amp;quot;&amp;quot;)).strip().lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
        key = disk_key(wwn, model, serial)&lt;br /&gt;
        loc = (bay, did)&lt;br /&gt;
        if key in drives or bay in bays or did in dids:&lt;br /&gt;
            raise ValueError(&amp;quot;duplicate disk identity or address&amp;quot;)&lt;br /&gt;
        bays.add(bay)&lt;br /&gt;
        dids.add(did)&lt;br /&gt;
        seen_paths.add(&amp;quot;Drive &amp;quot; + path)&lt;br /&gt;
        size = re.fullmatch(r&amp;quot;(\d+)\s*B&amp;quot;, attrs[&amp;quot;Logical Sector Size&amp;quot;].strip())&lt;br /&gt;
        if not size or int(size[1]) &amp;lt; 1:&lt;br /&gt;
            raise ValueError(&amp;quot;unknown logical sector size&amp;quot;)&lt;br /&gt;
        drives[key] = dict(id=key, wwn=wwn if key.startswith(&amp;quot;w_&amp;quot;) else &amp;quot;&amp;quot;,&lt;br /&gt;
                           serial=serial, model=model, controller=controller,&lt;br /&gt;
                           bay=bay, did=did, sector_bytes=int(size[1]),&lt;br /&gt;
                           dg=str(row[&amp;quot;DG&amp;quot;]), state=row[&amp;quot;State&amp;quot;], media=row[&amp;quot;Med&amp;quot;],&lt;br /&gt;
                           parents=[])&lt;br /&gt;
        by_location[loc] = key&lt;br /&gt;
&lt;br /&gt;
    for label, rows in vd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;/&amp;quot; + re.escape(controller) + r&amp;quot;/v(\d+)&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        vd = match[1]&lt;br /&gt;
        row = rows[0]&lt;br /&gt;
        dg, reported_vd = row[&amp;quot;DG/VD&amp;quot;].split(&amp;quot;/&amp;quot;)&lt;br /&gt;
        if vd != reported_vd:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent virtual drive identity&amp;quot;)&lt;br /&gt;
        parent = dict(id=controller + &amp;quot;/v&amp;quot; + vd, name=row[&amp;quot;Name&amp;quot;] or &amp;quot;VD&amp;quot; + vd,&lt;br /&gt;
                      raid=row[&amp;quot;TYPE&amp;quot;], os=vd_report[&amp;quot;VD&amp;quot; + vd + &amp;quot; Properties&amp;quot;]&lt;br /&gt;
                      .get(&amp;quot;OS Drive Name&amp;quot;, &amp;quot;N/A&amp;quot;))&lt;br /&gt;
        for member in vd_report[&amp;quot;PDs for VD &amp;quot; + vd]:&lt;br /&gt;
            loc = (member[&amp;quot;EID:Slt&amp;quot;], str(member[&amp;quot;DID&amp;quot;]))&lt;br /&gt;
            drive = drives[by_location[loc]]&lt;br /&gt;
            if drive[&amp;quot;dg&amp;quot;] != dg:&lt;br /&gt;
                raise ValueError(&amp;quot;membership changed during inventory&amp;quot;)&lt;br /&gt;
            if parent[&amp;quot;id&amp;quot;] not in [p[&amp;quot;id&amp;quot;] for p in drive[&amp;quot;parents&amp;quot;]]:&lt;br /&gt;
                drive[&amp;quot;parents&amp;quot;].append(parent)&lt;br /&gt;
&lt;br /&gt;
    for drive in drives.values():&lt;br /&gt;
        drive[&amp;quot;parents&amp;quot;].sort(key=lambda p: int(p[&amp;quot;id&amp;quot;].split(&amp;quot;/v&amp;quot;)[1]))&lt;br /&gt;
        if drive[&amp;quot;state&amp;quot;] == &amp;quot;Onln&amp;quot; and drive[&amp;quot;dg&amp;quot;].isdigit() and not drive[&amp;quot;parents&amp;quot;]:&lt;br /&gt;
            raise ValueError(&amp;quot;online member has no virtual-drive mapping&amp;quot;)&lt;br /&gt;
    if not drives or seen_paths != expected_paths:&lt;br /&gt;
        raise ValueError(&amp;quot;empty or incomplete controller inventory&amp;quot;)&lt;br /&gt;
    return dict(schema=1, complete=True, drives=drives)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Five-second sample and rate calculation ===&lt;br /&gt;
&lt;br /&gt;
Parse &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; by enclosure/slot/DID section. Its seven numeric columns, in order, are sectors read, sectors written, sectors written with Force Unit Access (FUA), read commands, write commands, write-FUA commands and flush commands. Parse each &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; row as enclosure, slot, DID, aggregate IOPS, queue depth, transfer rate (MB/s) and response time (ms). Validate field counts, numeric ranges and unique addresses in each report. The two reports are successive controller snapshots; their values can represent different averaging intervals.&lt;br /&gt;
&lt;br /&gt;
For each disk, keep the last accepted extended counters, current physical key, sequence, sector size and an acquisition timestamp from the host monotonic clock. Publish the counter baseline atomically, once per successful sample, under a nonblocking single-writer lock. Allow less than five seconds for all fast-path commands combined. On overlap, report a collection failure and preserve the baseline. Keep probes run manually for tests from modifying the production baseline.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
elapsed_seconds = current.monotonic_time - previous.monotonic_time&lt;br /&gt;
read_iops       = change(read_commands) / elapsed_seconds&lt;br /&gt;
write_iops      = change(write_commands) / elapsed_seconds&lt;br /&gt;
read_Bps        = change(read_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
write_Bps       = change(write_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
response_ms     = running_average.response_time_ms&lt;br /&gt;
queue_depth     = running_average.queue_depth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the logical sector size of the physical member. The 13 verified members report 512 bytes. Preserve the separate FUA and flush counters in the master record. Label the two write rates as the native &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt; column. Validate the firmware&#039;s treatment of FUA before adding it to a combined write total. Read/write IOPS and bytes/s are interval rates. Response time and queue depth are firmware running averages. Wort reports up to 100 commands for this average, so a lightly used disk can represent a different time window.&lt;br /&gt;
&lt;br /&gt;
An initial sample establishes a baseline. After a reboot, DPM transition, ambiguous identity, counter decrease/wrap, collector state loss, or interval longer than twice the configured poll period, clear the affected baseline and wait for two contiguous samples. Publish a gap for affected rates. On a failed command, DPM OFF, stale inventory beyond 15 minutes, or a missing disk row, record availability explicitly and omit invalid numbers. A genuine idle drive with unchanged, valid counters has zero rates. Retained data read while DPM is OFF is stale even when the CLI exits successfully.&lt;br /&gt;
&lt;br /&gt;
=== JSON contracts and Agent 2 keys ===&lt;br /&gt;
&lt;br /&gt;
The inventory envelope contains &amp;lt;code&amp;gt;schema&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;complete&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;collected_at&amp;lt;/code&amp;gt; (Unix seconds), &amp;lt;code&amp;gt;drives&amp;lt;/code&amp;gt; keyed by physical identity, and a separate LVM coverage status. Each drive adds an &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array with PV, VG, LV name, LV UUID and relation. An empty array with complete coverage means “no mapped LV”. The inventory reader indicates failure if the cache is stale or corrupt. The LLD rule below consumes only a complete RAID inventory. Failure to resolve LVM updates the LVM status independently.&lt;br /&gt;
&lt;br /&gt;
The example below shows one drive in a five-second master payload. The numbers illustrate the field types. In production &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt; counts eligible DPM members and &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt; counts validated members. Missing drives appear in &amp;lt;code&amp;gt;status_by_id&amp;lt;/code&amp;gt; even when their metric record is absent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;schema&amp;quot;: 1, &amp;quot;sampled_at&amp;quot;: 1795796160, &amp;quot;ok&amp;quot;: 1, &amp;quot;dpm_on&amp;quot;: 1,&lt;br /&gt;
  &amp;quot;expected&amp;quot;: 13, &amp;quot;reported&amp;quot;: 13, &amp;quot;poll_ms&amp;quot;: 96, &amp;quot;inventory_age_s&amp;quot;: 42,&lt;br /&gt;
  &amp;quot;status_by_id&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: 1},&lt;br /&gt;
  &amp;quot;drives&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: {&lt;br /&gt;
    &amp;quot;read_iops&amp;quot;: 62.2, &amp;quot;write_iops&amp;quot;: 0, &amp;quot;read_Bps&amp;quot;: 29320192,&lt;br /&gt;
    &amp;quot;write_Bps&amp;quot;: 0, &amp;quot;response_ms&amp;quot;: 1.613, &amp;quot;queue_depth&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_sectors&amp;quot;: 1336328, &amp;quot;write_sectors&amp;quot;: 0, &amp;quot;write_fua_sectors&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_ops&amp;quot;: 1399, &amp;quot;write_ops&amp;quot;: 0, &amp;quot;write_fua_ops&amp;quot;: 0, &amp;quot;flush_ops&amp;quot;: 0&lt;br /&gt;
  }}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use two fixed Agent 2 user parameters. The proposed helper runs as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. Its inventory mode reads the atomically published file, verifies freshness and outputs the envelope. Its sample mode performs the guarded DPM read. On DPM OFF return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on=0&amp;lt;/code&amp;gt; and no numeric disk data. When the DPM state itself cannot be read, omit &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt; and a short diagnostic. For known eligible disks, return availability 0 on a global failure. Emit only JSON on standard output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
UserParameter=kitsnet.megaraid.inventory,/usr/local/libexec/kitsnet-megaraid inventory&lt;br /&gt;
UserParameter=kitsnet.megaraid.dpm,/usr/local/libexec/kitsnet-megaraid sample&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zabbix server implementation ==&lt;br /&gt;
&lt;br /&gt;
Create template &amp;lt;code&amp;gt;KitsNet MegaRAID physical drives by agent 2&amp;lt;/code&amp;gt; in the same local template group as the existing KitsNet monitoring templates. Link it to the existing Wort host. Verify the Agent 2 active hostname matches that host&#039;s technical name. Keep all IDs, enclosure addresses and logical volume names out of template constants.&lt;br /&gt;
&lt;br /&gt;
=== Master items, discovery and life cycle ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Object !! Type / key !! Interval or master !! Information type and settings&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive inventory || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.inventory&amp;lt;/code&amp;gt; || 1m, cached inventory refreshed every 5m || Text. Master history 0; the discovery rule, LVM items and inventory health use the incoming value.&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive DPM sample || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.dpm&amp;lt;/code&amp;gt; || 5s || Text. Master history 0. The collector deadline must fit the agent/server item timeout. Expose a separate diagnostic text item if the master fails.&lt;br /&gt;
|-&lt;br /&gt;
| Discover MegaRAID physical drives || Dependent discovery rule / &amp;lt;code&amp;gt;kitsnet.megaraid.pd.discovery&amp;lt;/code&amp;gt; || Inventory master || JavaScript below, then &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Disable lost resources after 1h, delete after 30d, subject to KitsNet retention policy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A drive added just after an inventory scan should normally appear within about six minutes (five-minute scan plus one-minute master polling), plus server scheduling and agent active-check refresh where applicable. The new rates start on the next two valid samples. An inventory failure must fail discovery preprocessing; returning an empty successful list would mark every existing disk lost. Keep daily housekeeping and history-retention policies in mind when retiring disks.&lt;br /&gt;
&lt;br /&gt;
=== Server-side discovery code ===&lt;br /&gt;
&lt;br /&gt;
Paste this into the JavaScript preprocessing step of the dependent LLD rule. It runs in the Zabbix server or proxy preprocessing engine and returns a root array of native LLD macro objects. Sorting by physical key gives stable results for the heartbeat step. The code handles multiple RAID parents and unassigned members.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var root = JSON.parse(value);&lt;br /&gt;
if (root.schema !== 1 || root.complete !== true ||&lt;br /&gt;
        !root.drives || typeof root.drives !== &#039;object&#039; || Array.isArray(root.drives)) {&lt;br /&gt;
    throw &#039;Incomplete physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var ids = Object.keys(root.drives).sort();&lt;br /&gt;
if (!ids.length) {&lt;br /&gt;
    throw &#039;Empty physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var rows = [];&lt;br /&gt;
for (var i = 0; i &amp;lt; ids.length; i++) {&lt;br /&gt;
    var key = ids[i];&lt;br /&gt;
    var d = root.drives[key];&lt;br /&gt;
    if (!/^(w_[a-f0-9]{16}|s_[a-f0-9]{64})$/.test(key) ||&lt;br /&gt;
            d.id !== key || !d.controller || !d.bay || !Array.isArray(d.parents)) {&lt;br /&gt;
        throw &#039;Invalid physical-drive identity or mapping&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    var labels = [];&lt;br /&gt;
    var refs = [];&lt;br /&gt;
    for (var j = 0; j &amp;lt; d.parents.length; j++) {&lt;br /&gt;
        var parent = d.parents[j];&lt;br /&gt;
        if (!parent.id || !parent.name) {&lt;br /&gt;
            throw &#039;Incomplete virtual-drive reference&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        labels.push(parent.id + &#039; &#039; + parent.name);&lt;br /&gt;
        refs.push(parent.id);&lt;br /&gt;
    }&lt;br /&gt;
    rows.push({&lt;br /&gt;
        &#039;{#PDKEY}&#039;: key, &#039;{#WWN}&#039;: d.wwn, &#039;{#SERIAL}&#039;: d.serial,&lt;br /&gt;
        &#039;{#DISPLAY}&#039;: d.serial || d.wwn, &#039;{#MODEL}&#039;: d.model,&lt;br /&gt;
        &#039;{#CTRL}&#039;: d.controller, &#039;{#BAY}&#039;: d.bay, &#039;{#DID}&#039;: String(d.did),&lt;br /&gt;
        &#039;{#MEDIA}&#039;: d.media, &#039;{#DG}&#039;: d.dg,&lt;br /&gt;
        &#039;{#PARENTS}&#039;: labels.length ? labels.join(&#039;, &#039;) : &#039;Unassigned (&#039; + d.state + &#039;)&#039;,&lt;br /&gt;
        &#039;{#PARENTIDS}&#039;: refs.length ? &#039;|&#039; + refs.join(&#039;|&#039;) + &#039;|&#039; : &#039;|&#039;&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(rows);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Item prototypes and tags ===&lt;br /&gt;
&lt;br /&gt;
Create the following item prototypes under the discovery rule. All are &#039;&#039;Dependent item&#039;&#039;. Use key prefix &amp;lt;code&amp;gt;kitsnet.megaraid.pd.&amp;lt;/code&amp;gt; and append &amp;lt;code&amp;gt;[{#PDKEY}]&amp;lt;/code&amp;gt;. For example, the full read-IOPS key is &amp;lt;code&amp;gt;kitsnet.megaraid.pd.read_iops[{#PDKEY}]&amp;lt;/code&amp;gt;. A key&#039;s stable argument is the physical identity. Names and tags can change as discovery observes new locations and parent names.&lt;br /&gt;
&lt;br /&gt;
For a fast numeric item the extraction path is &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;].FIELD&amp;lt;/code&amp;gt;. Replace &amp;lt;code&amp;gt;FIELD&amp;lt;/code&amp;gt; with the field in the table. Set JSONPath &#039;&#039;Custom on fail → Discard value&#039;&#039; for missing metrics. Rate calculation already took place against the collector&#039;s monotonic clock. Applying &#039;&#039;Change per second&#039;&#039; again would differentiate a rate a second time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key suffix / field !! Source master and preprocessing !! Value type / unit !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ops/s&amp;lt;/code&amp;gt; || Two distinct items for read and write command rates.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;Bps&amp;lt;/code&amp;gt; || Two distinct items for read and write bytes per second.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; || Controller running-average response time.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), no unit || Controller running-average queue depth.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt; || DPM / &amp;lt;code&amp;gt;$.status_by_id[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Numeric (unsigned), value map 1 Reporting / 0 Unavailable || Keep missing, disabled or stale data distinct from an idle disk. Use discard unchanged with a 1m heartbeat after extracting the status.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;metadata&amp;lt;/code&amp;gt; || Inventory / &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Text, discard unchanged with a 1d heartbeat || Full identity, bay, model, serial, sector size, direct RAID parents, Linux mappings and their coverage.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Name a read-IOPS item &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Read IOPS&amp;lt;/code&amp;gt;. Use the corresponding metric label for the other prototypes. Apply the tags &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pd={#PDKEY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;serial={#SERIAL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wwn={#WWN}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;controller={#CTRL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bay={#BAY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parent_vd={#PARENTIDS}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;media={#MEDIA}&amp;lt;/code&amp;gt; and a fixed &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag for each type. Use &amp;lt;code&amp;gt;metric=response_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;metric=available&amp;lt;/code&amp;gt; exactly as specified for the dashboard. Search &amp;lt;code&amp;gt;parent_vd&amp;lt;/code&amp;gt; with &#039;&#039;Contains&#039;&#039; and the token &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt; to get all four backup members. For an unusually large parent list, keep the complete references in metadata and constrain the summary label/tag to Zabbix field limits.&lt;br /&gt;
&lt;br /&gt;
Create controller-level dependent items on the DPM master for &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;poll_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;inventory_age_s&amp;lt;/code&amp;gt;. Give these keys the prefix &amp;lt;code&amp;gt;kitsnet.megaraid.collector.&amp;lt;/code&amp;gt; and use &amp;lt;code&amp;gt;$.FIELD&amp;lt;/code&amp;gt;. Use numeric (unsigned) for status and counts, numeric (float) for durations; units &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; as applicable. Add a diagnostic string and slow inventory/LVM coverage health. A per-disk &amp;lt;code&amp;gt;available=0&amp;lt;/code&amp;gt; on a known spare can be expected; flag missing reports for eligible online members.&lt;br /&gt;
&lt;br /&gt;
Configure a controller collection problem on 30 seconds without a fresh &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt; item or persistent &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;. For example, use &amp;lt;code&amp;gt;nodata(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=1 or max(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=0&amp;lt;/code&amp;gt;. Alert on stale inventory over 15 minutes and on sustained eligible member count mismatch. Give per-drive availability triggers a dependency on the controller collection problem to avoid 13 duplicate events. Keep latency warning thresholds unset until normal ranges have been observed for the HDD and SSD workloads.&lt;br /&gt;
&lt;br /&gt;
=== Reverse lookup from a Linux logical volume ===&lt;br /&gt;
&lt;br /&gt;
Publish an &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; object in the slow inventory envelope. Build it from each drive&#039;s resolved &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array. Use the LV UUID as the dictionary key and store &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt;, sorted unique physical keys, direct VD IDs and a last-resolved timestamp. For example, the index entry for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt; should contain &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt; and all four &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; member WWNs. Resolve multiply mapped or stacked LVs before deduplicating. This permits a lookup by LV name in Latest data without tagging hundreds of physical metrics with that name.&lt;br /&gt;
&lt;br /&gt;
Add a second dependent discovery rule, &amp;lt;code&amp;gt;kitsnet.megaraid.lv.discovery&amp;lt;/code&amp;gt;, using the same inventory master. Apply the following JavaScript and &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Publish &amp;lt;code&amp;gt;lvm_complete=true&amp;lt;/code&amp;gt; only after the LVM map validates. An unavailable LVM scan should preserve the last known associations while physical-drive discovery continues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var inv = JSON.parse(value);&lt;br /&gt;
if (inv.schema !== 1 || inv.complete !== true || inv.lvm_complete !== true ||&lt;br /&gt;
        !inv.lvs || typeof inv.lvs !== &#039;object&#039; || Array.isArray(inv.lvs)) {&lt;br /&gt;
    throw &#039;Incomplete Linux LV index&#039;;&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(Object.keys(inv.lvs).sort().map(function (uuid) {&lt;br /&gt;
    var lv = inv.lvs[uuid];&lt;br /&gt;
    if (!/^[A-Za-z0-9-]+$/.test(uuid) || lv.uuid !== uuid || !lv.vg || !lv.name) {&lt;br /&gt;
        throw &#039;Invalid Linux LV identity&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    return {&#039;{#LVUUID}&#039;: uuid, &#039;{#VG}&#039;: lv.vg, &#039;{#LVNAME}&#039;: lv.name};&lt;br /&gt;
}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under this rule, create the dependent text item prototype &amp;lt;code&amp;gt;kitsnet.megaraid.lv.members[{#LVUUID}]&amp;lt;/code&amp;gt;, named &amp;lt;code&amp;gt;LV {#VG}/{#LVNAME} / physical drives&amp;lt;/code&amp;gt;. Its master is the inventory item. Use JSONPath &amp;lt;code&amp;gt;$.lvs[&#039;{#LVUUID}&#039;]&amp;lt;/code&amp;gt;, retain on change with a daily heartbeat, and tag the item with &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lv&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lv_uuid&amp;lt;/code&amp;gt;. The reverse index adds zero controller queries.&lt;br /&gt;
&lt;br /&gt;
=== History and sampling cost ===&lt;br /&gt;
&lt;br /&gt;
At 13 drives, six performance metrics produce 78 numeric items, 15.6 new performance values/s and 1,347,840 values/day. Status, metadata and collector health are additional. Proposed starting retention is 7d of numeric history and 365d of hourly trends, subject to the Zaya database policy. Seven days is about 9.4 million performance samples before database compression or housekeeping. Preserve full resolution only where it serves diagnosis. Use 0 history on both raw master items and omit trends for text. Confirm global housekeeping overrides and database growth on Zaya before expanding retention.&lt;br /&gt;
&lt;br /&gt;
== Per-drive graphs and single-screen dashboard ==&lt;br /&gt;
&lt;br /&gt;
Create graph prototypes inside the same discovery rule as the item prototypes. Use one graph per unit so latency remains legible during a high-throughput read. Include &amp;lt;code&amp;gt;{#BAY} {#DISPLAY} / {#PARENTS}&amp;lt;/code&amp;gt; in each graph name. Include &amp;lt;code&amp;gt;{#PDKEY}&amp;lt;/code&amp;gt; in the detailed graph name or description wherever the frontend supports it; the constituent item keys always carry it. Use a zero minimum and an automatic maximum. Read lines use blue (&amp;lt;code&amp;gt;2563EB&amp;lt;/code&amp;gt;) and write lines use orange (&amp;lt;code&amp;gt;D97706&amp;lt;/code&amp;gt;) throughout.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Graph prototype !! Item prototypes on left Y axis !! What to compare&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Operations&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || Read/write workload across mirrors or parity members.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Throughput&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || Transfer rate at the physical disk.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Response time&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || Drill into the drive whose response time increased.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Queue depth&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || Check for outstanding work at the same time.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Create the template dashboard &amp;lt;code&amp;gt;MegaRAID physical drives&amp;lt;/code&amp;gt;. Link the template to Wort once. Open the inherited dashboard from &#039;&#039;Monitoring → Hosts → Wort → Dashboards&#039;&#039;. Use the dashboard time picker (default last 15 minutes). Select the graph prototype object when configuring each graph widget. Selecting an individual discovered graph would pin the dashboard to a single physical disk.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dashboard page !! Native widgets and configuration !! Acceptance on Wort&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;All physical drives&#039;&#039;&#039; (default) || A compact header shows collector state and reported/expected counts. Below it, two &#039;&#039;Honeycomb&#039;&#039; widgets share the remaining viewport, one for response time and one for reporting status. Each uses the template host context, item pattern &amp;lt;code&amp;gt;PD *&amp;lt;/code&amp;gt;, item tag &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt; and exactly one &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag (&amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt;). Primary label uses &amp;lt;code&amp;gt;{ITEM.NAME}&amp;lt;/code&amp;gt;, secondary label uses the value. Use an explicit value map or labelled colors for availability. || All 13 drive cells in the status view and all 13 reporting latency cells in one 1920×1080 kiosk viewport at 100% zoom, without scrolling, paging or a hidden-cell ellipsis. Status remains visible if a latency value ages out.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOPS by drive&#039;&#039;&#039; || One full-width &#039;&#039;Graph prototype&#039;&#039; widget, source &#039;&#039;Graph prototype&#039;&#039;, select the Operations prototype, set 4 columns × 4 rows, dashboard time period, legend hidden for the overview. || Thirteen individually labelled mini-graphs on a single screen. Four members map to &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; and the cache SSD is labelled &amp;lt;code&amp;gt;CacheCade_0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Throughput by drive&#039;&#039;&#039;, &#039;&#039;&#039;Response time by drive&#039;&#039;&#039;, &#039;&#039;&#039;Queue depth by drive&#039;&#039;&#039; || Three additional pages with one full-width 4 × 4 graph-prototype widget each, selecting the respective prototype. Use matching order and time period. || Operators can compare siblings over the same time window or open the individual discovered graph at full size, with its legend.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Discovery populates both widget types automatically. The graph pages have 16 slots at the initial layout and Zabbix automatically pages the 17th graph. The default honeycombs reflow as the disk count grows; their capacity depends on widget dimensions and the frontend&#039;s 32-pixel minimum cell size. Validate that the overview fits the intended display after major expansion. Set a frontend refresh interval offered by 7.0, such as 10 seconds. The five-second agent sampling interval remains independent of browser refresh. For missing data, use the status panel and freshness trigger alongside the last displayed latency.&lt;br /&gt;
&lt;br /&gt;
== Construction, commissioning and recovery ==&lt;br /&gt;
&lt;br /&gt;
=== Build sequence ===&lt;br /&gt;
&lt;br /&gt;
# Package the collector, inventory worker, systemd service/timer and fixed Agent 2 include. Suggested names are &amp;lt;code&amp;gt;/usr/local/libexec/kitsnet-megaraid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.timer&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/zabbix/zabbix_agent2.d/kitsnet-megaraid.conf&amp;lt;/code&amp;gt;. Keep immutable code root-owned, cached inventory group-readable to &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; and mutable baseline files in a separate directory writable by the collector.&lt;br /&gt;
# Create the 7.0 template in the Zabbix frontend in the order master items, health items, discovery rule, item prototypes, graph prototypes, dashboard, triggers. Use the JavaScript and table settings above. Export the complete template as Zabbix 7.0 YAML, including the template dashboard and prototype references. Preserve export UUIDs when revising it. Import first on a test host or test server; review the import diff before linking production.&lt;br /&gt;
# Enable and inspect the inventory service. Confirm all 13 physical keys, six parent VDs and the LVM relationship for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. Compare physical identities with the acceptance table. Reconcile by WWN if firmware or local enumeration has changed.&lt;br /&gt;
# Record the initial DPM setting, enable collection as an administrator, then verify Agent 2 permissions using its service account. Keep DPM setters outside the polling key. Validate both text keys and their JSON, then enable the five-second master. Sample test commands are shown below; during construction provide a non-mutating test mode or a separate baseline directory for manual checks.&lt;br /&gt;
# Allow discovery and two contiguous valid samples. Open &#039;&#039;Monitoring → Latest data&#039;&#039;, filter the physical key or parent tag, inspect one disk&#039;s graph set, and verify the host dashboard at the intended display resolution. Record template revision, command versions, expected count, retention policy and operators&#039; acceptance in this page&#039;s revision history.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status kitsnet-megaraid-inventory.timer&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.inventory&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply hist &#039;-physdrv[21:14]&#039; -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acceptance tests ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Test !! Expected result&lt;br /&gt;
|-&lt;br /&gt;
| Inventory and LLD || Exactly 13 unique physical-key rows, 13 discovered metadata items, 78 performance items and 52 graphs (four per drive). Four HDD keys map to &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt;. One SSD maps to &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. The explicit WWN/serial pairs match the inventory.&lt;br /&gt;
|-&lt;br /&gt;
| Counters and units || For two samples from an active backup disk, recompute read IOPS and bytes/s from raw deltas and elapsed seconds. Compare with the stored item values within rounding. Include 4 KiB sectors in fixtures, plus FUA and flush activity. RA response time is in ms.&lt;br /&gt;
|-&lt;br /&gt;
| Automatic additions || In a fixture or test host add a 14th physical identity and a parent. One discovery cycle creates its metrics, tags and four graphs and adds it to the dashboard. Hardware changes on Wort are unnecessary for this test.&lt;br /&gt;
|-&lt;br /&gt;
| Move, swap and shared membership || Move one WWN to a new bay and change its DID: keys and history persist. Replace the disk in its old bay with a new WWN: new history starts after the new baseline. A drive with two parent VDs appears once with both parent IDs. A spare appears with its role and empty parent list.&lt;br /&gt;
|-&lt;br /&gt;
| Lost/stale inventory || Inject a bad JSON response, duplicate WWN, contradictory DID or incomplete VD membership. Last good inventory survives, affected data is withheld, and global discovery does not delete drives. LVM-only failure marks LVM coverage incomplete.&lt;br /&gt;
|-&lt;br /&gt;
| DPM OFF or reset || Retained CLI output produces an unavailable status and gaps. On re-enable, counter wrap or collector restart, the first valid sample seeds a fresh baseline; no spike is emitted.&lt;br /&gt;
|-&lt;br /&gt;
| Dashboard and delivery || At 1920×1080 all installed disks appear on the overview and IOPS graphs page. Check availability for an idle disk and a missing-report fixture. Confirm one Agent 2 fast request every five seconds and no per-drive shell executions for the WWN-equipped fleet.&lt;br /&gt;
|-&lt;br /&gt;
| Operational overhead || Across a representative backup window and a busy VM workload, record guarded collector elapsed/CPU time, missed five-second intervals, Zabbix queue delay, DB history growth, and host/application latency including p95/p99 where available. Compare DPM OFF, ON with no polling and ON at 5s. Investigate material workload changes before acceptance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting and rollback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;The modern StorCLI reports DPM unsupported.&#039;&#039;&#039; Check the executable path. The successful combination on Wort is legacy StorCLI with &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt;. Firmware updates are a separate maintenance decision.&lt;br /&gt;
* &#039;&#039;&#039;The CLI returns figures that no longer move.&#039;&#039;&#039; Check the DPM header, expected/reported count, inventory age and sample timestamp. Compare counter deltas on an active member. A successful exit alone is insufficient.&lt;br /&gt;
* &#039;&#039;&#039;A bay is associated with the wrong identity or volume.&#039;&#039;&#039; Inspect fresh PD/VD inventory and the two identity guards. Force an inventory refresh. Keep the affected disk unavailable until the join is unambiguous; historical records retain the old physical key.&lt;br /&gt;
* &#039;&#039;&#039;Rollback.&#039;&#039;&#039; Disable the two master items or unlink the template while retaining history according to site policy. Stop the proposed inventory timer and remove the Agent 2 include through the normal change process. Restore the recorded DPM state; if the original state was OFF, run &amp;lt;code&amp;gt;sudo -n /usr/local/sbin/storcli64 /c0 set dpm=off&amp;lt;/code&amp;gt; and verify &amp;lt;code&amp;gt;/c0 show dpm&amp;lt;/code&amp;gt;. Verify controller and VD health and continued SMART health monitoring. Review history retention before any “unlink and clear” operation.&lt;br /&gt;
&lt;br /&gt;
== Document control ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Revision !! Date !! Record&lt;br /&gt;
|-&lt;br /&gt;
| 0.1 || 27 November 2026 || Design for review. Live controller, inventory normalization and host polling measurements verified. Record the template export revision, production acceptance date and measured retention cost when the build is commissioned.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[KitsNet Operations:Monitoring:Zabbix]]&lt;br /&gt;
* [[KitsNet Operations:Services:Docker:High Availability NAS:Monitoring|KitsNet NAS HA Monitoring]] — local precedent for Agent 2 master items and Zabbix dependent items.&lt;br /&gt;
* [[KitsNet Operations:External Packages:Linux:MegaRAID Storage Manager]] — KitsNet&#039;s storage-management software notes.&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery Zabbix 7.0 low-level discovery] and [https://www.zabbix.com/documentation/7.0/en/manual/config/items/itemtypes/dependent_items dependent items].&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery/graph_prototypes Zabbix graph prototypes], [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/graph_prototype graph prototype widget] and [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/honeycomb honeycomb widget].&lt;br /&gt;
* [https://docs.broadcom.com/doc/pub-005681 Broadcom 12Gb/s MegaRAID SAS Software User Guide]. The command path and report behavior above were verified on the actual 9361-8i.&lt;br /&gt;
* Validation record, Wort, 27 November 2026: native &amp;lt;code&amp;gt;-DpmStat&amp;lt;/code&amp;gt; live captures, lookup of all PDs and VDs, five-second polling trials, off-state identity-guard timings and LVM inventory.&lt;br /&gt;
&lt;br /&gt;
[[Category:KitsNet Services]]&lt;br /&gt;
[[Category:Architecture]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2719</id>
		<title>KitsNet Operations:Monitoring:MegaRAID Physical Drive IO Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2719"/>
		<updated>2026-11-27T17:01:25Z</updated>

		<summary type="html">&lt;p&gt;Psmode: (username removed) (log details removed)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Design and implementation guide&#039;&#039;&#039; · Revision 0.1 · 27 November 2026 · Proposed for construction&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Page placement !! Service !! Target systems !! Validation state&lt;br /&gt;
|-&lt;br /&gt;
| Child of [[KitsNet Operations:Monitoring:Zabbix]] || Physical storage monitoring || &amp;lt;code&amp;gt;wort&amp;lt;/code&amp;gt; (Agent 2) and &amp;lt;code&amp;gt;zaya&amp;lt;/code&amp;gt; (Zabbix server and frontend) || Controller telemetry and discovery inputs verified. Template, collector service, graphs and dashboard are proposed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Purpose and operator view ==&lt;br /&gt;
&lt;br /&gt;
An operator investigating a slow virtual disk needs to identify the physical disk involved, find its bay and parent virtual drive, and compare it with its peers. The proposed design polls controller 0 every five seconds, discovers its physical disks automatically, creates a graph set for each disk and shows all current disks on one host dashboard. The primary index is the physical drive&#039;s worldwide name (WWN). A replacement in the same bay receives a new history. A drive moved to another bay on the same host retains its history.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; is MegaRAID virtual drive &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt;. One member is WD serial &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt;, WWN &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt;, enclosure 21, slot 14. The parent appears in Linux as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;. Its partition supplies VG &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt; and LV &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. The operator should be able to start with any of these identifiers and find the physical disk. The counters measure work at that disk. Attributing that work to an individual guest or Linux LV requires counters at the corresponding higher layer.&lt;br /&gt;
&lt;br /&gt;
== Verified platform and sampling budget ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Verified on 27 November 2026 !! Implementation consequence&lt;br /&gt;
|-&lt;br /&gt;
| Wort || Broadcom/Avago MegaRAID SAS 9361-8i, controller 0, firmware package &amp;lt;code&amp;gt;24.21.0-0132&amp;lt;/code&amp;gt;. Twelve SATA HDDs and one CacheCade SATA SSD. || Native per-drive counters are available on the installed firmware.&lt;br /&gt;
|-&lt;br /&gt;
| Legacy StorCLI || &amp;lt;code&amp;gt;/usr/local/sbin/storcli64&amp;lt;/code&amp;gt;, version 1.23.02. Its MegaCLI-compatible &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt; interface returned live data. || Pin this absolute path for DPM reads. The Zabbix service account successfully used non-interactive sudo for both reads with &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Inventory StorCLI || &amp;lt;code&amp;gt;/opt/MegaRAID/storcli/storcli64&amp;lt;/code&amp;gt;, version 007.2612. Its JSON reports include physical identities and explicit virtual-drive membership. Its DPM query returned “DPM Feature is not supported” even with the legacy DPM setting ON. || Use this binary for inventory. A generic controller capability flag is insufficient to confirm the DPM query path.&lt;br /&gt;
|-&lt;br /&gt;
| Monitoring || Agent 2 on Wort and server/frontend on Zaya run 7.0.32. Wort&#039;s active endpoint is &amp;lt;code&amp;gt;zabbix.lan.kitsnet.us&amp;lt;/code&amp;gt;. || Target Zabbix 7.0 templates, dependent discovery, graph prototypes and template dashboards.&lt;br /&gt;
|-&lt;br /&gt;
| Test state || DPM was restored to OFF. Disk reports can return retained values in this state. || A valid sample requires both reports to say &amp;lt;code&amp;gt;Performance Monitor: ON&amp;lt;/code&amp;gt;. Keep the existing SMART health checks.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The five-second test read &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; in sequence as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. All 12 polls returned all 13 drives. Each pair took 39–45 ms elapsed and averaged 37 ms of CPU time, equivalent to 0.74% of one core or about 0.05% of the 16-CPU host. The backup volume sustained 111.8 MiB/s, compared with 111.6 MiB/s during 15-second polling. Average read latency was 1.74 and 1.58 ms respectively. The short test establishes feasibility during the observed backup workload. Sustained application tail latency and database retention cost require commissioning measurements.&lt;br /&gt;
&lt;br /&gt;
The proposed collector also checks physical identities on either side of the two reads. Three four-command trials, with DPM OFF and retained reports, took 92–100 ms each including process startup. Budget and benchmark the complete collector with DPM ON during construction. The 37 ms CPU result covers the two live DPM reads only.&lt;br /&gt;
&lt;br /&gt;
== Collection and discovery architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort, five-second path                         Zaya, Zabbix 7.0&lt;br /&gt;
PDList → extended counters → running averages → PDList&lt;br /&gt;
    confirm identity, validate DPM, form intervals&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.dpm ───────→ dependent metric prototypes&lt;br /&gt;
                                                        │&lt;br /&gt;
Wort, five-minute inventory                             ├── per-drive graph prototypes&lt;br /&gt;
    StorCLI physical + virtual JSON, LVM reports        └── template dashboard on Wort&lt;br /&gt;
    validate and atomically publish inventory&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.inventory ─→ server-side LLD JavaScript&lt;br /&gt;
                                                └→ metadata and parent references&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only the two master items request data from Agent 2. Each DPM report covers all drives. The server or its assigned proxy runs low-level discovery (LLD), extracts values and instantiates prototypes. The slow inventory worker runs independently so an inventory scan cannot hold the five-second check open. One template link to the existing Wort host is sufficient.&lt;br /&gt;
&lt;br /&gt;
=== Controller commands and privilege boundary ===&lt;br /&gt;
&lt;br /&gt;
As an operator on Wort, enable DPM once at commissioning and verify the readback. Record the previous setting first. Monitoring reads have no reason to call the setter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 set dpm=on&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The steady five-second path uses these calls in order. &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt; suppresses the per-invocation CLI logfile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ext -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ra  -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inventory worker uses the following fixed read commands. Check the embedded &amp;lt;code&amp;gt;Command Status.Status&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Success&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Controller&amp;lt;/code&amp;gt; for 0 before using &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt;. Check the legacy reports for &amp;lt;code&amp;gt;Exit Code: 0x00&amp;lt;/code&amp;gt; as well as the process exit status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/eall/sall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/vall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0 show eventloginfo J&lt;br /&gt;
lsblk --json --paths --output NAME,KNAME,PKNAME,TYPE,MAJ:MIN,WWN&lt;br /&gt;
sudo -n /usr/sbin/pvs --segments --reportformat json -o pv_name,vg_name,lv_name,lv_uuid&lt;br /&gt;
sudo -n /usr/sbin/lvs -a --segments --reportformat json -o vg_name,lv_name,lv_uuid,lv_path,segtype,devices&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use fixed argument lists, a fixed locale, an execution deadline and root-owned executable paths. An inventory systemd service may run these read commands as root and publish a group-readable file for Agent 2. For the fast path, permit only the exact read commands needed by &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; if additional access is required. Revalidate under the running service&#039;s SELinux context during commissioning.&lt;br /&gt;
&lt;br /&gt;
== Drive identity and volume attribution ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Rule !! Use in Zabbix&lt;br /&gt;
|-&lt;br /&gt;
| Physical key || Normalize a valid 16-hex-digit ATA WWN to lowercase and prefix &amp;lt;code&amp;gt;w_&amp;lt;/code&amp;gt;. If a disk genuinely lacks a WWN, use &amp;lt;code&amp;gt;s_&amp;lt;/code&amp;gt; plus the SHA-256 digest of the trimmed model, a NUL byte and the trimmed serial. Reject placeholder or duplicate identities. || Immutable item-key argument on this host. Full WWN, serial and model remain searchable.&lt;br /&gt;
|-&lt;br /&gt;
| Controller address || Preserve controller number, enclosure, slot and DID as separate values. Join both DPM reports to a confirmed physical identity using all available address fields. || Bay, DID and parent names are labels. A moved disk can acquire new labels while keeping its item key.&lt;br /&gt;
|-&lt;br /&gt;
| Direct RAID parents || For every &amp;lt;code&amp;gt;/c0/vN&amp;lt;/code&amp;gt;, join its &amp;lt;code&amp;gt;PDs for VD N&amp;lt;/code&amp;gt; list to the physical inventory by enclosure:slot and DID. Check DG against the DG/VD record. Preserve every match and the OS drive name when present. || Display &amp;lt;code&amp;gt;c0/vN Name&amp;lt;/code&amp;gt;. A parent-ID tag uses delimited tokens, e.g. &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt;, for exact membership searches using “contains”.&lt;br /&gt;
|-&lt;br /&gt;
| CacheCade || The SSD is a direct member of &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. Cached VDs are consumers of that cache. || Show the cache VD as its parent. A consumer list, if displayed, is a separate relationship.&lt;br /&gt;
|-&lt;br /&gt;
| Spare, unconfigured or unreported disk || Keep each identifiable, inventory-visible disk in discovery. Allow an empty parent array for a spare/unassigned disk. Record the controller state and whether DPM reports a row. || Display the role and a data-availability status. A missing row is unknown. A reported zero is a valid value.&lt;br /&gt;
|-&lt;br /&gt;
| Linux LVM || Join each parent VD&#039;s OS disk to its partition/PV by Linux device identity. Collect the set of distinct LV UUIDs with extents on those PVs. || Keep the full PV/VG/LV list in a text item for the physical disk. Avoid truncating a large VG into a tag or graph title.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For LVM, resolve device aliases by major:minor, identify partition parents from &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and group &amp;lt;code&amp;gt;pvs&amp;lt;/code&amp;gt; rows by PV. Ignore free segments with empty LV names. For stacked LVs, resolve &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; segment dependencies recursively through component LVs to PVs, with a visited set. Retain direct and dependent roles in the metadata. Present an incomplete map as such if an unfamiliar segment type cannot be resolved. A Linux LV that spans RAID volumes can appear under multiple parents. Some parent VDs have no Linux LV. Linux names such as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; are current observations and can change on boot.&lt;br /&gt;
&lt;br /&gt;
=== Acceptance inventory from Wort ===&lt;br /&gt;
&lt;br /&gt;
The build must discover these records from the controller. This table is a point-in-time comparison for the first import. It must never become a configured list of devices.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Bay !! DID !! Physical WWN !! Serial !! Direct RAID parent !! Linux disk / VG&lt;br /&gt;
|-&lt;br /&gt;
| 21:13 || 17 || &amp;lt;code&amp;gt;5000c500ebb8561f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZDP9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:14 || 14 || &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:15 || 16 || &amp;lt;code&amp;gt;5001b448bc70bc7f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;214101A000F1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt; || Controller cache&lt;br /&gt;
|-&lt;br /&gt;
| 21:16 || 12 || &amp;lt;code&amp;gt;5000cca095c3d53a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8ED1R&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:17 || 20 || &amp;lt;code&amp;gt;5000c500e82d443a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0QHAB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:18 || 18 || &amp;lt;code&amp;gt;50014ee2bab34493&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K1JJ1DYX&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:19 || 15 || &amp;lt;code&amp;gt;50014ee216fddd9f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WX32D95FVCAC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:21 || 19 || &amp;lt;code&amp;gt;50014ee2100846f2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K3SJT2L8&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:22 || 27 || &amp;lt;code&amp;gt;5000cca095dbba95&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYZZKF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:16 || 25 || &amp;lt;code&amp;gt;5000cca095c3d2b9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8DRBR&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:17 || 24 || &amp;lt;code&amp;gt;5000c500ebb8d227&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZSRK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:18 || 23 || &amp;lt;code&amp;gt;5000c500e82d43dc&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0PZBD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:19 || 26 || &amp;lt;code&amp;gt;5000cca095dba2c3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYTMVF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Agent-side implementation specification ==&lt;br /&gt;
&lt;br /&gt;
=== Inventory and replacement handling ===&lt;br /&gt;
&lt;br /&gt;
# Run a boot-triggered and then five-minute inventory timer. Read the controller event-log sequence before and after both StorCLI inventory calls. When the sequence changes mid-scan, retry from the beginning with a bounded retry count. The verified JSON field is &amp;lt;code&amp;gt;Newest Sequence Number&amp;lt;/code&amp;gt;. Also record the reboot sequence.&lt;br /&gt;
# Require a complete, internally consistent PD/VD inventory. Compare the physical summary keys with detailed records, validate unique identities and locations, and verify the member references. Publish by atomic rename on the same filesystem to &amp;lt;code&amp;gt;/run/kitsnet-megaraid/inventory.json&amp;lt;/code&amp;gt;. Preserve the last good map on an error and expose the error and inventory age separately.&lt;br /&gt;
# On a five-second sample, read &amp;lt;code&amp;gt;-PDList&amp;lt;/code&amp;gt; before and after &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt;. Parse enclosure, slot, DID, WWN and drive sequence number. Compare the two observations and the cached identity. Quarantine changed, unknown or conflicting locations for that interval. Coalesce an inventory refresh request on an unknown or changed address. The periodic timer provides an independent retry.&lt;br /&gt;
# For a WWN-less drive, qualify a serial/model fallback using matching identity reads on both sides of the DPM sample (for SATA members, &amp;lt;code&amp;gt;smartctl -j -i -d megaraid,DID /dev/bus/0&amp;lt;/code&amp;gt;). Cache the durable identity at discovery. A transiently missing WWN on a previously identified disk is an identity conflict. Suppress that disk&#039;s sample until it is resolved. The fallback&#039;s extra cost belongs in commissioning.&lt;br /&gt;
# Invalidate counter baselines on controller or agent restarts, changes to the physical identity map, and DPM disable/enable events. Never give a newly arrived drive the previous occupant&#039;s last reading. Reconfiguration of logical drives can change parent labels by the next successful inventory refresh.&lt;br /&gt;
&lt;br /&gt;
=== Reference inventory normalizer ===&lt;br /&gt;
&lt;br /&gt;
The following Python 3.9 function is the RAID part of the inventory producer. Pass it the checked &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;/c0/eall/sall&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/c0/vall&amp;lt;/code&amp;gt;. It ran against Wort&#039;s reports and returned all 13 physical identities. The service wrapper adds capture time, LVM references, identity guard metadata and error reporting before publishing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import hashlib&lt;br /&gt;
import re&lt;br /&gt;
&lt;br /&gt;
def disk_key(wwn, model, serial):&lt;br /&gt;
    wwn = wwn.lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
    if re.fullmatch(r&amp;quot;[0-9a-f]{16}&amp;quot;, wwn) and wwn not in {&amp;quot;0&amp;quot; * 16, &amp;quot;f&amp;quot; * 16}:&lt;br /&gt;
        return &amp;quot;w_&amp;quot; + wwn&lt;br /&gt;
    if not model or not serial or serial.upper() in {&amp;quot;N/A&amp;quot;, &amp;quot;UNKNOWN&amp;quot;, &amp;quot;NONE&amp;quot;, &amp;quot;-&amp;quot;}:&lt;br /&gt;
        raise ValueError(&amp;quot;missing durable disk identity&amp;quot;)&lt;br /&gt;
    digest = hashlib.sha256((model + &amp;quot;\0&amp;quot; + serial).encode(&amp;quot;utf-8&amp;quot;)).hexdigest()&lt;br /&gt;
    return &amp;quot;s_&amp;quot; + digest&lt;br /&gt;
&lt;br /&gt;
def inventory(pd_report, vd_report, controller=&amp;quot;c0&amp;quot;):&lt;br /&gt;
    # Arguments are the checked Response Data objects for one controller.&lt;br /&gt;
    drives, by_location = {}, {}&lt;br /&gt;
    bays, dids, seen_paths = set(), set(), set()&lt;br /&gt;
    expected_paths = {k for k in pd_report if re.fullmatch(r&amp;quot;Drive /c\d+/e\d+/s\d+&amp;quot;, k)}&lt;br /&gt;
    for label, detail in pd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;Drive (/c\d+/e(\d+)/s(\d+)) - Detailed Information&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        path, eid, slot = match.groups()&lt;br /&gt;
        row = pd_report[&amp;quot;Drive &amp;quot; + path][0]&lt;br /&gt;
        attrs = detail[&amp;quot;Drive &amp;quot; + path + &amp;quot; Device attributes&amp;quot;]&lt;br /&gt;
        bay = eid + &amp;quot;:&amp;quot; + slot&lt;br /&gt;
        if path.split(&amp;quot;/&amp;quot;)[1] != controller or row[&amp;quot;EID:Slt&amp;quot;] != bay:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent controller or bay&amp;quot;)&lt;br /&gt;
        did = str(row[&amp;quot;DID&amp;quot;])&lt;br /&gt;
        model = attrs[&amp;quot;Model Number&amp;quot;].strip()&lt;br /&gt;
        serial = attrs[&amp;quot;SN&amp;quot;].strip()&lt;br /&gt;
        wwn = str(attrs.get(&amp;quot;WWN&amp;quot;, &amp;quot;&amp;quot;)).strip().lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
        key = disk_key(wwn, model, serial)&lt;br /&gt;
        loc = (bay, did)&lt;br /&gt;
        if key in drives or bay in bays or did in dids:&lt;br /&gt;
            raise ValueError(&amp;quot;duplicate disk identity or address&amp;quot;)&lt;br /&gt;
        bays.add(bay)&lt;br /&gt;
        dids.add(did)&lt;br /&gt;
        seen_paths.add(&amp;quot;Drive &amp;quot; + path)&lt;br /&gt;
        size = re.fullmatch(r&amp;quot;(\d+)\s*B&amp;quot;, attrs[&amp;quot;Logical Sector Size&amp;quot;].strip())&lt;br /&gt;
        if not size or int(size[1]) &amp;lt; 1:&lt;br /&gt;
            raise ValueError(&amp;quot;unknown logical sector size&amp;quot;)&lt;br /&gt;
        drives[key] = dict(id=key, wwn=wwn if key.startswith(&amp;quot;w_&amp;quot;) else &amp;quot;&amp;quot;,&lt;br /&gt;
                           serial=serial, model=model, controller=controller,&lt;br /&gt;
                           bay=bay, did=did, sector_bytes=int(size[1]),&lt;br /&gt;
                           dg=str(row[&amp;quot;DG&amp;quot;]), state=row[&amp;quot;State&amp;quot;], media=row[&amp;quot;Med&amp;quot;],&lt;br /&gt;
                           parents=[])&lt;br /&gt;
        by_location[loc] = key&lt;br /&gt;
&lt;br /&gt;
    for label, rows in vd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;/&amp;quot; + re.escape(controller) + r&amp;quot;/v(\d+)&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        vd = match[1]&lt;br /&gt;
        row = rows[0]&lt;br /&gt;
        dg, reported_vd = row[&amp;quot;DG/VD&amp;quot;].split(&amp;quot;/&amp;quot;)&lt;br /&gt;
        if vd != reported_vd:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent virtual drive identity&amp;quot;)&lt;br /&gt;
        parent = dict(id=controller + &amp;quot;/v&amp;quot; + vd, name=row[&amp;quot;Name&amp;quot;] or &amp;quot;VD&amp;quot; + vd,&lt;br /&gt;
                      raid=row[&amp;quot;TYPE&amp;quot;], os=vd_report[&amp;quot;VD&amp;quot; + vd + &amp;quot; Properties&amp;quot;]&lt;br /&gt;
                      .get(&amp;quot;OS Drive Name&amp;quot;, &amp;quot;N/A&amp;quot;))&lt;br /&gt;
        for member in vd_report[&amp;quot;PDs for VD &amp;quot; + vd]:&lt;br /&gt;
            loc = (member[&amp;quot;EID:Slt&amp;quot;], str(member[&amp;quot;DID&amp;quot;]))&lt;br /&gt;
            drive = drives[by_location[loc]]&lt;br /&gt;
            if drive[&amp;quot;dg&amp;quot;] != dg:&lt;br /&gt;
                raise ValueError(&amp;quot;membership changed during inventory&amp;quot;)&lt;br /&gt;
            if parent[&amp;quot;id&amp;quot;] not in [p[&amp;quot;id&amp;quot;] for p in drive[&amp;quot;parents&amp;quot;]]:&lt;br /&gt;
                drive[&amp;quot;parents&amp;quot;].append(parent)&lt;br /&gt;
&lt;br /&gt;
    for drive in drives.values():&lt;br /&gt;
        drive[&amp;quot;parents&amp;quot;].sort(key=lambda p: int(p[&amp;quot;id&amp;quot;].split(&amp;quot;/v&amp;quot;)[1]))&lt;br /&gt;
        if drive[&amp;quot;state&amp;quot;] == &amp;quot;Onln&amp;quot; and drive[&amp;quot;dg&amp;quot;].isdigit() and not drive[&amp;quot;parents&amp;quot;]:&lt;br /&gt;
            raise ValueError(&amp;quot;online member has no virtual-drive mapping&amp;quot;)&lt;br /&gt;
    if not drives or seen_paths != expected_paths:&lt;br /&gt;
        raise ValueError(&amp;quot;empty or incomplete controller inventory&amp;quot;)&lt;br /&gt;
    return dict(schema=1, complete=True, drives=drives)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Five-second sample and rate calculation ===&lt;br /&gt;
&lt;br /&gt;
Parse &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; by enclosure/slot/DID section. Its seven numeric columns, in order, are sectors read, sectors written, sectors written with Force Unit Access (FUA), read commands, write commands, write-FUA commands and flush commands. Parse each &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; row as enclosure, slot, DID, aggregate IOPS, queue depth, transfer rate (MB/s) and response time (ms). Validate field counts, numeric ranges and unique addresses in each report. The two reports are successive controller snapshots; their values can represent different averaging intervals.&lt;br /&gt;
&lt;br /&gt;
For each disk, keep the last accepted extended counters, current physical key, sequence, sector size and an acquisition timestamp from the host monotonic clock. Publish the counter baseline atomically, once per successful sample, under a nonblocking single-writer lock. Allow less than five seconds for all fast-path commands combined. On overlap, report a collection failure and preserve the baseline. Keep probes run manually for tests from modifying the production baseline.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
elapsed_seconds = current.monotonic_time - previous.monotonic_time&lt;br /&gt;
read_iops       = change(read_commands) / elapsed_seconds&lt;br /&gt;
write_iops      = change(write_commands) / elapsed_seconds&lt;br /&gt;
read_Bps        = change(read_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
write_Bps       = change(write_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
response_ms     = running_average.response_time_ms&lt;br /&gt;
queue_depth     = running_average.queue_depth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the logical sector size of the physical member. The 13 verified members report 512 bytes. Preserve the separate FUA and flush counters in the master record. Label the two write rates as the native &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt; column. Validate the firmware&#039;s treatment of FUA before adding it to a combined write total. Read/write IOPS and bytes/s are interval rates. Response time and queue depth are firmware running averages. Wort reports up to 100 commands for this average, so a lightly used disk can represent a different time window.&lt;br /&gt;
&lt;br /&gt;
An initial sample establishes a baseline. After a reboot, DPM transition, ambiguous identity, counter decrease/wrap, collector state loss, or interval longer than twice the configured poll period, clear the affected baseline and wait for two contiguous samples. Publish a gap for affected rates. On a failed command, DPM OFF, stale inventory beyond 15 minutes, or a missing disk row, record availability explicitly and omit invalid numbers. A genuine idle drive with unchanged, valid counters has zero rates. Retained data read while DPM is OFF is stale even when the CLI exits successfully.&lt;br /&gt;
&lt;br /&gt;
=== JSON contracts and Agent 2 keys ===&lt;br /&gt;
&lt;br /&gt;
The inventory envelope contains &amp;lt;code&amp;gt;schema&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;complete&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;collected_at&amp;lt;/code&amp;gt; (Unix seconds), &amp;lt;code&amp;gt;drives&amp;lt;/code&amp;gt; keyed by physical identity, and a separate LVM coverage status. Each drive adds an &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array with PV, VG, LV name, LV UUID and relation. An empty array with complete coverage means “no mapped LV”. The inventory reader indicates failure if the cache is stale or corrupt. The LLD rule below consumes only a complete RAID inventory. Failure to resolve LVM updates the LVM status independently.&lt;br /&gt;
&lt;br /&gt;
The example below shows one drive in a five-second master payload. The numbers illustrate the field types. In production &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt; counts eligible DPM members and &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt; counts validated members. Missing drives appear in &amp;lt;code&amp;gt;status_by_id&amp;lt;/code&amp;gt; even when their metric record is absent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;schema&amp;quot;: 1, &amp;quot;sampled_at&amp;quot;: 1795796160, &amp;quot;ok&amp;quot;: 1, &amp;quot;dpm_on&amp;quot;: 1,&lt;br /&gt;
  &amp;quot;expected&amp;quot;: 13, &amp;quot;reported&amp;quot;: 13, &amp;quot;poll_ms&amp;quot;: 96, &amp;quot;inventory_age_s&amp;quot;: 42,&lt;br /&gt;
  &amp;quot;status_by_id&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: 1},&lt;br /&gt;
  &amp;quot;drives&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: {&lt;br /&gt;
    &amp;quot;read_iops&amp;quot;: 62.2, &amp;quot;write_iops&amp;quot;: 0, &amp;quot;read_Bps&amp;quot;: 29320192,&lt;br /&gt;
    &amp;quot;write_Bps&amp;quot;: 0, &amp;quot;response_ms&amp;quot;: 1.613, &amp;quot;queue_depth&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_sectors&amp;quot;: 1336328, &amp;quot;write_sectors&amp;quot;: 0, &amp;quot;write_fua_sectors&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_ops&amp;quot;: 1399, &amp;quot;write_ops&amp;quot;: 0, &amp;quot;write_fua_ops&amp;quot;: 0, &amp;quot;flush_ops&amp;quot;: 0&lt;br /&gt;
  }}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use two fixed Agent 2 user parameters. The proposed helper runs as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. Its inventory mode reads the atomically published file, verifies freshness and outputs the envelope. Its sample mode performs the guarded DPM read. On DPM OFF return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on=0&amp;lt;/code&amp;gt; and no numeric disk data. When the DPM state itself cannot be read, omit &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt; and a short diagnostic. For known eligible disks, return availability 0 on a global failure. Emit only JSON on standard output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
UserParameter=kitsnet.megaraid.inventory,/usr/local/libexec/kitsnet-megaraid inventory&lt;br /&gt;
UserParameter=kitsnet.megaraid.dpm,/usr/local/libexec/kitsnet-megaraid sample&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zabbix server implementation ==&lt;br /&gt;
&lt;br /&gt;
Create template &amp;lt;code&amp;gt;KitsNet MegaRAID physical drives by agent 2&amp;lt;/code&amp;gt; in the same local template group as the existing KitsNet monitoring templates. Link it to the existing Wort host. Verify the Agent 2 active hostname matches that host&#039;s technical name. Keep all IDs, enclosure addresses and logical volume names out of template constants.&lt;br /&gt;
&lt;br /&gt;
=== Master items, discovery and life cycle ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Object !! Type / key !! Interval or master !! Information type and settings&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive inventory || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.inventory&amp;lt;/code&amp;gt; || 1m, cached inventory refreshed every 5m || Text. Master history 0; the discovery rule, LVM items and inventory health use the incoming value.&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive DPM sample || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.dpm&amp;lt;/code&amp;gt; || 5s || Text. Master history 0. The collector deadline must fit the agent/server item timeout. Expose a separate diagnostic text item if the master fails.&lt;br /&gt;
|-&lt;br /&gt;
| Discover MegaRAID physical drives || Dependent discovery rule / &amp;lt;code&amp;gt;kitsnet.megaraid.pd.discovery&amp;lt;/code&amp;gt; || Inventory master || JavaScript below, then &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Disable lost resources after 1h, delete after 30d, subject to KitsNet retention policy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A drive added just after an inventory scan should normally appear within about six minutes (five-minute scan plus one-minute master polling), plus server scheduling and agent active-check refresh where applicable. The new rates start on the next two valid samples. An inventory failure must fail discovery preprocessing; returning an empty successful list would mark every existing disk lost. Keep daily housekeeping and history-retention policies in mind when retiring disks.&lt;br /&gt;
&lt;br /&gt;
=== Server-side discovery code ===&lt;br /&gt;
&lt;br /&gt;
Paste this into the JavaScript preprocessing step of the dependent LLD rule. It runs in the Zabbix server or proxy preprocessing engine and returns a root array of native LLD macro objects. Sorting by physical key gives stable results for the heartbeat step. The code handles multiple RAID parents and unassigned members.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var root = JSON.parse(value);&lt;br /&gt;
if (root.schema !== 1 || root.complete !== true ||&lt;br /&gt;
        !root.drives || typeof root.drives !== &#039;object&#039; || Array.isArray(root.drives)) {&lt;br /&gt;
    throw &#039;Incomplete physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var ids = Object.keys(root.drives).sort();&lt;br /&gt;
if (!ids.length) {&lt;br /&gt;
    throw &#039;Empty physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var rows = [];&lt;br /&gt;
for (var i = 0; i &amp;lt; ids.length; i++) {&lt;br /&gt;
    var key = ids[i];&lt;br /&gt;
    var d = root.drives[key];&lt;br /&gt;
    if (!/^(w_[a-f0-9]{16}|s_[a-f0-9]{64})$/.test(key) ||&lt;br /&gt;
            d.id !== key || !d.controller || !d.bay || !Array.isArray(d.parents)) {&lt;br /&gt;
        throw &#039;Invalid physical-drive identity or mapping&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    var labels = [];&lt;br /&gt;
    var refs = [];&lt;br /&gt;
    for (var j = 0; j &amp;lt; d.parents.length; j++) {&lt;br /&gt;
        var parent = d.parents[j];&lt;br /&gt;
        if (!parent.id || !parent.name) {&lt;br /&gt;
            throw &#039;Incomplete virtual-drive reference&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        labels.push(parent.id + &#039; &#039; + parent.name);&lt;br /&gt;
        refs.push(parent.id);&lt;br /&gt;
    }&lt;br /&gt;
    rows.push({&lt;br /&gt;
        &#039;{#PDKEY}&#039;: key, &#039;{#WWN}&#039;: d.wwn, &#039;{#SERIAL}&#039;: d.serial,&lt;br /&gt;
        &#039;{#DISPLAY}&#039;: d.serial || d.wwn, &#039;{#MODEL}&#039;: d.model,&lt;br /&gt;
        &#039;{#CTRL}&#039;: d.controller, &#039;{#BAY}&#039;: d.bay, &#039;{#DID}&#039;: String(d.did),&lt;br /&gt;
        &#039;{#MEDIA}&#039;: d.media, &#039;{#DG}&#039;: d.dg,&lt;br /&gt;
        &#039;{#PARENTS}&#039;: labels.length ? labels.join(&#039;, &#039;) : &#039;Unassigned (&#039; + d.state + &#039;)&#039;,&lt;br /&gt;
        &#039;{#PARENTIDS}&#039;: refs.length ? &#039;|&#039; + refs.join(&#039;|&#039;) + &#039;|&#039; : &#039;|&#039;&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(rows);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Item prototypes and tags ===&lt;br /&gt;
&lt;br /&gt;
Create the following item prototypes under the discovery rule. All are &#039;&#039;Dependent item&#039;&#039;. Use key prefix &amp;lt;code&amp;gt;kitsnet.megaraid.pd.&amp;lt;/code&amp;gt; and append &amp;lt;code&amp;gt;[{#PDKEY}]&amp;lt;/code&amp;gt;. For example, the full read-IOPS key is &amp;lt;code&amp;gt;kitsnet.megaraid.pd.read_iops[{#PDKEY}]&amp;lt;/code&amp;gt;. A key&#039;s stable argument is the physical identity. Names and tags can change as discovery observes new locations and parent names.&lt;br /&gt;
&lt;br /&gt;
For a fast numeric item the extraction path is &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;].FIELD&amp;lt;/code&amp;gt;. Replace &amp;lt;code&amp;gt;FIELD&amp;lt;/code&amp;gt; with the field in the table. Set JSONPath &#039;&#039;Custom on fail → Discard value&#039;&#039; for missing metrics. Rate calculation already took place against the collector&#039;s monotonic clock. Applying &#039;&#039;Change per second&#039;&#039; again would differentiate a rate a second time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key suffix / field !! Source master and preprocessing !! Value type / unit !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ops/s&amp;lt;/code&amp;gt; || Two distinct items for read and write command rates.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;Bps&amp;lt;/code&amp;gt; || Two distinct items for read and write bytes per second.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; || Controller running-average response time.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), no unit || Controller running-average queue depth.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt; || DPM / &amp;lt;code&amp;gt;$.status_by_id[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Numeric (unsigned), value map 1 Reporting / 0 Unavailable || Keep missing, disabled or stale data distinct from an idle disk. Use discard unchanged with a 1m heartbeat after extracting the status.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;metadata&amp;lt;/code&amp;gt; || Inventory / &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Text, discard unchanged with a 1d heartbeat || Full identity, bay, model, serial, sector size, direct RAID parents, Linux mappings and their coverage.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Name a read-IOPS item &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Read IOPS&amp;lt;/code&amp;gt;. Use the corresponding metric label for the other prototypes. Apply the tags &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pd={#PDKEY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;serial={#SERIAL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wwn={#WWN}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;controller={#CTRL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bay={#BAY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parent_vd={#PARENTIDS}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;media={#MEDIA}&amp;lt;/code&amp;gt; and a fixed &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag for each type. Use &amp;lt;code&amp;gt;metric=response_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;metric=available&amp;lt;/code&amp;gt; exactly as specified for the dashboard. Search &amp;lt;code&amp;gt;parent_vd&amp;lt;/code&amp;gt; with &#039;&#039;Contains&#039;&#039; and the token &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt; to get all four backup members. For an unusually large parent list, keep the complete references in metadata and constrain the summary label/tag to Zabbix field limits.&lt;br /&gt;
&lt;br /&gt;
Create controller-level dependent items on the DPM master for &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;poll_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;inventory_age_s&amp;lt;/code&amp;gt;. Give these keys the prefix &amp;lt;code&amp;gt;kitsnet.megaraid.collector.&amp;lt;/code&amp;gt; and use &amp;lt;code&amp;gt;$.FIELD&amp;lt;/code&amp;gt;. Use numeric (unsigned) for status and counts, numeric (float) for durations; units &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; as applicable. Add a diagnostic string and slow inventory/LVM coverage health. A per-disk &amp;lt;code&amp;gt;available=0&amp;lt;/code&amp;gt; on a known spare can be expected; flag missing reports for eligible online members.&lt;br /&gt;
&lt;br /&gt;
Configure a controller collection problem on 30 seconds without a fresh &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt; item or persistent &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;. For example, use &amp;lt;code&amp;gt;nodata(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=1 or max(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=0&amp;lt;/code&amp;gt;. Alert on stale inventory over 15 minutes and on sustained eligible member count mismatch. Give per-drive availability triggers a dependency on the controller collection problem to avoid 13 duplicate events. Keep latency warning thresholds unset until normal ranges have been observed for the HDD and SSD workloads.&lt;br /&gt;
&lt;br /&gt;
=== Reverse lookup from a Linux logical volume ===&lt;br /&gt;
&lt;br /&gt;
Publish an &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; object in the slow inventory envelope. Build it from each drive&#039;s resolved &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array. Use the LV UUID as the dictionary key and store &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt;, sorted unique physical keys, direct VD IDs and a last-resolved timestamp. For example, the index entry for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt; should contain &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt; and all four &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; member WWNs. Resolve multiply mapped or stacked LVs before deduplicating. This permits a lookup by LV name in Latest data without tagging hundreds of physical metrics with that name.&lt;br /&gt;
&lt;br /&gt;
Add a second dependent discovery rule, &amp;lt;code&amp;gt;kitsnet.megaraid.lv.discovery&amp;lt;/code&amp;gt;, using the same inventory master. Apply the following JavaScript and &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Publish &amp;lt;code&amp;gt;lvm_complete=true&amp;lt;/code&amp;gt; only after the LVM map validates. An unavailable LVM scan should preserve the last known associations while physical-drive discovery continues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var inv = JSON.parse(value);&lt;br /&gt;
if (inv.schema !== 1 || inv.complete !== true || inv.lvm_complete !== true ||&lt;br /&gt;
        !inv.lvs || typeof inv.lvs !== &#039;object&#039; || Array.isArray(inv.lvs)) {&lt;br /&gt;
    throw &#039;Incomplete Linux LV index&#039;;&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(Object.keys(inv.lvs).sort().map(function (uuid) {&lt;br /&gt;
    var lv = inv.lvs[uuid];&lt;br /&gt;
    if (!/^[A-Za-z0-9-]+$/.test(uuid) || lv.uuid !== uuid || !lv.vg || !lv.name) {&lt;br /&gt;
        throw &#039;Invalid Linux LV identity&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    return {&#039;{#LVUUID}&#039;: uuid, &#039;{#VG}&#039;: lv.vg, &#039;{#LVNAME}&#039;: lv.name};&lt;br /&gt;
}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under this rule, create the dependent text item prototype &amp;lt;code&amp;gt;kitsnet.megaraid.lv.members[{#LVUUID}]&amp;lt;/code&amp;gt;, named &amp;lt;code&amp;gt;LV {#VG}/{#LVNAME} / physical drives&amp;lt;/code&amp;gt;. Its master is the inventory item. Use JSONPath &amp;lt;code&amp;gt;$.lvs[&#039;{#LVUUID}&#039;]&amp;lt;/code&amp;gt;, retain on change with a daily heartbeat, and tag the item with &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lv&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lv_uuid&amp;lt;/code&amp;gt;. The reverse index adds zero controller queries.&lt;br /&gt;
&lt;br /&gt;
=== History and sampling cost ===&lt;br /&gt;
&lt;br /&gt;
At 13 drives, six performance metrics produce 78 numeric items, 15.6 new performance values/s and 1,347,840 values/day. Status, metadata and collector health are additional. Proposed starting retention is 7d of numeric history and 365d of hourly trends, subject to the Zaya database policy. Seven days is about 9.4 million performance samples before database compression or housekeeping. Preserve full resolution only where it serves diagnosis. Use 0 history on both raw master items and omit trends for text. Confirm global housekeeping overrides and database growth on Zaya before expanding retention.&lt;br /&gt;
&lt;br /&gt;
== Per-drive graphs and single-screen dashboard ==&lt;br /&gt;
&lt;br /&gt;
Create graph prototypes inside the same discovery rule as the item prototypes. Use one graph per unit so latency remains legible during a high-throughput read. Include &amp;lt;code&amp;gt;{#BAY} {#DISPLAY} / {#PARENTS}&amp;lt;/code&amp;gt; in each graph name. Include &amp;lt;code&amp;gt;{#PDKEY}&amp;lt;/code&amp;gt; in the detailed graph name or description wherever the frontend supports it; the constituent item keys always carry it. Use a zero minimum and an automatic maximum. Read lines use blue (&amp;lt;code&amp;gt;2563EB&amp;lt;/code&amp;gt;) and write lines use orange (&amp;lt;code&amp;gt;D97706&amp;lt;/code&amp;gt;) throughout.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Graph prototype !! Item prototypes on left Y axis !! What to compare&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Operations&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || Read/write workload across mirrors or parity members.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Throughput&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || Transfer rate at the physical disk.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Response time&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || Drill into the drive whose response time increased.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Queue depth&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || Check for outstanding work at the same time.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Create the template dashboard &amp;lt;code&amp;gt;MegaRAID physical drives&amp;lt;/code&amp;gt;. Link the template to Wort once. Open the inherited dashboard from &#039;&#039;Monitoring → Hosts → Wort → Dashboards&#039;&#039;. Use the dashboard time picker (default last 15 minutes). Select the graph prototype object when configuring each graph widget. Selecting an individual discovered graph would pin the dashboard to a single physical disk.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dashboard page !! Native widgets and configuration !! Acceptance on Wort&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;All physical drives&#039;&#039;&#039; (default) || A compact header shows collector state and reported/expected counts. Below it, two &#039;&#039;Honeycomb&#039;&#039; widgets share the remaining viewport, one for response time and one for reporting status. Each uses the template host context, item pattern &amp;lt;code&amp;gt;PD *&amp;lt;/code&amp;gt;, item tag &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt; and exactly one &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag (&amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt;). Primary label uses &amp;lt;code&amp;gt;{ITEM.NAME}&amp;lt;/code&amp;gt;, secondary label uses the value. Use an explicit value map or labelled colors for availability. || All 13 drive cells in the status view and all 13 reporting latency cells in one 1920×1080 kiosk viewport at 100% zoom, without scrolling, paging or a hidden-cell ellipsis. Status remains visible if a latency value ages out.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOPS by drive&#039;&#039;&#039; || One full-width &#039;&#039;Graph prototype&#039;&#039; widget, source &#039;&#039;Graph prototype&#039;&#039;, select the Operations prototype, set 4 columns × 4 rows, dashboard time period, legend hidden for the overview. || Thirteen individually labelled mini-graphs on a single screen. Four members map to &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; and the cache SSD is labelled &amp;lt;code&amp;gt;CacheCade_0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Throughput by drive&#039;&#039;&#039;, &#039;&#039;&#039;Response time by drive&#039;&#039;&#039;, &#039;&#039;&#039;Queue depth by drive&#039;&#039;&#039; || Three additional pages with one full-width 4 × 4 graph-prototype widget each, selecting the respective prototype. Use matching order and time period. || Operators can compare siblings over the same time window or open the individual discovered graph at full size, with its legend.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Discovery populates both widget types automatically. The graph pages have 16 slots at the initial layout and Zabbix automatically pages the 17th graph. The default honeycombs reflow as the disk count grows; their capacity depends on widget dimensions and the frontend&#039;s 32-pixel minimum cell size. Validate that the overview fits the intended display after major expansion. Set a frontend refresh interval offered by 7.0, such as 10 seconds. The five-second agent sampling interval remains independent of browser refresh. For missing data, use the status panel and freshness trigger alongside the last displayed latency.&lt;br /&gt;
&lt;br /&gt;
== Construction, commissioning and recovery ==&lt;br /&gt;
&lt;br /&gt;
=== Build sequence ===&lt;br /&gt;
&lt;br /&gt;
# Package the collector, inventory worker, systemd service/timer and fixed Agent 2 include. Suggested names are &amp;lt;code&amp;gt;/usr/local/libexec/kitsnet-megaraid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.timer&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/zabbix/zabbix_agent2.d/kitsnet-megaraid.conf&amp;lt;/code&amp;gt;. Keep immutable code root-owned, cached inventory group-readable to &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; and mutable baseline files in a separate directory writable by the collector.&lt;br /&gt;
# Create the 7.0 template in the Zabbix frontend in the order master items, health items, discovery rule, item prototypes, graph prototypes, dashboard, triggers. Use the JavaScript and table settings above. Export the complete template as Zabbix 7.0 YAML, including the template dashboard and prototype references. Preserve export UUIDs when revising it. Import first on a test host or test server; review the import diff before linking production.&lt;br /&gt;
# Enable and inspect the inventory service. Confirm all 13 physical keys, six parent VDs and the LVM relationship for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. Compare physical identities with the acceptance table. Reconcile by WWN if firmware or local enumeration has changed.&lt;br /&gt;
# Record the initial DPM setting, enable collection as an administrator, then verify Agent 2 permissions using its service account. Keep DPM setters outside the polling key. Validate both text keys and their JSON, then enable the five-second master. Sample test commands are shown below; during construction provide a non-mutating test mode or a separate baseline directory for manual checks.&lt;br /&gt;
# Allow discovery and two contiguous valid samples. Open &#039;&#039;Monitoring → Latest data&#039;&#039;, filter the physical key or parent tag, inspect one disk&#039;s graph set, and verify the host dashboard at the intended display resolution. Record template revision, command versions, expected count, retention policy and operators&#039; acceptance in this page&#039;s revision history.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status kitsnet-megaraid-inventory.timer&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.inventory&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply hist &#039;-physdrv[21:14]&#039; -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acceptance tests ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Test !! Expected result&lt;br /&gt;
|-&lt;br /&gt;
| Inventory and LLD || Exactly 13 unique physical-key rows, 13 discovered metadata items, 78 performance items and 52 graphs (four per drive). Four HDD keys map to &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt;. One SSD maps to &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. The explicit WWN/serial pairs match the inventory.&lt;br /&gt;
|-&lt;br /&gt;
| Counters and units || For two samples from an active backup disk, recompute read IOPS and bytes/s from raw deltas and elapsed seconds. Compare with the stored item values within rounding. Include 4 KiB sectors in fixtures, plus FUA and flush activity. RA response time is in ms.&lt;br /&gt;
|-&lt;br /&gt;
| Automatic additions || In a fixture or test host add a 14th physical identity and a parent. One discovery cycle creates its metrics, tags and four graphs and adds it to the dashboard. Hardware changes on Wort are unnecessary for this test.&lt;br /&gt;
|-&lt;br /&gt;
| Move, swap and shared membership || Move one WWN to a new bay and change its DID: keys and history persist. Replace the disk in its old bay with a new WWN: new history starts after the new baseline. A drive with two parent VDs appears once with both parent IDs. A spare appears with its role and empty parent list.&lt;br /&gt;
|-&lt;br /&gt;
| Lost/stale inventory || Inject a bad JSON response, duplicate WWN, contradictory DID or incomplete VD membership. Last good inventory survives, affected data is withheld, and global discovery does not delete drives. LVM-only failure marks LVM coverage incomplete.&lt;br /&gt;
|-&lt;br /&gt;
| DPM OFF or reset || Retained CLI output produces an unavailable status and gaps. On re-enable, counter wrap or collector restart, the first valid sample seeds a fresh baseline; no spike is emitted.&lt;br /&gt;
|-&lt;br /&gt;
| Dashboard and delivery || At 1920×1080 all installed disks appear on the overview and IOPS graphs page. Check availability for an idle disk and a missing-report fixture. Confirm one Agent 2 fast request every five seconds and no per-drive shell executions for the WWN-equipped fleet.&lt;br /&gt;
|-&lt;br /&gt;
| Operational overhead || Across a representative backup window and a busy VM workload, record guarded collector elapsed/CPU time, missed five-second intervals, Zabbix queue delay, DB history growth, and host/application latency including p95/p99 where available. Compare DPM OFF, ON with no polling and ON at 5s. Investigate material workload changes before acceptance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting and rollback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;The modern StorCLI reports DPM unsupported.&#039;&#039;&#039; Check the executable path. The successful combination on Wort is legacy StorCLI with &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt;. Firmware updates are a separate maintenance decision.&lt;br /&gt;
* &#039;&#039;&#039;The CLI returns figures that no longer move.&#039;&#039;&#039; Check the DPM header, expected/reported count, inventory age and sample timestamp. Compare counter deltas on an active member. A successful exit alone is insufficient.&lt;br /&gt;
* &#039;&#039;&#039;A bay is associated with the wrong identity or volume.&#039;&#039;&#039; Inspect fresh PD/VD inventory and the two identity guards. Force an inventory refresh. Keep the affected disk unavailable until the join is unambiguous; historical records retain the old physical key.&lt;br /&gt;
* &#039;&#039;&#039;Rollback.&#039;&#039;&#039; Disable the two master items or unlink the template while retaining history according to site policy. Stop the proposed inventory timer and remove the Agent 2 include through the normal change process. Restore the recorded DPM state; if the original state was OFF, run &amp;lt;code&amp;gt;sudo -n /usr/local/sbin/storcli64 /c0 set dpm=off&amp;lt;/code&amp;gt; and verify &amp;lt;code&amp;gt;/c0 show dpm&amp;lt;/code&amp;gt;. Verify controller and VD health and continued SMART health monitoring. Review history retention before any “unlink and clear” operation.&lt;br /&gt;
&lt;br /&gt;
== Document control ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Revision !! Date !! Record&lt;br /&gt;
|-&lt;br /&gt;
| 0.1 || 27 November 2026 || Design for review. Live controller, inventory normalization and host polling measurements verified. Record the template export revision, production acceptance date and measured retention cost when the build is commissioned.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[KitsNet Operations:Monitoring:Zabbix]]&lt;br /&gt;
* [[KitsNet Operations:Services:Docker:High Availability NAS:Monitoring|KitsNet NAS HA Monitoring]] — local precedent for Agent 2 master items and Zabbix dependent items.&lt;br /&gt;
* [[KitsNet Operations:External Packages:Linux:MegaRAID Storage Manager]] — KitsNet&#039;s storage-management software notes.&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery Zabbix 7.0 low-level discovery] and [https://www.zabbix.com/documentation/7.0/en/manual/config/items/itemtypes/dependent_items dependent items].&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery/graph_prototypes Zabbix graph prototypes], [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/graph_prototype graph prototype widget] and [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/honeycomb honeycomb widget].&lt;br /&gt;
* [https://docs.broadcom.com/doc/pub-005681 Broadcom 12Gb/s MegaRAID SAS Software User Guide]. The command path and report behavior above were verified on the actual 9361-8i.&lt;br /&gt;
* Validation record, Wort, 27 November 2026: native &amp;lt;code&amp;gt;-DpmStat&amp;lt;/code&amp;gt; live captures, lookup of all PDs and VDs, five-second polling trials, off-state identity-guard timings and LVM inventory.&lt;br /&gt;
&lt;br /&gt;
[[Category:KitsNet Services]]&lt;br /&gt;
[[Category:Architecture]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2718</id>
		<title>KitsNet Operations:Monitoring:MegaRAID Physical Drive IO Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2718"/>
		<updated>2026-11-27T16:59:59Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Design and implementation guide&#039;&#039;&#039; · Revision 0.1 · 27 November 2026 · Proposed for construction&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Page placement !! Service !! Target systems !! Validation state&lt;br /&gt;
|-&lt;br /&gt;
| Child of [[KitsNet Operations:Monitoring:Zabbix]] || Physical storage monitoring || &amp;lt;code&amp;gt;wort&amp;lt;/code&amp;gt; (Agent 2) and &amp;lt;code&amp;gt;zaya&amp;lt;/code&amp;gt; (Zabbix server and frontend) || Controller telemetry and discovery inputs verified. Template, collector service, graphs and dashboard are proposed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Purpose and operator view ==&lt;br /&gt;
&lt;br /&gt;
An operator investigating a slow virtual disk needs to identify the physical disk involved, find its bay and parent virtual drive, and compare it with its peers. The proposed design polls controller 0 every five seconds, discovers its physical disks automatically, creates a graph set for each disk and shows all current disks on one host dashboard. The primary index is the physical drive&#039;s worldwide name (WWN). A replacement in the same bay receives a new history. A drive moved to another bay on the same host retains its history.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; is MegaRAID virtual drive &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt;. One member is WD serial &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt;, WWN &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt;, enclosure 21, slot 14. The parent appears in Linux as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;. Its partition supplies VG &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt; and LV &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. The operator should be able to start with any of these identifiers and find the physical disk. The counters measure work at that disk. Attributing that work to an individual guest or Linux LV requires counters at the corresponding higher layer.&lt;br /&gt;
&lt;br /&gt;
== Verified platform and sampling budget ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Verified on 27 November 2026 !! Implementation consequence&lt;br /&gt;
|-&lt;br /&gt;
| Wort || Broadcom/Avago MegaRAID SAS 9361-8i, controller 0, firmware package &amp;lt;code&amp;gt;24.21.0-0132&amp;lt;/code&amp;gt;. Twelve SATA HDDs and one CacheCade SATA SSD. || Native per-drive counters are available on the installed firmware.&lt;br /&gt;
|-&lt;br /&gt;
| Legacy StorCLI || &amp;lt;code&amp;gt;/usr/local/sbin/storcli64&amp;lt;/code&amp;gt;, version 1.23.02. Its MegaCLI-compatible &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt; interface returned live data. || Pin this absolute path for DPM reads. The Zabbix service account successfully used non-interactive sudo for both reads with &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Inventory StorCLI || &amp;lt;code&amp;gt;/opt/MegaRAID/storcli/storcli64&amp;lt;/code&amp;gt;, version 007.2612. Its JSON reports include physical identities and explicit virtual-drive membership. Its DPM query returned “DPM Feature is not supported” even with the legacy DPM setting ON. || Use this binary for inventory. A generic controller capability flag is insufficient to confirm the DPM query path.&lt;br /&gt;
|-&lt;br /&gt;
| Monitoring || Agent 2 on Wort and server/frontend on Zaya run 7.0.32. Wort&#039;s active endpoint is &amp;lt;code&amp;gt;zabbix.lan.kitsnet.us&amp;lt;/code&amp;gt;. || Target Zabbix 7.0 templates, dependent discovery, graph prototypes and template dashboards.&lt;br /&gt;
|-&lt;br /&gt;
| Test state || DPM was restored to OFF. Disk reports can return retained values in this state. || A valid sample requires both reports to say &amp;lt;code&amp;gt;Performance Monitor: ON&amp;lt;/code&amp;gt;. Keep the existing SMART health checks.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The five-second test read &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; in sequence as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. All 12 polls returned all 13 drives. Each pair took 39–45 ms elapsed and averaged 37 ms of CPU time, equivalent to 0.74% of one core or about 0.05% of the 16-CPU host. The backup volume sustained 111.8 MiB/s, compared with 111.6 MiB/s during 15-second polling. Average read latency was 1.74 and 1.58 ms respectively. The short test establishes feasibility during the observed backup workload. Sustained application tail latency and database retention cost require commissioning measurements.&lt;br /&gt;
&lt;br /&gt;
The proposed collector also checks physical identities on either side of the two reads. Three four-command trials, with DPM OFF and retained reports, took 92–100 ms each including process startup. Budget and benchmark the complete collector with DPM ON during construction. The 37 ms CPU result covers the two live DPM reads only.&lt;br /&gt;
&lt;br /&gt;
== Collection and discovery architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort, five-second path                         Zaya, Zabbix 7.0&lt;br /&gt;
PDList → extended counters → running averages → PDList&lt;br /&gt;
    confirm identity, validate DPM, form intervals&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.dpm ───────→ dependent metric prototypes&lt;br /&gt;
                                                        │&lt;br /&gt;
Wort, five-minute inventory                             ├── per-drive graph prototypes&lt;br /&gt;
    StorCLI physical + virtual JSON, LVM reports        └── template dashboard on Wort&lt;br /&gt;
    validate and atomically publish inventory&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.inventory ─→ server-side LLD JavaScript&lt;br /&gt;
                                                └→ metadata and parent references&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only the two master items request data from Agent 2. Each DPM report covers all drives. The server or its assigned proxy runs low-level discovery (LLD), extracts values and instantiates prototypes. The slow inventory worker runs independently so an inventory scan cannot hold the five-second check open. One template link to the existing Wort host is sufficient.&lt;br /&gt;
&lt;br /&gt;
=== Controller commands and privilege boundary ===&lt;br /&gt;
&lt;br /&gt;
As an operator on Wort, enable DPM once at commissioning and verify the readback. Record the previous setting first. Monitoring reads have no reason to call the setter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 set dpm=on&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The steady five-second path uses these calls in order. &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt; suppresses the per-invocation CLI logfile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ext -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ra  -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inventory worker uses the following fixed read commands. Check the embedded &amp;lt;code&amp;gt;Command Status.Status&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Success&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Controller&amp;lt;/code&amp;gt; for 0 before using &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt;. Check the legacy reports for &amp;lt;code&amp;gt;Exit Code: 0x00&amp;lt;/code&amp;gt; as well as the process exit status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/eall/sall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/vall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0 show eventloginfo J&lt;br /&gt;
lsblk --json --paths --output NAME,KNAME,PKNAME,TYPE,MAJ:MIN,WWN&lt;br /&gt;
sudo -n /usr/sbin/pvs --segments --reportformat json -o pv_name,vg_name,lv_name,lv_uuid&lt;br /&gt;
sudo -n /usr/sbin/lvs -a --segments --reportformat json -o vg_name,lv_name,lv_uuid,lv_path,segtype,devices&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use fixed argument lists, a fixed locale, an execution deadline and root-owned executable paths. An inventory systemd service may run these read commands as root and publish a group-readable file for Agent 2. For the fast path, permit only the exact read commands needed by &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; if additional access is required. Revalidate under the running service&#039;s SELinux context during commissioning.&lt;br /&gt;
&lt;br /&gt;
== Drive identity and volume attribution ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Rule !! Use in Zabbix&lt;br /&gt;
|-&lt;br /&gt;
| Physical key || Normalize a valid 16-hex-digit ATA WWN to lowercase and prefix &amp;lt;code&amp;gt;w_&amp;lt;/code&amp;gt;. If a disk genuinely lacks a WWN, use &amp;lt;code&amp;gt;s_&amp;lt;/code&amp;gt; plus the SHA-256 digest of the trimmed model, a NUL byte and the trimmed serial. Reject placeholder or duplicate identities. || Immutable item-key argument on this host. Full WWN, serial and model remain searchable.&lt;br /&gt;
|-&lt;br /&gt;
| Controller address || Preserve controller number, enclosure, slot and DID as separate values. Join both DPM reports to a confirmed physical identity using all available address fields. || Bay, DID and parent names are labels. A moved disk can acquire new labels while keeping its item key.&lt;br /&gt;
|-&lt;br /&gt;
| Direct RAID parents || For every &amp;lt;code&amp;gt;/c0/vN&amp;lt;/code&amp;gt;, join its &amp;lt;code&amp;gt;PDs for VD N&amp;lt;/code&amp;gt; list to the physical inventory by enclosure:slot and DID. Check DG against the DG/VD record. Preserve every match and the OS drive name when present. || Display &amp;lt;code&amp;gt;c0/vN Name&amp;lt;/code&amp;gt;. A parent-ID tag uses delimited tokens, e.g. &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt;, for exact membership searches using “contains”.&lt;br /&gt;
|-&lt;br /&gt;
| CacheCade || The SSD is a direct member of &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. Cached VDs are consumers of that cache. || Show the cache VD as its parent. A consumer list, if displayed, is a separate relationship.&lt;br /&gt;
|-&lt;br /&gt;
| Spare, unconfigured or unreported disk || Keep each identifiable, inventory-visible disk in discovery. Allow an empty parent array for a spare/unassigned disk. Record the controller state and whether DPM reports a row. || Display the role and a data-availability status. A missing row is unknown. A reported zero is a valid value.&lt;br /&gt;
|-&lt;br /&gt;
| Linux LVM || Join each parent VD&#039;s OS disk to its partition/PV by Linux device identity. Collect the set of distinct LV UUIDs with extents on those PVs. || Keep the full PV/VG/LV list in a text item for the physical disk. Avoid truncating a large VG into a tag or graph title.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For LVM, resolve device aliases by major:minor, identify partition parents from &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and group &amp;lt;code&amp;gt;pvs&amp;lt;/code&amp;gt; rows by PV. Ignore free segments with empty LV names. For stacked LVs, resolve &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; segment dependencies recursively through component LVs to PVs, with a visited set. Retain direct and dependent roles in the metadata. Present an incomplete map as such if an unfamiliar segment type cannot be resolved. A Linux LV that spans RAID volumes can appear under multiple parents. Some parent VDs have no Linux LV. Linux names such as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; are current observations and can change on boot.&lt;br /&gt;
&lt;br /&gt;
=== Acceptance inventory from Wort ===&lt;br /&gt;
&lt;br /&gt;
The build must discover these records from the controller. This table is a point-in-time comparison for the first import. It must never become a configured list of devices.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Bay !! DID !! Physical WWN !! Serial !! Direct RAID parent !! Linux disk / VG&lt;br /&gt;
|-&lt;br /&gt;
| 21:13 || 17 || &amp;lt;code&amp;gt;5000c500ebb8561f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZDP9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:14 || 14 || &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:15 || 16 || &amp;lt;code&amp;gt;5001b448bc70bc7f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;214101A000F1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt; || Controller cache&lt;br /&gt;
|-&lt;br /&gt;
| 21:16 || 12 || &amp;lt;code&amp;gt;5000cca095c3d53a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8ED1R&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:17 || 20 || &amp;lt;code&amp;gt;5000c500e82d443a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0QHAB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:18 || 18 || &amp;lt;code&amp;gt;50014ee2bab34493&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K1JJ1DYX&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:19 || 15 || &amp;lt;code&amp;gt;50014ee216fddd9f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WX32D95FVCAC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:21 || 19 || &amp;lt;code&amp;gt;50014ee2100846f2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K3SJT2L8&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:22 || 27 || &amp;lt;code&amp;gt;5000cca095dbba95&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYZZKF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:16 || 25 || &amp;lt;code&amp;gt;5000cca095c3d2b9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8DRBR&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:17 || 24 || &amp;lt;code&amp;gt;5000c500ebb8d227&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZSRK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:18 || 23 || &amp;lt;code&amp;gt;5000c500e82d43dc&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0PZBD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:19 || 26 || &amp;lt;code&amp;gt;5000cca095dba2c3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYTMVF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Agent-side implementation specification ==&lt;br /&gt;
&lt;br /&gt;
=== Inventory and replacement handling ===&lt;br /&gt;
&lt;br /&gt;
# Run a boot-triggered and then five-minute inventory timer. Read the controller event-log sequence before and after both StorCLI inventory calls. When the sequence changes mid-scan, retry from the beginning with a bounded retry count. The verified JSON field is &amp;lt;code&amp;gt;Newest Sequence Number&amp;lt;/code&amp;gt;. Also record the reboot sequence.&lt;br /&gt;
# Require a complete, internally consistent PD/VD inventory. Compare the physical summary keys with detailed records, validate unique identities and locations, and verify the member references. Publish by atomic rename on the same filesystem to &amp;lt;code&amp;gt;/run/kitsnet-megaraid/inventory.json&amp;lt;/code&amp;gt;. Preserve the last good map on an error and expose the error and inventory age separately.&lt;br /&gt;
# On a five-second sample, read &amp;lt;code&amp;gt;-PDList&amp;lt;/code&amp;gt; before and after &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt;. Parse enclosure, slot, DID, WWN and drive sequence number. Compare the two observations and the cached identity. Quarantine changed, unknown or conflicting locations for that interval. Coalesce an inventory refresh request on an unknown or changed address. The periodic timer provides an independent retry.&lt;br /&gt;
# For a WWN-less drive, qualify a serial/model fallback using matching identity reads on both sides of the DPM sample (for SATA members, &amp;lt;code&amp;gt;smartctl -j -i -d megaraid,DID /dev/bus/0&amp;lt;/code&amp;gt;). Cache the durable identity at discovery. A transiently missing WWN on a previously identified disk is an identity conflict. Suppress that disk&#039;s sample until it is resolved. The fallback&#039;s extra cost belongs in commissioning.&lt;br /&gt;
# Invalidate counter baselines on controller or agent restarts, changes to the physical identity map, and DPM disable/enable events. Never give a newly arrived drive the previous occupant&#039;s last reading. Reconfiguration of logical drives can change parent labels by the next successful inventory refresh.&lt;br /&gt;
&lt;br /&gt;
=== Reference inventory normalizer ===&lt;br /&gt;
&lt;br /&gt;
The following Python 3.9 function is the RAID part of the inventory producer. Pass it the checked &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;/c0/eall/sall&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/c0/vall&amp;lt;/code&amp;gt;. It ran against Wort&#039;s reports and returned all 13 physical identities. The service wrapper adds capture time, LVM references, identity guard metadata and error reporting before publishing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import hashlib&lt;br /&gt;
import re&lt;br /&gt;
&lt;br /&gt;
def disk_key(wwn, model, serial):&lt;br /&gt;
    wwn = wwn.lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
    if re.fullmatch(r&amp;quot;[0-9a-f]{16}&amp;quot;, wwn) and wwn not in {&amp;quot;0&amp;quot; * 16, &amp;quot;f&amp;quot; * 16}:&lt;br /&gt;
        return &amp;quot;w_&amp;quot; + wwn&lt;br /&gt;
    if not model or not serial or serial.upper() in {&amp;quot;N/A&amp;quot;, &amp;quot;UNKNOWN&amp;quot;, &amp;quot;NONE&amp;quot;, &amp;quot;-&amp;quot;}:&lt;br /&gt;
        raise ValueError(&amp;quot;missing durable disk identity&amp;quot;)&lt;br /&gt;
    digest = hashlib.sha256((model + &amp;quot;\0&amp;quot; + serial).encode(&amp;quot;utf-8&amp;quot;)).hexdigest()&lt;br /&gt;
    return &amp;quot;s_&amp;quot; + digest&lt;br /&gt;
&lt;br /&gt;
def inventory(pd_report, vd_report, controller=&amp;quot;c0&amp;quot;):&lt;br /&gt;
    # Arguments are the checked Response Data objects for one controller.&lt;br /&gt;
    drives, by_location = {}, {}&lt;br /&gt;
    bays, dids, seen_paths = set(), set(), set()&lt;br /&gt;
    expected_paths = {k for k in pd_report if re.fullmatch(r&amp;quot;Drive /c\d+/e\d+/s\d+&amp;quot;, k)}&lt;br /&gt;
    for label, detail in pd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;Drive (/c\d+/e(\d+)/s(\d+)) - Detailed Information&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        path, eid, slot = match.groups()&lt;br /&gt;
        row = pd_report[&amp;quot;Drive &amp;quot; + path][0]&lt;br /&gt;
        attrs = detail[&amp;quot;Drive &amp;quot; + path + &amp;quot; Device attributes&amp;quot;]&lt;br /&gt;
        bay = eid + &amp;quot;:&amp;quot; + slot&lt;br /&gt;
        if path.split(&amp;quot;/&amp;quot;)[1] != controller or row[&amp;quot;EID:Slt&amp;quot;] != bay:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent controller or bay&amp;quot;)&lt;br /&gt;
        did = str(row[&amp;quot;DID&amp;quot;])&lt;br /&gt;
        model = attrs[&amp;quot;Model Number&amp;quot;].strip()&lt;br /&gt;
        serial = attrs[&amp;quot;SN&amp;quot;].strip()&lt;br /&gt;
        wwn = str(attrs.get(&amp;quot;WWN&amp;quot;, &amp;quot;&amp;quot;)).strip().lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
        key = disk_key(wwn, model, serial)&lt;br /&gt;
        loc = (bay, did)&lt;br /&gt;
        if key in drives or bay in bays or did in dids:&lt;br /&gt;
            raise ValueError(&amp;quot;duplicate disk identity or address&amp;quot;)&lt;br /&gt;
        bays.add(bay)&lt;br /&gt;
        dids.add(did)&lt;br /&gt;
        seen_paths.add(&amp;quot;Drive &amp;quot; + path)&lt;br /&gt;
        size = re.fullmatch(r&amp;quot;(\d+)\s*B&amp;quot;, attrs[&amp;quot;Logical Sector Size&amp;quot;].strip())&lt;br /&gt;
        if not size or int(size[1]) &amp;lt; 1:&lt;br /&gt;
            raise ValueError(&amp;quot;unknown logical sector size&amp;quot;)&lt;br /&gt;
        drives[key] = dict(id=key, wwn=wwn if key.startswith(&amp;quot;w_&amp;quot;) else &amp;quot;&amp;quot;,&lt;br /&gt;
                           serial=serial, model=model, controller=controller,&lt;br /&gt;
                           bay=bay, did=did, sector_bytes=int(size[1]),&lt;br /&gt;
                           dg=str(row[&amp;quot;DG&amp;quot;]), state=row[&amp;quot;State&amp;quot;], media=row[&amp;quot;Med&amp;quot;],&lt;br /&gt;
                           parents=[])&lt;br /&gt;
        by_location[loc] = key&lt;br /&gt;
&lt;br /&gt;
    for label, rows in vd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;/&amp;quot; + re.escape(controller) + r&amp;quot;/v(\d+)&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        vd = match[1]&lt;br /&gt;
        row = rows[0]&lt;br /&gt;
        dg, reported_vd = row[&amp;quot;DG/VD&amp;quot;].split(&amp;quot;/&amp;quot;)&lt;br /&gt;
        if vd != reported_vd:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent virtual drive identity&amp;quot;)&lt;br /&gt;
        parent = dict(id=controller + &amp;quot;/v&amp;quot; + vd, name=row[&amp;quot;Name&amp;quot;] or &amp;quot;VD&amp;quot; + vd,&lt;br /&gt;
                      raid=row[&amp;quot;TYPE&amp;quot;], os=vd_report[&amp;quot;VD&amp;quot; + vd + &amp;quot; Properties&amp;quot;]&lt;br /&gt;
                      .get(&amp;quot;OS Drive Name&amp;quot;, &amp;quot;N/A&amp;quot;))&lt;br /&gt;
        for member in vd_report[&amp;quot;PDs for VD &amp;quot; + vd]:&lt;br /&gt;
            loc = (member[&amp;quot;EID:Slt&amp;quot;], str(member[&amp;quot;DID&amp;quot;]))&lt;br /&gt;
            drive = drives[by_location[loc]]&lt;br /&gt;
            if drive[&amp;quot;dg&amp;quot;] != dg:&lt;br /&gt;
                raise ValueError(&amp;quot;membership changed during inventory&amp;quot;)&lt;br /&gt;
            if parent[&amp;quot;id&amp;quot;] not in [p[&amp;quot;id&amp;quot;] for p in drive[&amp;quot;parents&amp;quot;]]:&lt;br /&gt;
                drive[&amp;quot;parents&amp;quot;].append(parent)&lt;br /&gt;
&lt;br /&gt;
    for drive in drives.values():&lt;br /&gt;
        drive[&amp;quot;parents&amp;quot;].sort(key=lambda p: int(p[&amp;quot;id&amp;quot;].split(&amp;quot;/v&amp;quot;)[1]))&lt;br /&gt;
        if drive[&amp;quot;state&amp;quot;] == &amp;quot;Onln&amp;quot; and drive[&amp;quot;dg&amp;quot;].isdigit() and not drive[&amp;quot;parents&amp;quot;]:&lt;br /&gt;
            raise ValueError(&amp;quot;online member has no virtual-drive mapping&amp;quot;)&lt;br /&gt;
    if not drives or seen_paths != expected_paths:&lt;br /&gt;
        raise ValueError(&amp;quot;empty or incomplete controller inventory&amp;quot;)&lt;br /&gt;
    return dict(schema=1, complete=True, drives=drives)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Five-second sample and rate calculation ===&lt;br /&gt;
&lt;br /&gt;
Parse &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; by enclosure/slot/DID section. Its seven numeric columns, in order, are sectors read, sectors written, sectors written with Force Unit Access (FUA), read commands, write commands, write-FUA commands and flush commands. Parse each &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; row as enclosure, slot, DID, aggregate IOPS, queue depth, transfer rate (MB/s) and response time (ms). Validate field counts, numeric ranges and unique addresses in each report. The two reports are successive controller snapshots; their values can represent different averaging intervals.&lt;br /&gt;
&lt;br /&gt;
For each disk, keep the last accepted extended counters, current physical key, sequence, sector size and an acquisition timestamp from the host monotonic clock. Publish the counter baseline atomically, once per successful sample, under a nonblocking single-writer lock. Allow less than five seconds for all fast-path commands combined. On overlap, report a collection failure and preserve the baseline. Keep probes run manually for tests from modifying the production baseline.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
elapsed_seconds = current.monotonic_time - previous.monotonic_time&lt;br /&gt;
read_iops       = change(read_commands) / elapsed_seconds&lt;br /&gt;
write_iops      = change(write_commands) / elapsed_seconds&lt;br /&gt;
read_Bps        = change(read_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
write_Bps       = change(write_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
response_ms     = running_average.response_time_ms&lt;br /&gt;
queue_depth     = running_average.queue_depth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the logical sector size of the physical member. The 13 verified members report 512 bytes. Preserve the separate FUA and flush counters in the master record. Label the two write rates as the native &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt; column. Validate the firmware&#039;s treatment of FUA before adding it to a combined write total. Read/write IOPS and bytes/s are interval rates. Response time and queue depth are firmware running averages. Wort reports up to 100 commands for this average, so a lightly used disk can represent a different time window.&lt;br /&gt;
&lt;br /&gt;
An initial sample establishes a baseline. After a reboot, DPM transition, ambiguous identity, counter decrease/wrap, collector state loss, or interval longer than twice the configured poll period, clear the affected baseline and wait for two contiguous samples. Publish a gap for affected rates. On a failed command, DPM OFF, stale inventory beyond 15 minutes, or a missing disk row, record availability explicitly and omit invalid numbers. A genuine idle drive with unchanged, valid counters has zero rates. Retained data read while DPM is OFF is stale even when the CLI exits successfully.&lt;br /&gt;
&lt;br /&gt;
=== JSON contracts and Agent 2 keys ===&lt;br /&gt;
&lt;br /&gt;
The inventory envelope contains &amp;lt;code&amp;gt;schema&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;complete&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;collected_at&amp;lt;/code&amp;gt; (Unix seconds), &amp;lt;code&amp;gt;drives&amp;lt;/code&amp;gt; keyed by physical identity, and a separate LVM coverage status. Each drive adds an &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array with PV, VG, LV name, LV UUID and relation. An empty array with complete coverage means “no mapped LV”. The inventory reader indicates failure if the cache is stale or corrupt. The LLD rule below consumes only a complete RAID inventory. Failure to resolve LVM updates the LVM status independently.&lt;br /&gt;
&lt;br /&gt;
The example below shows one drive in a five-second master payload. The numbers illustrate the field types. In production &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt; counts eligible DPM members and &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt; counts validated members. Missing drives appear in &amp;lt;code&amp;gt;status_by_id&amp;lt;/code&amp;gt; even when their metric record is absent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;schema&amp;quot;: 1, &amp;quot;sampled_at&amp;quot;: 1795796160, &amp;quot;ok&amp;quot;: 1, &amp;quot;dpm_on&amp;quot;: 1,&lt;br /&gt;
  &amp;quot;expected&amp;quot;: 13, &amp;quot;reported&amp;quot;: 13, &amp;quot;poll_ms&amp;quot;: 96, &amp;quot;inventory_age_s&amp;quot;: 42,&lt;br /&gt;
  &amp;quot;status_by_id&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: 1},&lt;br /&gt;
  &amp;quot;drives&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: {&lt;br /&gt;
    &amp;quot;read_iops&amp;quot;: 62.2, &amp;quot;write_iops&amp;quot;: 0, &amp;quot;read_Bps&amp;quot;: 29320192,&lt;br /&gt;
    &amp;quot;write_Bps&amp;quot;: 0, &amp;quot;response_ms&amp;quot;: 1.613, &amp;quot;queue_depth&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_sectors&amp;quot;: 1336328, &amp;quot;write_sectors&amp;quot;: 0, &amp;quot;write_fua_sectors&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_ops&amp;quot;: 1399, &amp;quot;write_ops&amp;quot;: 0, &amp;quot;write_fua_ops&amp;quot;: 0, &amp;quot;flush_ops&amp;quot;: 0&lt;br /&gt;
  }}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use two fixed Agent 2 user parameters. The proposed helper runs as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. Its inventory mode reads the atomically published file, verifies freshness and outputs the envelope. Its sample mode performs the guarded DPM read. On DPM OFF return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on=0&amp;lt;/code&amp;gt; and no numeric disk data. When the DPM state itself cannot be read, omit &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt; and a short diagnostic. For known eligible disks, return availability 0 on a global failure. Emit only JSON on standard output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
UserParameter=kitsnet.megaraid.inventory,/usr/local/libexec/kitsnet-megaraid inventory&lt;br /&gt;
UserParameter=kitsnet.megaraid.dpm,/usr/local/libexec/kitsnet-megaraid sample&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zabbix server implementation ==&lt;br /&gt;
&lt;br /&gt;
Create template &amp;lt;code&amp;gt;KitsNet MegaRAID physical drives by agent 2&amp;lt;/code&amp;gt; in the same local template group as the existing KitsNet monitoring templates. Link it to the existing Wort host. Verify the Agent 2 active hostname matches that host&#039;s technical name. Keep all IDs, enclosure addresses and logical volume names out of template constants.&lt;br /&gt;
&lt;br /&gt;
=== Master items, discovery and life cycle ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Object !! Type / key !! Interval or master !! Information type and settings&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive inventory || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.inventory&amp;lt;/code&amp;gt; || 1m, cached inventory refreshed every 5m || Text. Master history 0; the discovery rule, LVM items and inventory health use the incoming value.&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive DPM sample || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.dpm&amp;lt;/code&amp;gt; || 5s || Text. Master history 0. The collector deadline must fit the agent/server item timeout. Expose a separate diagnostic text item if the master fails.&lt;br /&gt;
|-&lt;br /&gt;
| Discover MegaRAID physical drives || Dependent discovery rule / &amp;lt;code&amp;gt;kitsnet.megaraid.pd.discovery&amp;lt;/code&amp;gt; || Inventory master || JavaScript below, then &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Disable lost resources after 1h, delete after 30d, subject to KitsNet retention policy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A drive added just after an inventory scan should normally appear within about six minutes (five-minute scan plus one-minute master polling), plus server scheduling and agent active-check refresh where applicable. The new rates start on the next two valid samples. An inventory failure must fail discovery preprocessing; returning an empty successful list would mark every existing disk lost. Keep daily housekeeping and history-retention policies in mind when retiring disks.&lt;br /&gt;
&lt;br /&gt;
=== Server-side discovery code ===&lt;br /&gt;
&lt;br /&gt;
Paste this into the JavaScript preprocessing step of the dependent LLD rule. It runs in the Zabbix server or proxy preprocessing engine and returns a root array of native LLD macro objects. Sorting by physical key gives stable results for the heartbeat step. The code handles multiple RAID parents and unassigned members.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var root = JSON.parse(value);&lt;br /&gt;
if (root.schema !== 1 || root.complete !== true ||&lt;br /&gt;
        !root.drives || typeof root.drives !== &#039;object&#039; || Array.isArray(root.drives)) {&lt;br /&gt;
    throw &#039;Incomplete physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var ids = Object.keys(root.drives).sort();&lt;br /&gt;
if (!ids.length) {&lt;br /&gt;
    throw &#039;Empty physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var rows = [];&lt;br /&gt;
for (var i = 0; i &amp;lt; ids.length; i++) {&lt;br /&gt;
    var key = ids[i];&lt;br /&gt;
    var d = root.drives[key];&lt;br /&gt;
    if (!/^(w_[a-f0-9]{16}|s_[a-f0-9]{64})$/.test(key) ||&lt;br /&gt;
            d.id !== key || !d.controller || !d.bay || !Array.isArray(d.parents)) {&lt;br /&gt;
        throw &#039;Invalid physical-drive identity or mapping&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    var labels = [];&lt;br /&gt;
    var refs = [];&lt;br /&gt;
    for (var j = 0; j &amp;lt; d.parents.length; j++) {&lt;br /&gt;
        var parent = d.parents[j];&lt;br /&gt;
        if (!parent.id || !parent.name) {&lt;br /&gt;
            throw &#039;Incomplete virtual-drive reference&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        labels.push(parent.id + &#039; &#039; + parent.name);&lt;br /&gt;
        refs.push(parent.id);&lt;br /&gt;
    }&lt;br /&gt;
    rows.push({&lt;br /&gt;
        &#039;{#PDKEY}&#039;: key, &#039;{#WWN}&#039;: d.wwn, &#039;{#SERIAL}&#039;: d.serial,&lt;br /&gt;
        &#039;{#DISPLAY}&#039;: d.serial || d.wwn, &#039;{#MODEL}&#039;: d.model,&lt;br /&gt;
        &#039;{#CTRL}&#039;: d.controller, &#039;{#BAY}&#039;: d.bay, &#039;{#DID}&#039;: String(d.did),&lt;br /&gt;
        &#039;{#MEDIA}&#039;: d.media, &#039;{#DG}&#039;: d.dg,&lt;br /&gt;
        &#039;{#PARENTS}&#039;: labels.length ? labels.join(&#039;, &#039;) : &#039;Unassigned (&#039; + d.state + &#039;)&#039;,&lt;br /&gt;
        &#039;{#PARENTIDS}&#039;: refs.length ? &#039;|&#039; + refs.join(&#039;|&#039;) + &#039;|&#039; : &#039;|&#039;&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(rows);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Item prototypes and tags ===&lt;br /&gt;
&lt;br /&gt;
Create the following item prototypes under the discovery rule. All are &#039;&#039;Dependent item&#039;&#039;. Use key prefix &amp;lt;code&amp;gt;kitsnet.megaraid.pd.&amp;lt;/code&amp;gt; and append &amp;lt;code&amp;gt;[{#PDKEY}]&amp;lt;/code&amp;gt;. For example, the full read-IOPS key is &amp;lt;code&amp;gt;kitsnet.megaraid.pd.read_iops[{#PDKEY}]&amp;lt;/code&amp;gt;. A key&#039;s stable argument is the physical identity. Names and tags can change as discovery observes new locations and parent names.&lt;br /&gt;
&lt;br /&gt;
For a fast numeric item the extraction path is &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;].FIELD&amp;lt;/code&amp;gt;. Replace &amp;lt;code&amp;gt;FIELD&amp;lt;/code&amp;gt; with the field in the table. Set JSONPath &#039;&#039;Custom on fail → Discard value&#039;&#039; for missing metrics. Rate calculation already took place against the collector&#039;s monotonic clock. Applying &#039;&#039;Change per second&#039;&#039; again would differentiate a rate a second time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key suffix / field !! Source master and preprocessing !! Value type / unit !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ops/s&amp;lt;/code&amp;gt; || Two distinct items for read and write command rates.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;Bps&amp;lt;/code&amp;gt; || Two distinct items for read and write bytes per second.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; || Controller running-average response time.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), no unit || Controller running-average queue depth.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt; || DPM / &amp;lt;code&amp;gt;$.status_by_id[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Numeric (unsigned), value map 1 Reporting / 0 Unavailable || Keep missing, disabled or stale data distinct from an idle disk. Use discard unchanged with a 1m heartbeat after extracting the status.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;metadata&amp;lt;/code&amp;gt; || Inventory / &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Text, discard unchanged with a 1d heartbeat || Full identity, bay, model, serial, sector size, direct RAID parents, Linux mappings and their coverage.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Name a read-IOPS item &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Read IOPS&amp;lt;/code&amp;gt;. Use the corresponding metric label for the other prototypes. Apply the tags &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pd={#PDKEY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;serial={#SERIAL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wwn={#WWN}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;controller={#CTRL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bay={#BAY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parent_vd={#PARENTIDS}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;media={#MEDIA}&amp;lt;/code&amp;gt; and a fixed &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag for each type. Use &amp;lt;code&amp;gt;metric=response_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;metric=available&amp;lt;/code&amp;gt; exactly as specified for the dashboard. Search &amp;lt;code&amp;gt;parent_vd&amp;lt;/code&amp;gt; with &#039;&#039;Contains&#039;&#039; and the token &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt; to get all four backup members. For an unusually large parent list, keep the complete references in metadata and constrain the summary label/tag to Zabbix field limits.&lt;br /&gt;
&lt;br /&gt;
Create controller-level dependent items on the DPM master for &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;poll_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;inventory_age_s&amp;lt;/code&amp;gt;. Give these keys the prefix &amp;lt;code&amp;gt;kitsnet.megaraid.collector.&amp;lt;/code&amp;gt; and use &amp;lt;code&amp;gt;$.FIELD&amp;lt;/code&amp;gt;. Use numeric (unsigned) for status and counts, numeric (float) for durations; units &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; as applicable. Add a diagnostic string and slow inventory/LVM coverage health. A per-disk &amp;lt;code&amp;gt;available=0&amp;lt;/code&amp;gt; on a known spare can be expected; flag missing reports for eligible online members.&lt;br /&gt;
&lt;br /&gt;
Configure a controller collection problem on 30 seconds without a fresh &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt; item or persistent &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;. For example, use &amp;lt;code&amp;gt;nodata(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=1 or max(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=0&amp;lt;/code&amp;gt;. Alert on stale inventory over 15 minutes and on sustained eligible member count mismatch. Give per-drive availability triggers a dependency on the controller collection problem to avoid 13 duplicate events. Keep latency warning thresholds unset until normal ranges have been observed for the HDD and SSD workloads.&lt;br /&gt;
&lt;br /&gt;
=== Reverse lookup from a Linux logical volume ===&lt;br /&gt;
&lt;br /&gt;
Publish an &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; object in the slow inventory envelope. Build it from each drive&#039;s resolved &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array. Use the LV UUID as the dictionary key and store &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt;, sorted unique physical keys, direct VD IDs and a last-resolved timestamp. For example, the index entry for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt; should contain &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt; and all four &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; member WWNs. Resolve multiply mapped or stacked LVs before deduplicating. This permits a lookup by LV name in Latest data without tagging hundreds of physical metrics with that name.&lt;br /&gt;
&lt;br /&gt;
Add a second dependent discovery rule, &amp;lt;code&amp;gt;kitsnet.megaraid.lv.discovery&amp;lt;/code&amp;gt;, using the same inventory master. Apply the following JavaScript and &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Publish &amp;lt;code&amp;gt;lvm_complete=true&amp;lt;/code&amp;gt; only after the LVM map validates. An unavailable LVM scan should preserve the last known associations while physical-drive discovery continues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var inv = JSON.parse(value);&lt;br /&gt;
if (inv.schema !== 1 || inv.complete !== true || inv.lvm_complete !== true ||&lt;br /&gt;
        !inv.lvs || typeof inv.lvs !== &#039;object&#039; || Array.isArray(inv.lvs)) {&lt;br /&gt;
    throw &#039;Incomplete Linux LV index&#039;;&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(Object.keys(inv.lvs).sort().map(function (uuid) {&lt;br /&gt;
    var lv = inv.lvs[uuid];&lt;br /&gt;
    if (!/^[A-Za-z0-9-]+$/.test(uuid) || lv.uuid !== uuid || !lv.vg || !lv.name) {&lt;br /&gt;
        throw &#039;Invalid Linux LV identity&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    return {&#039;{#LVUUID}&#039;: uuid, &#039;{#VG}&#039;: lv.vg, &#039;{#LVNAME}&#039;: lv.name};&lt;br /&gt;
}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under this rule, create the dependent text item prototype &amp;lt;code&amp;gt;kitsnet.megaraid.lv.members[{#LVUUID}]&amp;lt;/code&amp;gt;, named &amp;lt;code&amp;gt;LV {#VG}/{#LVNAME} / physical drives&amp;lt;/code&amp;gt;. Its master is the inventory item. Use JSONPath &amp;lt;code&amp;gt;$.lvs[&#039;{#LVUUID}&#039;]&amp;lt;/code&amp;gt;, retain on change with a daily heartbeat, and tag the item with &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lv&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lv_uuid&amp;lt;/code&amp;gt;. The reverse index adds zero controller queries.&lt;br /&gt;
&lt;br /&gt;
=== History and sampling cost ===&lt;br /&gt;
&lt;br /&gt;
At 13 drives, six performance metrics produce 78 numeric items, 15.6 new performance values/s and 1,347,840 values/day. Status, metadata and collector health are additional. Proposed starting retention is 7d of numeric history and 365d of hourly trends, subject to the Zaya database policy. Seven days is about 9.4 million performance samples before database compression or housekeeping. Preserve full resolution only where it serves diagnosis. Use 0 history on both raw master items and omit trends for text. Confirm global housekeeping overrides and database growth on Zaya before expanding retention.&lt;br /&gt;
&lt;br /&gt;
== Per-drive graphs and single-screen dashboard ==&lt;br /&gt;
&lt;br /&gt;
Create graph prototypes inside the same discovery rule as the item prototypes. Use one graph per unit so latency remains legible during a high-throughput read. Include &amp;lt;code&amp;gt;{#BAY} {#DISPLAY} / {#PARENTS}&amp;lt;/code&amp;gt; in each graph name. Include &amp;lt;code&amp;gt;{#PDKEY}&amp;lt;/code&amp;gt; in the detailed graph name or description wherever the frontend supports it; the constituent item keys always carry it. Use a zero minimum and an automatic maximum. Read lines use blue (&amp;lt;code&amp;gt;2563EB&amp;lt;/code&amp;gt;) and write lines use orange (&amp;lt;code&amp;gt;D97706&amp;lt;/code&amp;gt;) throughout.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Graph prototype !! Item prototypes on left Y axis !! What to compare&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Operations&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || Read/write workload across mirrors or parity members.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Throughput&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || Transfer rate at the physical disk.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Response time&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || Drill into the drive whose response time increased.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Queue depth&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || Check for outstanding work at the same time.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Create the template dashboard &amp;lt;code&amp;gt;MegaRAID physical drives&amp;lt;/code&amp;gt;. Link the template to Wort once. Open the inherited dashboard from &#039;&#039;Monitoring → Hosts → Wort → Dashboards&#039;&#039;. Use the dashboard time picker (default last 15 minutes). Select the graph prototype object when configuring each graph widget. Selecting an individual discovered graph would pin the dashboard to a single physical disk.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dashboard page !! Native widgets and configuration !! Acceptance on Wort&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;All physical drives&#039;&#039;&#039; (default) || A compact header shows collector state and reported/expected counts. Below it, two &#039;&#039;Honeycomb&#039;&#039; widgets share the remaining viewport, one for response time and one for reporting status. Each uses the template host context, item pattern &amp;lt;code&amp;gt;PD *&amp;lt;/code&amp;gt;, item tag &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt; and exactly one &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag (&amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt;). Primary label uses &amp;lt;code&amp;gt;{ITEM.NAME}&amp;lt;/code&amp;gt;, secondary label uses the value. Use an explicit value map or labelled colors for availability. || All 13 drive cells in the status view and all 13 reporting latency cells in one 1920×1080 kiosk viewport at 100% zoom, without scrolling, paging or a hidden-cell ellipsis. Status remains visible if a latency value ages out.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOPS by drive&#039;&#039;&#039; || One full-width &#039;&#039;Graph prototype&#039;&#039; widget, source &#039;&#039;Graph prototype&#039;&#039;, select the Operations prototype, set 4 columns × 4 rows, dashboard time period, legend hidden for the overview. || Thirteen individually labelled mini-graphs on a single screen. Four members map to &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; and the cache SSD is labelled &amp;lt;code&amp;gt;CacheCade_0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Throughput by drive&#039;&#039;&#039;, &#039;&#039;&#039;Response time by drive&#039;&#039;&#039;, &#039;&#039;&#039;Queue depth by drive&#039;&#039;&#039; || Three additional pages with one full-width 4 × 4 graph-prototype widget each, selecting the respective prototype. Use matching order and time period. || Operators can compare siblings over the same time window or open the individual discovered graph at full size, with its legend.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Discovery populates both widget types automatically. The graph pages have 16 slots at the initial layout and Zabbix automatically pages the 17th graph. The default honeycombs reflow as the disk count grows; their capacity depends on widget dimensions and the frontend&#039;s 32-pixel minimum cell size. Validate that the overview fits the intended display after major expansion. Set a frontend refresh interval offered by 7.0, such as 10 seconds. The five-second agent sampling interval remains independent of browser refresh. For missing data, use the status panel and freshness trigger alongside the last displayed latency.&lt;br /&gt;
&lt;br /&gt;
== Construction, commissioning and recovery ==&lt;br /&gt;
&lt;br /&gt;
=== Build sequence ===&lt;br /&gt;
&lt;br /&gt;
# Package the collector, inventory worker, systemd service/timer and fixed Agent 2 include. Suggested names are &amp;lt;code&amp;gt;/usr/local/libexec/kitsnet-megaraid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.timer&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/zabbix/zabbix_agent2.d/kitsnet-megaraid.conf&amp;lt;/code&amp;gt;. Keep immutable code root-owned, cached inventory group-readable to &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; and mutable baseline files in a separate directory writable by the collector.&lt;br /&gt;
# Create the 7.0 template in the Zabbix frontend in the order master items, health items, discovery rule, item prototypes, graph prototypes, dashboard, triggers. Use the JavaScript and table settings above. Export the complete template as Zabbix 7.0 YAML, including the template dashboard and prototype references. Preserve export UUIDs when revising it. Import first on a test host or test server; review the import diff before linking production.&lt;br /&gt;
# Enable and inspect the inventory service. Confirm all 13 physical keys, six parent VDs and the LVM relationship for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. Compare physical identities with the acceptance table. Reconcile by WWN if firmware or local enumeration has changed.&lt;br /&gt;
# Record the initial DPM setting, enable collection as an administrator, then verify Agent 2 permissions using its service account. Keep DPM setters outside the polling key. Validate both text keys and their JSON, then enable the five-second master. Sample test commands are shown below; during construction provide a non-mutating test mode or a separate baseline directory for manual checks.&lt;br /&gt;
# Allow discovery and two contiguous valid samples. Open &#039;&#039;Monitoring → Latest data&#039;&#039;, filter the physical key or parent tag, inspect one disk&#039;s graph set, and verify the host dashboard at the intended display resolution. Record template revision, command versions, expected count, retention policy and operators&#039; acceptance in this page&#039;s revision history.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status kitsnet-megaraid-inventory.timer&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.inventory&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply hist &#039;-physdrv[21:14]&#039; -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acceptance tests ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Test !! Expected result&lt;br /&gt;
|-&lt;br /&gt;
| Inventory and LLD || Exactly 13 unique physical-key rows, 13 discovered metadata items, 78 performance items and 52 graphs (four per drive). Four HDD keys map to &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt;. One SSD maps to &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. The explicit WWN/serial pairs match the inventory.&lt;br /&gt;
|-&lt;br /&gt;
| Counters and units || For two samples from an active backup disk, recompute read IOPS and bytes/s from raw deltas and elapsed seconds. Compare with the stored item values within rounding. Include 4 KiB sectors in fixtures, plus FUA and flush activity. RA response time is in ms.&lt;br /&gt;
|-&lt;br /&gt;
| Automatic additions || In a fixture or test host add a 14th physical identity and a parent. One discovery cycle creates its metrics, tags and four graphs and adds it to the dashboard. Hardware changes on Wort are unnecessary for this test.&lt;br /&gt;
|-&lt;br /&gt;
| Move, swap and shared membership || Move one WWN to a new bay and change its DID: keys and history persist. Replace the disk in its old bay with a new WWN: new history starts after the new baseline. A drive with two parent VDs appears once with both parent IDs. A spare appears with its role and empty parent list.&lt;br /&gt;
|-&lt;br /&gt;
| Lost/stale inventory || Inject a bad JSON response, duplicate WWN, contradictory DID or incomplete VD membership. Last good inventory survives, affected data is withheld, and global discovery does not delete drives. LVM-only failure marks LVM coverage incomplete.&lt;br /&gt;
|-&lt;br /&gt;
| DPM OFF or reset || Retained CLI output produces an unavailable status and gaps. On re-enable, counter wrap or collector restart, the first valid sample seeds a fresh baseline; no spike is emitted.&lt;br /&gt;
|-&lt;br /&gt;
| Dashboard and delivery || At 1920×1080 all installed disks appear on the overview and IOPS graphs page. Check availability for an idle disk and a missing-report fixture. Confirm one Agent 2 fast request every five seconds and no per-drive shell executions for the WWN-equipped fleet.&lt;br /&gt;
|-&lt;br /&gt;
| Operational overhead || Across a representative backup window and a busy VM workload, record guarded collector elapsed/CPU time, missed five-second intervals, Zabbix queue delay, DB history growth, and host/application latency including p95/p99 where available. Compare DPM OFF, ON with no polling and ON at 5s. Investigate material workload changes before acceptance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting and rollback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;The modern StorCLI reports DPM unsupported.&#039;&#039;&#039; Check the executable path. The successful combination on Wort is legacy StorCLI with &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt;. Firmware updates are a separate maintenance decision.&lt;br /&gt;
* &#039;&#039;&#039;The CLI returns figures that no longer move.&#039;&#039;&#039; Check the DPM header, expected/reported count, inventory age and sample timestamp. Compare counter deltas on an active member. A successful exit alone is insufficient.&lt;br /&gt;
* &#039;&#039;&#039;A bay is associated with the wrong identity or volume.&#039;&#039;&#039; Inspect fresh PD/VD inventory and the two identity guards. Force an inventory refresh. Keep the affected disk unavailable until the join is unambiguous; historical records retain the old physical key.&lt;br /&gt;
* &#039;&#039;&#039;Rollback.&#039;&#039;&#039; Disable the two master items or unlink the template while retaining history according to site policy. Stop the proposed inventory timer and remove the Agent 2 include through the normal change process. Restore the recorded DPM state; if the original state was OFF, run &amp;lt;code&amp;gt;sudo -n /usr/local/sbin/storcli64 /c0 set dpm=off&amp;lt;/code&amp;gt; and verify &amp;lt;code&amp;gt;/c0 show dpm&amp;lt;/code&amp;gt;. Verify controller and VD health and continued SMART health monitoring. Review history retention before any “unlink and clear” operation.&lt;br /&gt;
&lt;br /&gt;
== Document control ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Revision !! Date !! Record&lt;br /&gt;
|-&lt;br /&gt;
| 0.1 || 27 November 2026 || Design for review. Live controller, inventory normalization and host polling measurements verified. Record the template export revision, production acceptance date and measured retention cost when the build is commissioned.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[KitsNet Operations:Monitoring:Zabbix]]&lt;br /&gt;
* [[KitsNet Operations:Services:Docker:High Availability NAS:Monitoring|KitsNet NAS HA Monitoring]] — local precedent for Agent 2 master items and Zabbix dependent items.&lt;br /&gt;
* [[KitsNet Operations:External Packages:Linux:MegaRAID Storage Manager]] — KitsNet&#039;s storage-management software notes.&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery Zabbix 7.0 low-level discovery] and [https://www.zabbix.com/documentation/7.0/en/manual/config/items/itemtypes/dependent_items dependent items].&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery/graph_prototypes Zabbix graph prototypes], [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/graph_prototype graph prototype widget] and [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/honeycomb honeycomb widget].&lt;br /&gt;
* [https://docs.broadcom.com/doc/pub-005681 Broadcom 12Gb/s MegaRAID SAS Software User Guide]. The command path and report behavior above were verified on the actual 9361-8i.&lt;br /&gt;
* Validation record, Wort, 27 November 2026: native &amp;lt;code&amp;gt;-DpmStat&amp;lt;/code&amp;gt; live captures, lookup of all PDs and VDs, five-second polling trials, off-state identity-guard timings and LVM inventory.&lt;br /&gt;
&lt;br /&gt;
[[Category:KitsNet Services]]&lt;br /&gt;
[[Category:Architecture]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2717</id>
		<title>KitsNet Operations:Monitoring:MegaRAID Physical Drive IO Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Monitoring:MegaRAID_Physical_Drive_IO_Monitoring&amp;diff=2717"/>
		<updated>2026-11-27T16:59:22Z</updated>

		<summary type="html">&lt;p&gt;Psmode: Created page with &amp;quot;= KitsNet Wort MegaRAID Physical Drive I/O Monitoring =  &amp;#039;&amp;#039;&amp;#039;Design and implementation guide&amp;#039;&amp;#039;&amp;#039; · Revision 0.1 · 27 November 2026 · Proposed for construction  {| class=&amp;quot;wikitable&amp;quot; ! Page placement !! Service !! Target systems !! Validation state |- | Child of KitsNet Operations:Monitoring:Zabbix || Physical storage monitoring || &amp;lt;code&amp;gt;wort&amp;lt;/code&amp;gt; (Agent 2) and &amp;lt;code&amp;gt;zaya&amp;lt;/code&amp;gt; (Zabbix server and frontend) || Controller telemetry and discovery inputs verified. Temp...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KitsNet Wort MegaRAID Physical Drive I/O Monitoring =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Design and implementation guide&#039;&#039;&#039; · Revision 0.1 · 27 November 2026 · Proposed for construction&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Page placement !! Service !! Target systems !! Validation state&lt;br /&gt;
|-&lt;br /&gt;
| Child of [[KitsNet Operations:Monitoring:Zabbix]] || Physical storage monitoring || &amp;lt;code&amp;gt;wort&amp;lt;/code&amp;gt; (Agent 2) and &amp;lt;code&amp;gt;zaya&amp;lt;/code&amp;gt; (Zabbix server and frontend) || Controller telemetry and discovery inputs verified. Template, collector service, graphs and dashboard are proposed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Purpose and operator view ==&lt;br /&gt;
&lt;br /&gt;
An operator investigating a slow virtual disk needs to identify the physical disk involved, find its bay and parent virtual drive, and compare it with its peers. The proposed design polls controller 0 every five seconds, discovers its physical disks automatically, creates a graph set for each disk and shows all current disks on one host dashboard. The primary index is the physical drive&#039;s worldwide name (WWN). A replacement in the same bay receives a new history. A drive moved to another bay on the same host retains its history.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; is MegaRAID virtual drive &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt;. One member is WD serial &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt;, WWN &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt;, enclosure 21, slot 14. The parent appears in Linux as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt;. Its partition supplies VG &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt; and LV &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. The operator should be able to start with any of these identifiers and find the physical disk. The counters measure work at that disk. Attributing that work to an individual guest or Linux LV requires counters at the corresponding higher layer.&lt;br /&gt;
&lt;br /&gt;
== Verified platform and sampling budget ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Verified on 27 November 2026 !! Implementation consequence&lt;br /&gt;
|-&lt;br /&gt;
| Wort || Broadcom/Avago MegaRAID SAS 9361-8i, controller 0, firmware package &amp;lt;code&amp;gt;24.21.0-0132&amp;lt;/code&amp;gt;. Twelve SATA HDDs and one CacheCade SATA SSD. || Native per-drive counters are available on the installed firmware.&lt;br /&gt;
|-&lt;br /&gt;
| Legacy StorCLI || &amp;lt;code&amp;gt;/usr/local/sbin/storcli64&amp;lt;/code&amp;gt;, version 1.23.02. Its MegaCLI-compatible &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt; interface returned live data. || Pin this absolute path for DPM reads. The Zabbix service account successfully used non-interactive sudo for both reads with &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Inventory StorCLI || &amp;lt;code&amp;gt;/opt/MegaRAID/storcli/storcli64&amp;lt;/code&amp;gt;, version 007.2612. Its JSON reports include physical identities and explicit virtual-drive membership. Its DPM query returned “DPM Feature is not supported” even with the legacy DPM setting ON. || Use this binary for inventory. A generic controller capability flag is insufficient to confirm the DPM query path.&lt;br /&gt;
|-&lt;br /&gt;
| Monitoring || Agent 2 on Wort and server/frontend on Zaya run 7.0.32. Wort&#039;s active endpoint is &amp;lt;code&amp;gt;zabbix.lan.kitsnet.us&amp;lt;/code&amp;gt;. || Target Zabbix 7.0 templates, dependent discovery, graph prototypes and template dashboards.&lt;br /&gt;
|-&lt;br /&gt;
| Test state || DPM was restored to OFF. Disk reports can return retained values in this state. || A valid sample requires both reports to say &amp;lt;code&amp;gt;Performance Monitor: ON&amp;lt;/code&amp;gt;. Keep the existing SMART health checks.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The five-second test read &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; in sequence as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. All 12 polls returned all 13 drives. Each pair took 39–45 ms elapsed and averaged 37 ms of CPU time, equivalent to 0.74% of one core or about 0.05% of the 16-CPU host. The backup volume sustained 111.8 MiB/s, compared with 111.6 MiB/s during 15-second polling. Average read latency was 1.74 and 1.58 ms respectively. The short test establishes feasibility during the observed backup workload. Sustained application tail latency and database retention cost require commissioning measurements.&lt;br /&gt;
&lt;br /&gt;
The proposed collector also checks physical identities on either side of the two reads. Three four-command trials, with DPM OFF and retained reports, took 92–100 ms each including process startup. Budget and benchmark the complete collector with DPM ON during construction. The 37 ms CPU result covers the two live DPM reads only.&lt;br /&gt;
&lt;br /&gt;
== Collection and discovery architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort, five-second path                         Zaya, Zabbix 7.0&lt;br /&gt;
PDList → extended counters → running averages → PDList&lt;br /&gt;
    confirm identity, validate DPM, form intervals&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.dpm ───────→ dependent metric prototypes&lt;br /&gt;
                                                        │&lt;br /&gt;
Wort, five-minute inventory                             ├── per-drive graph prototypes&lt;br /&gt;
    StorCLI physical + virtual JSON, LVM reports        └── template dashboard on Wort&lt;br /&gt;
    validate and atomically publish inventory&lt;br /&gt;
    Agent 2 master kitsnet.megaraid.inventory ─→ server-side LLD JavaScript&lt;br /&gt;
                                                └→ metadata and parent references&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only the two master items request data from Agent 2. Each DPM report covers all drives. The server or its assigned proxy runs low-level discovery (LLD), extracts values and instantiates prototypes. The slow inventory worker runs independently so an inventory scan cannot hold the five-second check open. One template link to the existing Wort host is sufficient.&lt;br /&gt;
&lt;br /&gt;
=== Controller commands and privilege boundary ===&lt;br /&gt;
&lt;br /&gt;
As an operator on Wort, enable DPM once at commissioning and verify the readback. Record the previous setting first. Monitoring reads have no reason to call the setter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 set dpm=on&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 /c0 show dpm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The steady five-second path uses these calls in order. &amp;lt;code&amp;gt;-NoLog&amp;lt;/code&amp;gt; suppresses the per-invocation CLI logfile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ext -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply ra  -a0 -NoLog&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -PDList -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inventory worker uses the following fixed read commands. Check the embedded &amp;lt;code&amp;gt;Command Status.Status&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Success&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Controller&amp;lt;/code&amp;gt; for 0 before using &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt;. Check the legacy reports for &amp;lt;code&amp;gt;Exit Code: 0x00&amp;lt;/code&amp;gt; as well as the process exit status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/eall/sall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0/vall show all J&lt;br /&gt;
sudo -n /opt/MegaRAID/storcli/storcli64 /c0 show eventloginfo J&lt;br /&gt;
lsblk --json --paths --output NAME,KNAME,PKNAME,TYPE,MAJ:MIN,WWN&lt;br /&gt;
sudo -n /usr/sbin/pvs --segments --reportformat json -o pv_name,vg_name,lv_name,lv_uuid&lt;br /&gt;
sudo -n /usr/sbin/lvs -a --segments --reportformat json -o vg_name,lv_name,lv_uuid,lv_path,segtype,devices&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use fixed argument lists, a fixed locale, an execution deadline and root-owned executable paths. An inventory systemd service may run these read commands as root and publish a group-readable file for Agent 2. For the fast path, permit only the exact read commands needed by &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; if additional access is required. Revalidate under the running service&#039;s SELinux context during commissioning.&lt;br /&gt;
&lt;br /&gt;
== Drive identity and volume attribution ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Rule !! Use in Zabbix&lt;br /&gt;
|-&lt;br /&gt;
| Physical key || Normalize a valid 16-hex-digit ATA WWN to lowercase and prefix &amp;lt;code&amp;gt;w_&amp;lt;/code&amp;gt;. If a disk genuinely lacks a WWN, use &amp;lt;code&amp;gt;s_&amp;lt;/code&amp;gt; plus the SHA-256 digest of the trimmed model, a NUL byte and the trimmed serial. Reject placeholder or duplicate identities. || Immutable item-key argument on this host. Full WWN, serial and model remain searchable.&lt;br /&gt;
|-&lt;br /&gt;
| Controller address || Preserve controller number, enclosure, slot and DID as separate values. Join both DPM reports to a confirmed physical identity using all available address fields. || Bay, DID and parent names are labels. A moved disk can acquire new labels while keeping its item key.&lt;br /&gt;
|-&lt;br /&gt;
| Direct RAID parents || For every &amp;lt;code&amp;gt;/c0/vN&amp;lt;/code&amp;gt;, join its &amp;lt;code&amp;gt;PDs for VD N&amp;lt;/code&amp;gt; list to the physical inventory by enclosure:slot and DID. Check DG against the DG/VD record. Preserve every match and the OS drive name when present. || Display &amp;lt;code&amp;gt;c0/vN Name&amp;lt;/code&amp;gt;. A parent-ID tag uses delimited tokens, e.g. &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt;, for exact membership searches using “contains”.&lt;br /&gt;
|-&lt;br /&gt;
| CacheCade || The SSD is a direct member of &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. Cached VDs are consumers of that cache. || Show the cache VD as its parent. A consumer list, if displayed, is a separate relationship.&lt;br /&gt;
|-&lt;br /&gt;
| Spare, unconfigured or unreported disk || Keep each identifiable, inventory-visible disk in discovery. Allow an empty parent array for a spare/unassigned disk. Record the controller state and whether DPM reports a row. || Display the role and a data-availability status. A missing row is unknown. A reported zero is a valid value.&lt;br /&gt;
|-&lt;br /&gt;
| Linux LVM || Join each parent VD&#039;s OS disk to its partition/PV by Linux device identity. Collect the set of distinct LV UUIDs with extents on those PVs. || Keep the full PV/VG/LV list in a text item for the physical disk. Avoid truncating a large VG into a tag or graph title.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For LVM, resolve device aliases by major:minor, identify partition parents from &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt; and group &amp;lt;code&amp;gt;pvs&amp;lt;/code&amp;gt; rows by PV. Ignore free segments with empty LV names. For stacked LVs, resolve &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; segment dependencies recursively through component LVs to PVs, with a visited set. Retain direct and dependent roles in the metadata. Present an incomplete map as such if an unfamiliar segment type cannot be resolved. A Linux LV that spans RAID volumes can appear under multiple parents. Some parent VDs have no Linux LV. Linux names such as &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; are current observations and can change on boot.&lt;br /&gt;
&lt;br /&gt;
=== Acceptance inventory from Wort ===&lt;br /&gt;
&lt;br /&gt;
The build must discover these records from the controller. This table is a point-in-time comparison for the first import. It must never become a configured list of devices.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Bay !! DID !! Physical WWN !! Serial !! Direct RAID parent !! Linux disk / VG&lt;br /&gt;
|-&lt;br /&gt;
| 21:13 || 17 || &amp;lt;code&amp;gt;5000c500ebb8561f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZDP9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:14 || 14 || &amp;lt;code&amp;gt;50014ee2bcd3d6eb&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K4XNNX9H&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:15 || 16 || &amp;lt;code&amp;gt;5001b448bc70bc7f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;214101A000F1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt; || Controller cache&lt;br /&gt;
|-&lt;br /&gt;
| 21:16 || 12 || &amp;lt;code&amp;gt;5000cca095c3d53a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8ED1R&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:17 || 20 || &amp;lt;code&amp;gt;5000c500e82d443a&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0QHAB&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:18 || 18 || &amp;lt;code&amp;gt;50014ee2bab34493&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K1JJ1DYX&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:19 || 15 || &amp;lt;code&amp;gt;50014ee216fddd9f&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WX32D95FVCAC&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:21 || 19 || &amp;lt;code&amp;gt;50014ee2100846f2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WD-WCC7K3SJT2L8&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdb&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21:22 || 27 || &amp;lt;code&amp;gt;5000cca095dbba95&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYZZKF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:16 || 25 || &amp;lt;code&amp;gt;5000cca095c3d2b9&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBG8DRBR&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v4 T3.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdd&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:17 || 24 || &amp;lt;code&amp;gt;5000c500ebb8d227&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WX11ZSRK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v5 T1.1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sde&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:18 || 23 || &amp;lt;code&amp;gt;5000c500e82d43dc&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;WRE0PZBD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v3 T1.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sdc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22:19 || 26 || &amp;lt;code&amp;gt;5000cca095dba2c3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;VBHYTMVF&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;c0/v2 T3.0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;T3&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Agent-side implementation specification ==&lt;br /&gt;
&lt;br /&gt;
=== Inventory and replacement handling ===&lt;br /&gt;
&lt;br /&gt;
# Run a boot-triggered and then five-minute inventory timer. Read the controller event-log sequence before and after both StorCLI inventory calls. When the sequence changes mid-scan, retry from the beginning with a bounded retry count. The verified JSON field is &amp;lt;code&amp;gt;Newest Sequence Number&amp;lt;/code&amp;gt;. Also record the reboot sequence.&lt;br /&gt;
# Require a complete, internally consistent PD/VD inventory. Compare the physical summary keys with detailed records, validate unique identities and locations, and verify the member references. Publish by atomic rename on the same filesystem to &amp;lt;code&amp;gt;/run/kitsnet-megaraid/inventory.json&amp;lt;/code&amp;gt;. Preserve the last good map on an error and expose the error and inventory age separately.&lt;br /&gt;
# On a five-second sample, read &amp;lt;code&amp;gt;-PDList&amp;lt;/code&amp;gt; before and after &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt;. Parse enclosure, slot, DID, WWN and drive sequence number. Compare the two observations and the cached identity. Quarantine changed, unknown or conflicting locations for that interval. Coalesce an inventory refresh request on an unknown or changed address. The periodic timer provides an independent retry.&lt;br /&gt;
# For a WWN-less drive, qualify a serial/model fallback using matching identity reads on both sides of the DPM sample (for SATA members, &amp;lt;code&amp;gt;smartctl -j -i -d megaraid,DID /dev/bus/0&amp;lt;/code&amp;gt;). Cache the durable identity at discovery. A transiently missing WWN on a previously identified disk is an identity conflict. Suppress that disk&#039;s sample until it is resolved. The fallback&#039;s extra cost belongs in commissioning.&lt;br /&gt;
# Invalidate counter baselines on controller or agent restarts, changes to the physical identity map, and DPM disable/enable events. Never give a newly arrived drive the previous occupant&#039;s last reading. Reconfiguration of logical drives can change parent labels by the next successful inventory refresh.&lt;br /&gt;
&lt;br /&gt;
=== Reference inventory normalizer ===&lt;br /&gt;
&lt;br /&gt;
The following Python 3.9 function is the RAID part of the inventory producer. Pass it the checked &amp;lt;code&amp;gt;Response Data&amp;lt;/code&amp;gt; objects for &amp;lt;code&amp;gt;/c0/eall/sall&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/c0/vall&amp;lt;/code&amp;gt;. It ran against Wort&#039;s reports and returned all 13 physical identities. The service wrapper adds capture time, LVM references, identity guard metadata and error reporting before publishing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import hashlib&lt;br /&gt;
import re&lt;br /&gt;
&lt;br /&gt;
def disk_key(wwn, model, serial):&lt;br /&gt;
    wwn = wwn.lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
    if re.fullmatch(r&amp;quot;[0-9a-f]{16}&amp;quot;, wwn) and wwn not in {&amp;quot;0&amp;quot; * 16, &amp;quot;f&amp;quot; * 16}:&lt;br /&gt;
        return &amp;quot;w_&amp;quot; + wwn&lt;br /&gt;
    if not model or not serial or serial.upper() in {&amp;quot;N/A&amp;quot;, &amp;quot;UNKNOWN&amp;quot;, &amp;quot;NONE&amp;quot;, &amp;quot;-&amp;quot;}:&lt;br /&gt;
        raise ValueError(&amp;quot;missing durable disk identity&amp;quot;)&lt;br /&gt;
    digest = hashlib.sha256((model + &amp;quot;\0&amp;quot; + serial).encode(&amp;quot;utf-8&amp;quot;)).hexdigest()&lt;br /&gt;
    return &amp;quot;s_&amp;quot; + digest&lt;br /&gt;
&lt;br /&gt;
def inventory(pd_report, vd_report, controller=&amp;quot;c0&amp;quot;):&lt;br /&gt;
    # Arguments are the checked Response Data objects for one controller.&lt;br /&gt;
    drives, by_location = {}, {}&lt;br /&gt;
    bays, dids, seen_paths = set(), set(), set()&lt;br /&gt;
    expected_paths = {k for k in pd_report if re.fullmatch(r&amp;quot;Drive /c\d+/e\d+/s\d+&amp;quot;, k)}&lt;br /&gt;
    for label, detail in pd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;Drive (/c\d+/e(\d+)/s(\d+)) - Detailed Information&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        path, eid, slot = match.groups()&lt;br /&gt;
        row = pd_report[&amp;quot;Drive &amp;quot; + path][0]&lt;br /&gt;
        attrs = detail[&amp;quot;Drive &amp;quot; + path + &amp;quot; Device attributes&amp;quot;]&lt;br /&gt;
        bay = eid + &amp;quot;:&amp;quot; + slot&lt;br /&gt;
        if path.split(&amp;quot;/&amp;quot;)[1] != controller or row[&amp;quot;EID:Slt&amp;quot;] != bay:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent controller or bay&amp;quot;)&lt;br /&gt;
        did = str(row[&amp;quot;DID&amp;quot;])&lt;br /&gt;
        model = attrs[&amp;quot;Model Number&amp;quot;].strip()&lt;br /&gt;
        serial = attrs[&amp;quot;SN&amp;quot;].strip()&lt;br /&gt;
        wwn = str(attrs.get(&amp;quot;WWN&amp;quot;, &amp;quot;&amp;quot;)).strip().lower().removeprefix(&amp;quot;0x&amp;quot;)&lt;br /&gt;
        key = disk_key(wwn, model, serial)&lt;br /&gt;
        loc = (bay, did)&lt;br /&gt;
        if key in drives or bay in bays or did in dids:&lt;br /&gt;
            raise ValueError(&amp;quot;duplicate disk identity or address&amp;quot;)&lt;br /&gt;
        bays.add(bay)&lt;br /&gt;
        dids.add(did)&lt;br /&gt;
        seen_paths.add(&amp;quot;Drive &amp;quot; + path)&lt;br /&gt;
        size = re.fullmatch(r&amp;quot;(\d+)\s*B&amp;quot;, attrs[&amp;quot;Logical Sector Size&amp;quot;].strip())&lt;br /&gt;
        if not size or int(size[1]) &amp;lt; 1:&lt;br /&gt;
            raise ValueError(&amp;quot;unknown logical sector size&amp;quot;)&lt;br /&gt;
        drives[key] = dict(id=key, wwn=wwn if key.startswith(&amp;quot;w_&amp;quot;) else &amp;quot;&amp;quot;,&lt;br /&gt;
                           serial=serial, model=model, controller=controller,&lt;br /&gt;
                           bay=bay, did=did, sector_bytes=int(size[1]),&lt;br /&gt;
                           dg=str(row[&amp;quot;DG&amp;quot;]), state=row[&amp;quot;State&amp;quot;], media=row[&amp;quot;Med&amp;quot;],&lt;br /&gt;
                           parents=[])&lt;br /&gt;
        by_location[loc] = key&lt;br /&gt;
&lt;br /&gt;
    for label, rows in vd_report.items():&lt;br /&gt;
        match = re.fullmatch(r&amp;quot;/&amp;quot; + re.escape(controller) + r&amp;quot;/v(\d+)&amp;quot;, label)&lt;br /&gt;
        if not match:&lt;br /&gt;
            continue&lt;br /&gt;
        vd = match[1]&lt;br /&gt;
        row = rows[0]&lt;br /&gt;
        dg, reported_vd = row[&amp;quot;DG/VD&amp;quot;].split(&amp;quot;/&amp;quot;)&lt;br /&gt;
        if vd != reported_vd:&lt;br /&gt;
            raise ValueError(&amp;quot;inconsistent virtual drive identity&amp;quot;)&lt;br /&gt;
        parent = dict(id=controller + &amp;quot;/v&amp;quot; + vd, name=row[&amp;quot;Name&amp;quot;] or &amp;quot;VD&amp;quot; + vd,&lt;br /&gt;
                      raid=row[&amp;quot;TYPE&amp;quot;], os=vd_report[&amp;quot;VD&amp;quot; + vd + &amp;quot; Properties&amp;quot;]&lt;br /&gt;
                      .get(&amp;quot;OS Drive Name&amp;quot;, &amp;quot;N/A&amp;quot;))&lt;br /&gt;
        for member in vd_report[&amp;quot;PDs for VD &amp;quot; + vd]:&lt;br /&gt;
            loc = (member[&amp;quot;EID:Slt&amp;quot;], str(member[&amp;quot;DID&amp;quot;]))&lt;br /&gt;
            drive = drives[by_location[loc]]&lt;br /&gt;
            if drive[&amp;quot;dg&amp;quot;] != dg:&lt;br /&gt;
                raise ValueError(&amp;quot;membership changed during inventory&amp;quot;)&lt;br /&gt;
            if parent[&amp;quot;id&amp;quot;] not in [p[&amp;quot;id&amp;quot;] for p in drive[&amp;quot;parents&amp;quot;]]:&lt;br /&gt;
                drive[&amp;quot;parents&amp;quot;].append(parent)&lt;br /&gt;
&lt;br /&gt;
    for drive in drives.values():&lt;br /&gt;
        drive[&amp;quot;parents&amp;quot;].sort(key=lambda p: int(p[&amp;quot;id&amp;quot;].split(&amp;quot;/v&amp;quot;)[1]))&lt;br /&gt;
        if drive[&amp;quot;state&amp;quot;] == &amp;quot;Onln&amp;quot; and drive[&amp;quot;dg&amp;quot;].isdigit() and not drive[&amp;quot;parents&amp;quot;]:&lt;br /&gt;
            raise ValueError(&amp;quot;online member has no virtual-drive mapping&amp;quot;)&lt;br /&gt;
    if not drives or seen_paths != expected_paths:&lt;br /&gt;
        raise ValueError(&amp;quot;empty or incomplete controller inventory&amp;quot;)&lt;br /&gt;
    return dict(schema=1, complete=True, drives=drives)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Five-second sample and rate calculation ===&lt;br /&gt;
&lt;br /&gt;
Parse &amp;lt;code&amp;gt;ext&amp;lt;/code&amp;gt; by enclosure/slot/DID section. Its seven numeric columns, in order, are sectors read, sectors written, sectors written with Force Unit Access (FUA), read commands, write commands, write-FUA commands and flush commands. Parse each &amp;lt;code&amp;gt;ra&amp;lt;/code&amp;gt; row as enclosure, slot, DID, aggregate IOPS, queue depth, transfer rate (MB/s) and response time (ms). Validate field counts, numeric ranges and unique addresses in each report. The two reports are successive controller snapshots; their values can represent different averaging intervals.&lt;br /&gt;
&lt;br /&gt;
For each disk, keep the last accepted extended counters, current physical key, sequence, sector size and an acquisition timestamp from the host monotonic clock. Publish the counter baseline atomically, once per successful sample, under a nonblocking single-writer lock. Allow less than five seconds for all fast-path commands combined. On overlap, report a collection failure and preserve the baseline. Keep probes run manually for tests from modifying the production baseline.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
elapsed_seconds = current.monotonic_time - previous.monotonic_time&lt;br /&gt;
read_iops       = change(read_commands) / elapsed_seconds&lt;br /&gt;
write_iops      = change(write_commands) / elapsed_seconds&lt;br /&gt;
read_Bps        = change(read_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
write_Bps       = change(write_sectors) * sector_bytes / elapsed_seconds&lt;br /&gt;
response_ms     = running_average.response_time_ms&lt;br /&gt;
queue_depth     = running_average.queue_depth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use the logical sector size of the physical member. The 13 verified members report 512 bytes. Preserve the separate FUA and flush counters in the master record. Label the two write rates as the native &amp;lt;code&amp;gt;Write&amp;lt;/code&amp;gt; column. Validate the firmware&#039;s treatment of FUA before adding it to a combined write total. Read/write IOPS and bytes/s are interval rates. Response time and queue depth are firmware running averages. Wort reports up to 100 commands for this average, so a lightly used disk can represent a different time window.&lt;br /&gt;
&lt;br /&gt;
An initial sample establishes a baseline. After a reboot, DPM transition, ambiguous identity, counter decrease/wrap, collector state loss, or interval longer than twice the configured poll period, clear the affected baseline and wait for two contiguous samples. Publish a gap for affected rates. On a failed command, DPM OFF, stale inventory beyond 15 minutes, or a missing disk row, record availability explicitly and omit invalid numbers. A genuine idle drive with unchanged, valid counters has zero rates. Retained data read while DPM is OFF is stale even when the CLI exits successfully.&lt;br /&gt;
&lt;br /&gt;
=== JSON contracts and Agent 2 keys ===&lt;br /&gt;
&lt;br /&gt;
The inventory envelope contains &amp;lt;code&amp;gt;schema&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;complete&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;collected_at&amp;lt;/code&amp;gt; (Unix seconds), &amp;lt;code&amp;gt;drives&amp;lt;/code&amp;gt; keyed by physical identity, and a separate LVM coverage status. Each drive adds an &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array with PV, VG, LV name, LV UUID and relation. An empty array with complete coverage means “no mapped LV”. The inventory reader indicates failure if the cache is stale or corrupt. The LLD rule below consumes only a complete RAID inventory. Failure to resolve LVM updates the LVM status independently.&lt;br /&gt;
&lt;br /&gt;
The example below shows one drive in a five-second master payload. The numbers illustrate the field types. In production &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt; counts eligible DPM members and &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt; counts validated members. Missing drives appear in &amp;lt;code&amp;gt;status_by_id&amp;lt;/code&amp;gt; even when their metric record is absent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;schema&amp;quot;: 1, &amp;quot;sampled_at&amp;quot;: 1795796160, &amp;quot;ok&amp;quot;: 1, &amp;quot;dpm_on&amp;quot;: 1,&lt;br /&gt;
  &amp;quot;expected&amp;quot;: 13, &amp;quot;reported&amp;quot;: 13, &amp;quot;poll_ms&amp;quot;: 96, &amp;quot;inventory_age_s&amp;quot;: 42,&lt;br /&gt;
  &amp;quot;status_by_id&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: 1},&lt;br /&gt;
  &amp;quot;drives&amp;quot;: {&amp;quot;w_50014ee2bcd3d6eb&amp;quot;: {&lt;br /&gt;
    &amp;quot;read_iops&amp;quot;: 62.2, &amp;quot;write_iops&amp;quot;: 0, &amp;quot;read_Bps&amp;quot;: 29320192,&lt;br /&gt;
    &amp;quot;write_Bps&amp;quot;: 0, &amp;quot;response_ms&amp;quot;: 1.613, &amp;quot;queue_depth&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_sectors&amp;quot;: 1336328, &amp;quot;write_sectors&amp;quot;: 0, &amp;quot;write_fua_sectors&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;read_ops&amp;quot;: 1399, &amp;quot;write_ops&amp;quot;: 0, &amp;quot;write_fua_ops&amp;quot;: 0, &amp;quot;flush_ops&amp;quot;: 0&lt;br /&gt;
  }}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use two fixed Agent 2 user parameters. The proposed helper runs as &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt;. Its inventory mode reads the atomically published file, verifies freshness and outputs the envelope. Its sample mode performs the guarded DPM read. On DPM OFF return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on=0&amp;lt;/code&amp;gt; and no numeric disk data. When the DPM state itself cannot be read, omit &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, return &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt; and a short diagnostic. For known eligible disks, return availability 0 on a global failure. Emit only JSON on standard output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
UserParameter=kitsnet.megaraid.inventory,/usr/local/libexec/kitsnet-megaraid inventory&lt;br /&gt;
UserParameter=kitsnet.megaraid.dpm,/usr/local/libexec/kitsnet-megaraid sample&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zabbix server implementation ==&lt;br /&gt;
&lt;br /&gt;
Create template &amp;lt;code&amp;gt;KitsNet MegaRAID physical drives by agent 2&amp;lt;/code&amp;gt; in the same local template group as the existing KitsNet monitoring templates. Link it to the existing Wort host. Verify the Agent 2 active hostname matches that host&#039;s technical name. Keep all IDs, enclosure addresses and logical volume names out of template constants.&lt;br /&gt;
&lt;br /&gt;
=== Master items, discovery and life cycle ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Object !! Type / key !! Interval or master !! Information type and settings&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive inventory || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.inventory&amp;lt;/code&amp;gt; || 1m, cached inventory refreshed every 5m || Text. Master history 0; the discovery rule, LVM items and inventory health use the incoming value.&lt;br /&gt;
|-&lt;br /&gt;
| Physical-drive DPM sample || Zabbix agent (active) / &amp;lt;code&amp;gt;kitsnet.megaraid.dpm&amp;lt;/code&amp;gt; || 5s || Text. Master history 0. The collector deadline must fit the agent/server item timeout. Expose a separate diagnostic text item if the master fails.&lt;br /&gt;
|-&lt;br /&gt;
| Discover MegaRAID physical drives || Dependent discovery rule / &amp;lt;code&amp;gt;kitsnet.megaraid.pd.discovery&amp;lt;/code&amp;gt; || Inventory master || JavaScript below, then &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Disable lost resources after 1h, delete after 30d, subject to KitsNet retention policy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A drive added just after an inventory scan should normally appear within about six minutes (five-minute scan plus one-minute master polling), plus server scheduling and agent active-check refresh where applicable. The new rates start on the next two valid samples. An inventory failure must fail discovery preprocessing; returning an empty successful list would mark every existing disk lost. Keep daily housekeeping and history-retention policies in mind when retiring disks.&lt;br /&gt;
&lt;br /&gt;
=== Server-side discovery code ===&lt;br /&gt;
&lt;br /&gt;
Paste this into the JavaScript preprocessing step of the dependent LLD rule. It runs in the Zabbix server or proxy preprocessing engine and returns a root array of native LLD macro objects. Sorting by physical key gives stable results for the heartbeat step. The code handles multiple RAID parents and unassigned members.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var root = JSON.parse(value);&lt;br /&gt;
if (root.schema !== 1 || root.complete !== true ||&lt;br /&gt;
        !root.drives || typeof root.drives !== &#039;object&#039; || Array.isArray(root.drives)) {&lt;br /&gt;
    throw &#039;Incomplete physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var ids = Object.keys(root.drives).sort();&lt;br /&gt;
if (!ids.length) {&lt;br /&gt;
    throw &#039;Empty physical-drive inventory&#039;;&lt;br /&gt;
}&lt;br /&gt;
var rows = [];&lt;br /&gt;
for (var i = 0; i &amp;lt; ids.length; i++) {&lt;br /&gt;
    var key = ids[i];&lt;br /&gt;
    var d = root.drives[key];&lt;br /&gt;
    if (!/^(w_[a-f0-9]{16}|s_[a-f0-9]{64})$/.test(key) ||&lt;br /&gt;
            d.id !== key || !d.controller || !d.bay || !Array.isArray(d.parents)) {&lt;br /&gt;
        throw &#039;Invalid physical-drive identity or mapping&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    var labels = [];&lt;br /&gt;
    var refs = [];&lt;br /&gt;
    for (var j = 0; j &amp;lt; d.parents.length; j++) {&lt;br /&gt;
        var parent = d.parents[j];&lt;br /&gt;
        if (!parent.id || !parent.name) {&lt;br /&gt;
            throw &#039;Incomplete virtual-drive reference&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        labels.push(parent.id + &#039; &#039; + parent.name);&lt;br /&gt;
        refs.push(parent.id);&lt;br /&gt;
    }&lt;br /&gt;
    rows.push({&lt;br /&gt;
        &#039;{#PDKEY}&#039;: key, &#039;{#WWN}&#039;: d.wwn, &#039;{#SERIAL}&#039;: d.serial,&lt;br /&gt;
        &#039;{#DISPLAY}&#039;: d.serial || d.wwn, &#039;{#MODEL}&#039;: d.model,&lt;br /&gt;
        &#039;{#CTRL}&#039;: d.controller, &#039;{#BAY}&#039;: d.bay, &#039;{#DID}&#039;: String(d.did),&lt;br /&gt;
        &#039;{#MEDIA}&#039;: d.media, &#039;{#DG}&#039;: d.dg,&lt;br /&gt;
        &#039;{#PARENTS}&#039;: labels.length ? labels.join(&#039;, &#039;) : &#039;Unassigned (&#039; + d.state + &#039;)&#039;,&lt;br /&gt;
        &#039;{#PARENTIDS}&#039;: refs.length ? &#039;|&#039; + refs.join(&#039;|&#039;) + &#039;|&#039; : &#039;|&#039;&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(rows);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Item prototypes and tags ===&lt;br /&gt;
&lt;br /&gt;
Create the following item prototypes under the discovery rule. All are &#039;&#039;Dependent item&#039;&#039;. Use key prefix &amp;lt;code&amp;gt;kitsnet.megaraid.pd.&amp;lt;/code&amp;gt; and append &amp;lt;code&amp;gt;[{#PDKEY}]&amp;lt;/code&amp;gt;. For example, the full read-IOPS key is &amp;lt;code&amp;gt;kitsnet.megaraid.pd.read_iops[{#PDKEY}]&amp;lt;/code&amp;gt;. A key&#039;s stable argument is the physical identity. Names and tags can change as discovery observes new locations and parent names.&lt;br /&gt;
&lt;br /&gt;
For a fast numeric item the extraction path is &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;].FIELD&amp;lt;/code&amp;gt;. Replace &amp;lt;code&amp;gt;FIELD&amp;lt;/code&amp;gt; with the field in the table. Set JSONPath &#039;&#039;Custom on fail → Discard value&#039;&#039; for missing metrics. Rate calculation already took place against the collector&#039;s monotonic clock. Applying &#039;&#039;Change per second&#039;&#039; again would differentiate a rate a second time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key suffix / field !! Source master and preprocessing !! Value type / unit !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ops/s&amp;lt;/code&amp;gt; || Two distinct items for read and write command rates.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;Bps&amp;lt;/code&amp;gt; || Two distinct items for read and write bytes per second.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; || Controller running-average response time.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || DPM / per-drive JSONPath || Numeric (float), no unit || Controller running-average queue depth.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt; || DPM / &amp;lt;code&amp;gt;$.status_by_id[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Numeric (unsigned), value map 1 Reporting / 0 Unavailable || Keep missing, disabled or stale data distinct from an idle disk. Use discard unchanged with a 1m heartbeat after extracting the status.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;metadata&amp;lt;/code&amp;gt; || Inventory / &amp;lt;code&amp;gt;$.drives[&#039;{#PDKEY}&#039;]&amp;lt;/code&amp;gt; || Text, discard unchanged with a 1d heartbeat || Full identity, bay, model, serial, sector size, direct RAID parents, Linux mappings and their coverage.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Name a read-IOPS item &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Read IOPS&amp;lt;/code&amp;gt;. Use the corresponding metric label for the other prototypes. Apply the tags &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pd={#PDKEY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;serial={#SERIAL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wwn={#WWN}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;controller={#CTRL}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bay={#BAY}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parent_vd={#PARENTIDS}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;media={#MEDIA}&amp;lt;/code&amp;gt; and a fixed &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag for each type. Use &amp;lt;code&amp;gt;metric=response_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;metric=available&amp;lt;/code&amp;gt; exactly as specified for the dashboard. Search &amp;lt;code&amp;gt;parent_vd&amp;lt;/code&amp;gt; with &#039;&#039;Contains&#039;&#039; and the token &amp;lt;code&amp;gt;&amp;amp;#124;c0/v0&amp;amp;#124;&amp;lt;/code&amp;gt; to get all four backup members. For an unusually large parent list, keep the complete references in metadata and constrain the summary label/tag to Zabbix field limits.&lt;br /&gt;
&lt;br /&gt;
Create controller-level dependent items on the DPM master for &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dpm_on&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;expected&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reported&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;poll_ms&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;inventory_age_s&amp;lt;/code&amp;gt;. Give these keys the prefix &amp;lt;code&amp;gt;kitsnet.megaraid.collector.&amp;lt;/code&amp;gt; and use &amp;lt;code&amp;gt;$.FIELD&amp;lt;/code&amp;gt;. Use numeric (unsigned) for status and counts, numeric (float) for durations; units &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; as applicable. Add a diagnostic string and slow inventory/LVM coverage health. A per-disk &amp;lt;code&amp;gt;available=0&amp;lt;/code&amp;gt; on a known spare can be expected; flag missing reports for eligible online members.&lt;br /&gt;
&lt;br /&gt;
Configure a controller collection problem on 30 seconds without a fresh &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt; item or persistent &amp;lt;code&amp;gt;ok=0&amp;lt;/code&amp;gt;. For example, use &amp;lt;code&amp;gt;nodata(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=1 or max(/KitsNet MegaRAID physical drives by agent 2/kitsnet.megaraid.collector.ok,30s)=0&amp;lt;/code&amp;gt;. Alert on stale inventory over 15 minutes and on sustained eligible member count mismatch. Give per-drive availability triggers a dependency on the controller collection problem to avoid 13 duplicate events. Keep latency warning thresholds unset until normal ranges have been observed for the HDD and SSD workloads.&lt;br /&gt;
&lt;br /&gt;
=== Reverse lookup from a Linux logical volume ===&lt;br /&gt;
&lt;br /&gt;
Publish an &amp;lt;code&amp;gt;lvs&amp;lt;/code&amp;gt; object in the slow inventory envelope. Build it from each drive&#039;s resolved &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt; array. Use the LV UUID as the dictionary key and store &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;uuid&amp;lt;/code&amp;gt;, sorted unique physical keys, direct VD IDs and a last-resolved timestamp. For example, the index entry for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt; should contain &amp;lt;code&amp;gt;c0/v0&amp;lt;/code&amp;gt; and all four &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; member WWNs. Resolve multiply mapped or stacked LVs before deduplicating. This permits a lookup by LV name in Latest data without tagging hundreds of physical metrics with that name.&lt;br /&gt;
&lt;br /&gt;
Add a second dependent discovery rule, &amp;lt;code&amp;gt;kitsnet.megaraid.lv.discovery&amp;lt;/code&amp;gt;, using the same inventory master. Apply the following JavaScript and &#039;&#039;Discard unchanged with heartbeat&#039;&#039; 1h. Publish &amp;lt;code&amp;gt;lvm_complete=true&amp;lt;/code&amp;gt; only after the LVM map validates. An unavailable LVM scan should preserve the last known associations while physical-drive discovery continues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var inv = JSON.parse(value);&lt;br /&gt;
if (inv.schema !== 1 || inv.complete !== true || inv.lvm_complete !== true ||&lt;br /&gt;
        !inv.lvs || typeof inv.lvs !== &#039;object&#039; || Array.isArray(inv.lvs)) {&lt;br /&gt;
    throw &#039;Incomplete Linux LV index&#039;;&lt;br /&gt;
}&lt;br /&gt;
return JSON.stringify(Object.keys(inv.lvs).sort().map(function (uuid) {&lt;br /&gt;
    var lv = inv.lvs[uuid];&lt;br /&gt;
    if (!/^[A-Za-z0-9-]+$/.test(uuid) || lv.uuid !== uuid || !lv.vg || !lv.name) {&lt;br /&gt;
        throw &#039;Invalid Linux LV identity&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    return {&#039;{#LVUUID}&#039;: uuid, &#039;{#VG}&#039;: lv.vg, &#039;{#LVNAME}&#039;: lv.name};&lt;br /&gt;
}));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under this rule, create the dependent text item prototype &amp;lt;code&amp;gt;kitsnet.megaraid.lv.members[{#LVUUID}]&amp;lt;/code&amp;gt;, named &amp;lt;code&amp;gt;LV {#VG}/{#LVNAME} / physical drives&amp;lt;/code&amp;gt;. Its master is the inventory item. Use JSONPath &amp;lt;code&amp;gt;$.lvs[&#039;{#LVUUID}&#039;]&amp;lt;/code&amp;gt;, retain on change with a daily heartbeat, and tag the item with &amp;lt;code&amp;gt;vg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lv&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lv_uuid&amp;lt;/code&amp;gt;. The reverse index adds zero controller queries.&lt;br /&gt;
&lt;br /&gt;
=== History and sampling cost ===&lt;br /&gt;
&lt;br /&gt;
At 13 drives, six performance metrics produce 78 numeric items, 15.6 new performance values/s and 1,347,840 values/day. Status, metadata and collector health are additional. Proposed starting retention is 7d of numeric history and 365d of hourly trends, subject to the Zaya database policy. Seven days is about 9.4 million performance samples before database compression or housekeeping. Preserve full resolution only where it serves diagnosis. Use 0 history on both raw master items and omit trends for text. Confirm global housekeeping overrides and database growth on Zaya before expanding retention.&lt;br /&gt;
&lt;br /&gt;
== Per-drive graphs and single-screen dashboard ==&lt;br /&gt;
&lt;br /&gt;
Create graph prototypes inside the same discovery rule as the item prototypes. Use one graph per unit so latency remains legible during a high-throughput read. Include &amp;lt;code&amp;gt;{#BAY} {#DISPLAY} / {#PARENTS}&amp;lt;/code&amp;gt; in each graph name. Include &amp;lt;code&amp;gt;{#PDKEY}&amp;lt;/code&amp;gt; in the detailed graph name or description wherever the frontend supports it; the constituent item keys always carry it. Use a zero minimum and an automatic maximum. Read lines use blue (&amp;lt;code&amp;gt;2563EB&amp;lt;/code&amp;gt;) and write lines use orange (&amp;lt;code&amp;gt;D97706&amp;lt;/code&amp;gt;) throughout.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Graph prototype !! Item prototypes on left Y axis !! What to compare&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Operations&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_iops&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_iops&amp;lt;/code&amp;gt; || Read/write workload across mirrors or parity members.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Throughput&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;read_Bps&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;write_Bps&amp;lt;/code&amp;gt; || Transfer rate at the physical disk.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Response time&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; || Drill into the drive whose response time increased.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PD {#BAY} {#DISPLAY} / {#PARENTS} / Queue depth&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;queue_depth&amp;lt;/code&amp;gt; || Check for outstanding work at the same time.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Create the template dashboard &amp;lt;code&amp;gt;MegaRAID physical drives&amp;lt;/code&amp;gt;. Link the template to Wort once. Open the inherited dashboard from &#039;&#039;Monitoring → Hosts → Wort → Dashboards&#039;&#039;. Use the dashboard time picker (default last 15 minutes). Select the graph prototype object when configuring each graph widget. Selecting an individual discovered graph would pin the dashboard to a single physical disk.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dashboard page !! Native widgets and configuration !! Acceptance on Wort&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;All physical drives&#039;&#039;&#039; (default) || A compact header shows collector state and reported/expected counts. Below it, two &#039;&#039;Honeycomb&#039;&#039; widgets share the remaining viewport, one for response time and one for reporting status. Each uses the template host context, item pattern &amp;lt;code&amp;gt;PD *&amp;lt;/code&amp;gt;, item tag &amp;lt;code&amp;gt;component=megaraid-pd&amp;lt;/code&amp;gt; and exactly one &amp;lt;code&amp;gt;metric&amp;lt;/code&amp;gt; tag (&amp;lt;code&amp;gt;response_ms&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;available&amp;lt;/code&amp;gt;). Primary label uses &amp;lt;code&amp;gt;{ITEM.NAME}&amp;lt;/code&amp;gt;, secondary label uses the value. Use an explicit value map or labelled colors for availability. || All 13 drive cells in the status view and all 13 reporting latency cells in one 1920×1080 kiosk viewport at 100% zoom, without scrolling, paging or a hidden-cell ellipsis. Status remains visible if a latency value ages out.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOPS by drive&#039;&#039;&#039; || One full-width &#039;&#039;Graph prototype&#039;&#039; widget, source &#039;&#039;Graph prototype&#039;&#039;, select the Operations prototype, set 4 columns × 4 rows, dashboard time period, legend hidden for the overview. || Thirteen individually labelled mini-graphs on a single screen. Four members map to &amp;lt;code&amp;gt;Backups&amp;lt;/code&amp;gt; and the cache SSD is labelled &amp;lt;code&amp;gt;CacheCade_0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Throughput by drive&#039;&#039;&#039;, &#039;&#039;&#039;Response time by drive&#039;&#039;&#039;, &#039;&#039;&#039;Queue depth by drive&#039;&#039;&#039; || Three additional pages with one full-width 4 × 4 graph-prototype widget each, selecting the respective prototype. Use matching order and time period. || Operators can compare siblings over the same time window or open the individual discovered graph at full size, with its legend.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Discovery populates both widget types automatically. The graph pages have 16 slots at the initial layout and Zabbix automatically pages the 17th graph. The default honeycombs reflow as the disk count grows; their capacity depends on widget dimensions and the frontend&#039;s 32-pixel minimum cell size. Validate that the overview fits the intended display after major expansion. Set a frontend refresh interval offered by 7.0, such as 10 seconds. The five-second agent sampling interval remains independent of browser refresh. For missing data, use the status panel and freshness trigger alongside the last displayed latency.&lt;br /&gt;
&lt;br /&gt;
== Construction, commissioning and recovery ==&lt;br /&gt;
&lt;br /&gt;
=== Build sequence ===&lt;br /&gt;
&lt;br /&gt;
# Package the collector, inventory worker, systemd service/timer and fixed Agent 2 include. Suggested names are &amp;lt;code&amp;gt;/usr/local/libexec/kitsnet-megaraid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.service&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-megaraid-inventory.timer&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/zabbix/zabbix_agent2.d/kitsnet-megaraid.conf&amp;lt;/code&amp;gt;. Keep immutable code root-owned, cached inventory group-readable to &amp;lt;code&amp;gt;zabbix&amp;lt;/code&amp;gt; and mutable baseline files in a separate directory writable by the collector.&lt;br /&gt;
# Create the 7.0 template in the Zabbix frontend in the order master items, health items, discovery rule, item prototypes, graph prototypes, dashboard, triggers. Use the JavaScript and table settings above. Export the complete template as Zabbix 7.0 YAML, including the template dashboard and prototype references. Preserve export UUIDs when revising it. Import first on a test host or test server; review the import diff before linking production.&lt;br /&gt;
# Enable and inspect the inventory service. Confirm all 13 physical keys, six parent VDs and the LVM relationship for &amp;lt;code&amp;gt;T3b/uv054-disk2&amp;lt;/code&amp;gt;. Compare physical identities with the acceptance table. Reconcile by WWN if firmware or local enumeration has changed.&lt;br /&gt;
# Record the initial DPM setting, enable collection as an administrator, then verify Agent 2 permissions using its service account. Keep DPM setters outside the polling key. Validate both text keys and their JSON, then enable the five-second master. Sample test commands are shown below; during construction provide a non-mutating test mode or a separate baseline directory for manual checks.&lt;br /&gt;
# Allow discovery and two contiguous valid samples. Open &#039;&#039;Monitoring → Latest data&#039;&#039;, filter the physical key or parent tag, inspect one disk&#039;s graph set, and verify the host dashboard at the intended display resolution. Record template revision, command versions, expected count, retention policy and operators&#039; acceptance in this page&#039;s revision history.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status kitsnet-megaraid-inventory.timer&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.inventory&lt;br /&gt;
sudo -u zabbix /usr/sbin/zabbix_agent2 -t kitsnet.megaraid.dpm&lt;br /&gt;
sudo -n /usr/local/sbin/storcli64 -DpmStat -Dsply hist &#039;-physdrv[21:14]&#039; -a0 -NoLog&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Acceptance tests ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Test !! Expected result&lt;br /&gt;
|-&lt;br /&gt;
| Inventory and LLD || Exactly 13 unique physical-key rows, 13 discovered metadata items, 78 performance items and 52 graphs (four per drive). Four HDD keys map to &amp;lt;code&amp;gt;c0/v0 Backups&amp;lt;/code&amp;gt;. One SSD maps to &amp;lt;code&amp;gt;c0/v1 CacheCade_0&amp;lt;/code&amp;gt;. The explicit WWN/serial pairs match the inventory.&lt;br /&gt;
|-&lt;br /&gt;
| Counters and units || For two samples from an active backup disk, recompute read IOPS and bytes/s from raw deltas and elapsed seconds. Compare with the stored item values within rounding. Include 4 KiB sectors in fixtures, plus FUA and flush activity. RA response time is in ms.&lt;br /&gt;
|-&lt;br /&gt;
| Automatic additions || In a fixture or test host add a 14th physical identity and a parent. One discovery cycle creates its metrics, tags and four graphs and adds it to the dashboard. Hardware changes on Wort are unnecessary for this test.&lt;br /&gt;
|-&lt;br /&gt;
| Move, swap and shared membership || Move one WWN to a new bay and change its DID: keys and history persist. Replace the disk in its old bay with a new WWN: new history starts after the new baseline. A drive with two parent VDs appears once with both parent IDs. A spare appears with its role and empty parent list.&lt;br /&gt;
|-&lt;br /&gt;
| Lost/stale inventory || Inject a bad JSON response, duplicate WWN, contradictory DID or incomplete VD membership. Last good inventory survives, affected data is withheld, and global discovery does not delete drives. LVM-only failure marks LVM coverage incomplete.&lt;br /&gt;
|-&lt;br /&gt;
| DPM OFF or reset || Retained CLI output produces an unavailable status and gaps. On re-enable, counter wrap or collector restart, the first valid sample seeds a fresh baseline; no spike is emitted.&lt;br /&gt;
|-&lt;br /&gt;
| Dashboard and delivery || At 1920×1080 all installed disks appear on the overview and IOPS graphs page. Check availability for an idle disk and a missing-report fixture. Confirm one Agent 2 fast request every five seconds and no per-drive shell executions for the WWN-equipped fleet.&lt;br /&gt;
|-&lt;br /&gt;
| Operational overhead || Across a representative backup window and a busy VM workload, record guarded collector elapsed/CPU time, missed five-second intervals, Zabbix queue delay, DB history growth, and host/application latency including p95/p99 where available. Compare DPM OFF, ON with no polling and ON at 5s. Investigate material workload changes before acceptance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting and rollback ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;The modern StorCLI reports DPM unsupported.&#039;&#039;&#039; Check the executable path. The successful combination on Wort is legacy StorCLI with &amp;lt;code&amp;gt;-DpmStat -Dsply&amp;lt;/code&amp;gt;. Firmware updates are a separate maintenance decision.&lt;br /&gt;
* &#039;&#039;&#039;The CLI returns figures that no longer move.&#039;&#039;&#039; Check the DPM header, expected/reported count, inventory age and sample timestamp. Compare counter deltas on an active member. A successful exit alone is insufficient.&lt;br /&gt;
* &#039;&#039;&#039;A bay is associated with the wrong identity or volume.&#039;&#039;&#039; Inspect fresh PD/VD inventory and the two identity guards. Force an inventory refresh. Keep the affected disk unavailable until the join is unambiguous; historical records retain the old physical key.&lt;br /&gt;
* &#039;&#039;&#039;Rollback.&#039;&#039;&#039; Disable the two master items or unlink the template while retaining history according to site policy. Stop the proposed inventory timer and remove the Agent 2 include through the normal change process. Restore the recorded DPM state; if the original state was OFF, run &amp;lt;code&amp;gt;sudo -n /usr/local/sbin/storcli64 /c0 set dpm=off&amp;lt;/code&amp;gt; and verify &amp;lt;code&amp;gt;/c0 show dpm&amp;lt;/code&amp;gt;. Verify controller and VD health and continued SMART health monitoring. Review history retention before any “unlink and clear” operation.&lt;br /&gt;
&lt;br /&gt;
== Document control ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Revision !! Date !! Record&lt;br /&gt;
|-&lt;br /&gt;
| 0.1 || 27 November 2026 || Design for review. Live controller, inventory normalization and host polling measurements verified. Record the template export revision, production acceptance date and measured retention cost when the build is commissioned.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [[KitsNet Operations:Monitoring:Zabbix]]&lt;br /&gt;
* [[KitsNet Operations:Services:Docker:High Availability NAS:Monitoring|KitsNet NAS HA Monitoring]] — local precedent for Agent 2 master items and Zabbix dependent items.&lt;br /&gt;
* [[KitsNet Operations:External Packages:Linux:MegaRAID Storage Manager]] — KitsNet&#039;s storage-management software notes.&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery Zabbix 7.0 low-level discovery] and [https://www.zabbix.com/documentation/7.0/en/manual/config/items/itemtypes/dependent_items dependent items].&lt;br /&gt;
* [https://www.zabbix.com/documentation/7.0/en/manual/discovery/low_level_discovery/graph_prototypes Zabbix graph prototypes], [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/graph_prototype graph prototype widget] and [https://www.zabbix.com/documentation/7.0/en/manual/web_interface/frontend_sections/dashboards/widgets/honeycomb honeycomb widget].&lt;br /&gt;
* [https://docs.broadcom.com/doc/pub-005681 Broadcom 12Gb/s MegaRAID SAS Software User Guide]. The command path and report behavior above were verified on the actual 9361-8i.&lt;br /&gt;
* Validation record, Wort, 27 November 2026: native &amp;lt;code&amp;gt;-DpmStat&amp;lt;/code&amp;gt; live captures, lookup of all PDs and VDs, five-second polling trials, off-state identity-guard timings and LVM inventory.&lt;br /&gt;
&lt;br /&gt;
[[Category:KitsNet Services]]&lt;br /&gt;
[[Category:Architecture]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Docker:High_Availability_NAS:Monitoring&amp;diff=2712</id>
		<title>KitsNet Operations:Services:Docker:High Availability NAS:Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Docker:High_Availability_NAS:Monitoring&amp;diff=2712"/>
		<updated>2026-11-19T15:26:42Z</updated>

		<summary type="html">&lt;p&gt;Psmode: /* Architecture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KitsNet NAS HA Monitoring =&lt;br /&gt;
&lt;br /&gt;
This document describes the design, implementation, operation, and recovery of the monitoring for the KitsNet Docker NAS high-availability system. It covers the read-only collector installed on Wort and the associated Zabbix instrumentation in the &#039;&#039;&#039;KitsNet NAS Hypervisor&#039;&#039;&#039; template.&lt;br /&gt;
&lt;br /&gt;
The monitoring release documented here is &#039;&#039;&#039;nas-ha-monitoring-r1&#039;&#039;&#039;. It supplements the Stage 4 revision 4 NAS HA implementation. It does not control failover, renew leases, attach or detach storage, restart NAS services, or enable or disable fencing.&lt;br /&gt;
&lt;br /&gt;
== Current accepted state ==&lt;br /&gt;
&lt;br /&gt;
The monitoring implementation was accepted on 9 September 2026 with the following state:&lt;br /&gt;
&lt;br /&gt;
* Wort was the libvirt hypervisor and storage arbiter.&lt;br /&gt;
* Fox (libvirt domain &amp;lt;code&amp;gt;uv059&amp;lt;/code&amp;gt;) was the active NAS owner and Keepalived MASTER.&lt;br /&gt;
* Anchor (libvirt domain &amp;lt;code&amp;gt;uv060&amp;lt;/code&amp;gt;) was the standby NAS and Keepalived BACKUP.&lt;br /&gt;
* The production logical volume was live-attached only to Fox as &amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Neither NAS domain contained the production disk in its persistent XML.&lt;br /&gt;
* Wort authority named Fox, generation 13, active.&lt;br /&gt;
* The active lease was valid with a 30-second limit.&lt;br /&gt;
* Production fencing was enabled through a valid &amp;lt;code&amp;gt;/etc/kitsnet-nas/fencing-enabled&amp;lt;/code&amp;gt; control file.&lt;br /&gt;
* The collector returned &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt;, completed in approximately 66–70 milliseconds, and was accessible through Zabbix Agent 2.&lt;br /&gt;
* Wort was running Zabbix Agent 2 version 7.0.28.&lt;br /&gt;
&lt;br /&gt;
The accepted Git commit is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1d1904d1ca9eedfa076358928fdf61999b7bc7a5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The annotated release tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nas-ha-monitoring-r1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Monitoring objectives ==&lt;br /&gt;
&lt;br /&gt;
The monitoring has four distinct objectives:&lt;br /&gt;
&lt;br /&gt;
# Show whether the complete HA system is internally coherent now.&lt;br /&gt;
# Show how close the current owner is to losing lease freshness.&lt;br /&gt;
# Detect storage-attachment states that could threaten data integrity.&lt;br /&gt;
# Surface hypervisor scheduling pressure that could delay the owner guest and its heartbeat.&lt;br /&gt;
&lt;br /&gt;
The lease metrics are the most direct early warning of an approaching takeover opportunity. vCPU scheduler delay is supporting evidence: it can explain why a guest is responding slowly, but scheduler delay alone does not initiate failover.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
The monitoring uses one read-only JSON master item and Zabbix dependent items.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort state files and libvirt XML&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
/usr/local/sbin/kitsnet-nas-ha-status&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
Zabbix Agent 2 item: kitsnet.nas.ha.status&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
Zabbix server JSONPath preprocessing&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
Dependent metrics, triggers, and lease graph&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
An independent, browser-based status dashboard is also hosted on Wort. See [[#Web-Based NAS HA Status Dashboard|Web-Based NAS HA Status Dashboard]] for access, operation, and troubleshooting.&lt;br /&gt;
&lt;br /&gt;
Every five seconds, Zabbix requests one JSON document from Wort. Zabbix then extracts all individual HA values from that document. This provides a time-consistent snapshot and avoids running a separate privileged command for every metric.&lt;br /&gt;
&lt;br /&gt;
The pre-existing vCPU scheduler-delay collectors remain separate because they maintain per-domain counters and calculate change over time.&lt;br /&gt;
&lt;br /&gt;
== Web-Based NAS HA Status Dashboard ==&lt;br /&gt;
&lt;br /&gt;
On 19 November 2026, a browser-based, read-only NAS HA status dashboard was installed on Wort. It provides an immediately understandable, color-coded view of the current HA state without requiring access to Zabbix or interpreting the collector&#039;s raw JSON output.&lt;br /&gt;
&lt;br /&gt;
The dashboard supplements the existing Zabbix monitoring. It does not replace Zabbix&#039;s historical data collection, graphs, triggers, or alerting.&lt;br /&gt;
&lt;br /&gt;
=== Access ===&lt;br /&gt;
&lt;br /&gt;
The dashboard is available from a browser on the KitsNet management network:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[http://wort.lan.kitsnet.us/nas-ha/ KitsNet NAS HA Status Dashboard]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Direct URLs:&lt;br /&gt;
&lt;br /&gt;
* Dashboard: http://wort.lan.kitsnet.us/nas-ha/&lt;br /&gt;
* Current JSON snapshot: http://wort.lan.kitsnet.us/nas-ha/status.json&lt;br /&gt;
&lt;br /&gt;
The dashboard refreshes automatically approximately every 10 seconds. No manual refresh is normally necessary.&lt;br /&gt;
&lt;br /&gt;
Access should remain restricted to authorized internal networks or VPN connections. The current deployment uses HTTP rather than HTTPS.&lt;br /&gt;
&lt;br /&gt;
=== Display and interpretation ===&lt;br /&gt;
&lt;br /&gt;
The page displays:&lt;br /&gt;
&lt;br /&gt;
* Overall HA health, prominently color-coded.&lt;br /&gt;
* Current authoritative MASTER (Fox or Anchor).&lt;br /&gt;
* Standby NAS member.&lt;br /&gt;
* Current production disk owner.&lt;br /&gt;
* Remaining authority lease headroom.&lt;br /&gt;
* A table of 13 HA integrity checks, each with its observed value and result.&lt;br /&gt;
* An expandable section containing the original collector JSON.&lt;br /&gt;
* The last collection timestamp and age of the displayed snapshot.&lt;br /&gt;
&lt;br /&gt;
The overall status uses these classifications:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Display status&lt;br /&gt;
! Color&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| HEALTHY&lt;br /&gt;
| Green&lt;br /&gt;
| All dashboard integrity checks pass.&lt;br /&gt;
|-&lt;br /&gt;
| DEGRADED&lt;br /&gt;
| Amber&lt;br /&gt;
| No critical check failed, but one or more warning conditions exist.&lt;br /&gt;
|-&lt;br /&gt;
| CRITICAL&lt;br /&gt;
| Red&lt;br /&gt;
| At least one critical HA integrity check failed.&lt;br /&gt;
|-&lt;br /&gt;
| STATUS UNKNOWN&lt;br /&gt;
| Gray&lt;br /&gt;
| Status collection failed or the dashboard cannot obtain a valid current snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| STALE / UNKNOWN&lt;br /&gt;
| Gray&lt;br /&gt;
| The last collected snapshot is more than 30 seconds old. The previous healthy state must not be interpreted as current.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A successful failover to Anchor is considered healthy when the authority, intents, lease, fencing, and disk ownership are mutually consistent. The dashboard does not require Fox to remain MASTER.&lt;br /&gt;
&lt;br /&gt;
The individual checks cover collection success, HA coherence, authority, active and standby VM states, MASTER and BACKUP intents, production disk ownership, live and persistent disk attachments, fencing validity, lease validity, and lease headroom.&lt;br /&gt;
&lt;br /&gt;
Lease headroom below 10 seconds is classified as a warning; zero or negative headroom is critical.&lt;br /&gt;
&lt;br /&gt;
The dashboard&#039;s classifications are intended for immediate operational visibility. Zabbix remains the authoritative source for historical trends, time-based trigger evaluation, and alert severity escalation.&lt;br /&gt;
&lt;br /&gt;
=== Architecture ===&lt;br /&gt;
&lt;br /&gt;
The dashboard runs entirely on Wort, independently of the Fox and Anchor NAS filesystems.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort HA state and libvirt&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
/usr/local/sbin/kitsnet-nas-ha-status&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
Root-owned Python web collector&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
/var/www/html/nas-ha/status.json&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
Apache HTTPD on Wort&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
Browser dashboard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The existing read-only HA status collector is reused unchanged.&lt;br /&gt;
&lt;br /&gt;
A systemd timer invokes a Python formatter approximately every 10 seconds. The formatter executes the HA collector, evaluates the result, and atomically publishes a JSON status snapshot.&lt;br /&gt;
&lt;br /&gt;
Apache serves only static HTML and JSON files. No CGI, server-side application framework, database, or privileged Apache execution is required.&lt;br /&gt;
&lt;br /&gt;
The dashboard is located on Wort&#039;s local &amp;lt;code&amp;gt;/var&amp;lt;/code&amp;gt; XFS filesystem, backed by &amp;lt;code&amp;gt;/dev/mapper/T0h-var&amp;lt;/code&amp;gt;. Consequently, the page and its collector do not depend on the availability of the production HA NAS storage.&lt;br /&gt;
&lt;br /&gt;
The Python collector runs as root through a systemd oneshot service because the underlying HA state requires privileged access. Apache itself does not receive those privileges.&lt;br /&gt;
&lt;br /&gt;
=== Installed files and services ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose&lt;br /&gt;
! Location&lt;br /&gt;
|-&lt;br /&gt;
| Existing read-only HA collector&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Web dashboard collector and formatter&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/libexec/kitsnet-nas-ha-web.py&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dashboard HTML and JavaScript&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/www/html/nas-ha/index.html&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Current JSON snapshot&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/www/html/nas-ha/status.json&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| systemd collection service&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/systemd/system/kitsnet-nas-ha-web.service&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| systemd collection timer&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/systemd/system/kitsnet-nas-ha-web.timer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Web server&lt;br /&gt;
| Existing Apache HTTPD on Wort&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The collection timer is enabled to start at boot. Its configuration uses &amp;lt;code&amp;gt;OnUnitInactiveSec=10s&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AccuracySec=1s&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The collector has a seven-second command timeout and publishes an UNKNOWN result if execution or JSON processing fails.&lt;br /&gt;
&lt;br /&gt;
A browser-side stale-data check independently verifies snapshot freshness. If collection stops, an old green status changes to STALE / UNKNOWN after 30 seconds rather than continuing to report HEALTHY.&lt;br /&gt;
&lt;br /&gt;
=== Operational commands ===&lt;br /&gt;
&lt;br /&gt;
To check the timer and collector service on Wort:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status kitsnet-nas-ha-web.timer&lt;br /&gt;
systemctl status kitsnet-nas-ha-web.service&lt;br /&gt;
systemctl list-timers kitsnet-nas-ha-web.timer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To execute an immediate collection:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl start kitsnet-nas-ha-web.service&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To inspect the current snapshot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo python3 -m json.tool \&lt;br /&gt;
    /var/www/html/nas-ha/status.json&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To confirm that Apache serves the dashboard:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
curl -I http://127.0.0.1/nas-ha/&lt;br /&gt;
curl -I http://127.0.0.1/nas-ha/status.json&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both HTTP requests should normally return &amp;lt;code&amp;gt;200 OK&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To inspect collection errors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo journalctl -u kitsnet-nas-ha-web.service \&lt;br /&gt;
    --since &amp;quot;1 hour ago&amp;quot; --no-pager&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the timer is stopped or disabled, restart it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl enable --now kitsnet-nas-ha-web.timer&lt;br /&gt;
sudo systemctl start kitsnet-nas-ha-web.service&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These commands affect only the dashboard monitoring components. They do not initiate failover or alter HA disk ownership.&lt;br /&gt;
&lt;br /&gt;
=== Historical monitoring and Zabbix integration ===&lt;br /&gt;
&lt;br /&gt;
The web dashboard is a current-state display. It replaces its JSON snapshot during each collection and does not maintain a historical database.&lt;br /&gt;
&lt;br /&gt;
Historical monitoring remains the responsibility of the existing Zabbix implementation, which collects the HA master JSON item every five seconds and maintains dependent items according to their configured history and trend-retention settings.&lt;br /&gt;
&lt;br /&gt;
Use Zabbix for:&lt;br /&gt;
&lt;br /&gt;
* Historical lease age and headroom.&lt;br /&gt;
* HA coherence transitions and changes of MASTER.&lt;br /&gt;
* Collector performance trends.&lt;br /&gt;
* Historical fencing and disk-attachment observations.&lt;br /&gt;
* Fox and Anchor vCPU scheduling-delay history.&lt;br /&gt;
* Trigger history, event duration, and escalation.&lt;br /&gt;
&lt;br /&gt;
The existing Zabbix graphs are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS HA Lease&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS vCPU Scheduler Delay&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are available through the Wort host&#039;s graphs in Zabbix.&lt;br /&gt;
&lt;br /&gt;
The web dashboard and Zabbix independently invoke the same underlying read-only collector. Neither depends on the other&#039;s availability.&lt;br /&gt;
&lt;br /&gt;
=== Initial deployment verification ===&lt;br /&gt;
&lt;br /&gt;
The installation was verified on 19 November 2026:&lt;br /&gt;
&lt;br /&gt;
* Apache returned HTTP 200 for both the dashboard and JSON snapshot.&lt;br /&gt;
* The systemd timer was active and enabled.&lt;br /&gt;
* Automatic collections were occurring approximately every 10 seconds.&lt;br /&gt;
* All 13 dashboard integrity checks passed.&lt;br /&gt;
* The authoritative owner was Fox, generation 51.&lt;br /&gt;
* Anchor was running as BACKUP.&lt;br /&gt;
* Exactly one live production disk attachment existed, owned by Fox.&lt;br /&gt;
* No persistent production disk attachments existed.&lt;br /&gt;
* Fencing and the authority lease were valid.&lt;br /&gt;
* Observed collection duration was approximately 65–72 milliseconds.&lt;br /&gt;
&lt;br /&gt;
The initial browser display reported HEALTHY.&lt;br /&gt;
&lt;br /&gt;
These are deployment observations, not permanently expected ownership or generation values.&lt;br /&gt;
&lt;br /&gt;
=== Scope and change control ===&lt;br /&gt;
&lt;br /&gt;
The dashboard is an operational presentation layer added after the original &amp;lt;code&amp;gt;nas-ha-monitoring-r1&amp;lt;/code&amp;gt; release.&lt;br /&gt;
&lt;br /&gt;
It is not part of the original annotated release tag or accepted file hashes documented elsewhere on this page.&lt;br /&gt;
&lt;br /&gt;
The dashboard does not:&lt;br /&gt;
&lt;br /&gt;
* Modify authority or intent records.&lt;br /&gt;
* Renew or invalidate leases.&lt;br /&gt;
* Enable or disable fencing.&lt;br /&gt;
* Attach or detach production storage.&lt;br /&gt;
* Start, stop, or restart either NAS VM.&lt;br /&gt;
* Initiate a failover or recovery operation.&lt;br /&gt;
&lt;br /&gt;
Changes to the dashboard must not modify the underlying Stage 4 r4 HA control mechanisms.&lt;br /&gt;
&lt;br /&gt;
During a Wort rebuild, restore the base HA system and its existing collector first. Restore the Apache dashboard files and systemd units only after the underlying collector is functioning correctly.&lt;br /&gt;
&lt;br /&gt;
The dashboard is an additional operational tool, not a replacement for the existing Zabbix monitoring release or its historical data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data sources on Wort ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Source&lt;br /&gt;
! Information used&lt;br /&gt;
! Persistence&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/lib/kitsnet-nas-arbiter/owner.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Authoritative owner, generation, and active status&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/lib/kitsnet-nas-arbiter/fox.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last published Fox intent and generation&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/lib/kitsnet-nas-arbiter/anchor.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last published Anchor intent and generation&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/run/kitsnet-nas-arbiter/lease.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Current owner lease, generation, boot identifier, and monotonic timestamp&lt;br /&gt;
| Runtime; recreated after boot&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/proc/sys/kernel/random/boot_id&amp;lt;/code&amp;gt;&lt;br /&gt;
| Confirms that the lease belongs to the current Wort boot&lt;br /&gt;
| Runtime&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/proc/uptime&amp;lt;/code&amp;gt; through Python monotonic time&lt;br /&gt;
| Calculates lease age without wall-clock dependence&lt;br /&gt;
| Runtime&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/kitsnet-nas/fencing-enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
| Confirms that production fencing is enabled with the required content, type, mode, and ownership&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| libvirt live domain XML&lt;br /&gt;
| Shows which running domain owns the production LV as &amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt;&lt;br /&gt;
| Runtime&lt;br /&gt;
|-&lt;br /&gt;
| libvirt inactive domain XML&lt;br /&gt;
| Detects any prohibited persistent production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; definition&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| libvirt domain state&lt;br /&gt;
| Confirms whether Fox and Anchor are running&lt;br /&gt;
| Runtime&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The production source matched by the collector is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/dev/T1/uv059-dkrnfs1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The collector recognizes only these owner-to-domain mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! HA owner&lt;br /&gt;
! Libvirt domain&lt;br /&gt;
|-&lt;br /&gt;
| Fox&lt;br /&gt;
| &amp;lt;code&amp;gt;uv059&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Anchor&lt;br /&gt;
| &amp;lt;code&amp;gt;uv060&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Collector design ==&lt;br /&gt;
&lt;br /&gt;
=== Read-only behavior ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;kitsnet-nas-ha-status&amp;lt;/code&amp;gt; performs only file reads and these libvirt queries:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;virsh domstate&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;virsh dumpxml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;virsh dumpxml --inactive&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It does not call &amp;lt;code&amp;gt;kitsnet-nas-storage&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-nas-intent&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;virsh destroy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;virsh attach-disk&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;virsh detach-disk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The collector always attempts to return valid JSON. If collection raises an exception, it returns &amp;lt;code&amp;gt;collection_ok=0&amp;lt;/code&amp;gt; and a bounded error string rather than emitting partial normal data.&lt;br /&gt;
&lt;br /&gt;
=== Lease calculation ===&lt;br /&gt;
&lt;br /&gt;
For an active authority, the configured lease limit is 30 seconds. During acquisition, before the authority becomes active, the limit is 60 seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;lease age = Wort monotonic time - stored lease monotonic time&lt;br /&gt;
lease headroom = applicable lease limit - lease age&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A lease is valid only when all of the following are true:&lt;br /&gt;
&lt;br /&gt;
* The authority owner is Fox or Anchor.&lt;br /&gt;
* The lease owner matches the authority owner.&lt;br /&gt;
* The lease generation matches the authority generation.&lt;br /&gt;
* The lease boot identifier matches the current Wort boot identifier.&lt;br /&gt;
* The calculated age is between -1 second and the applicable lease limit.&lt;br /&gt;
&lt;br /&gt;
The one-second negative allowance tolerates insignificant numeric timing effects. It does not permit a lease from another boot or generation.&lt;br /&gt;
&lt;br /&gt;
=== Coherence classification ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Code&lt;br /&gt;
! State&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;HEALTHY_ANCHOR&amp;lt;/code&amp;gt;&lt;br /&gt;
| Authority, lease, intent, domain, fencing, and disk attachment agree.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;TRANSITION_NO_OWNER&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;TRANSITION_ACQUIRING&amp;lt;/code&amp;gt;&lt;br /&gt;
| A normally brief interval exists between release and activation.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;INCONSISTENT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;DEGRADED_FENCING_CONTROL&amp;lt;/code&amp;gt;&lt;br /&gt;
| The state cannot be accepted as fully coherent, or the fencing control is invalid.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;UNSAFE_ATTACHMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
| The production LV appears live on more than one NAS domain, or appears in persistent domain XML.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The collector evaluates unsafe attachment before all other classifications. An invalid fencing control is evaluated next. A healthy result requires:&lt;br /&gt;
&lt;br /&gt;
* exactly one active authority owner;&lt;br /&gt;
* a valid current lease;&lt;br /&gt;
* exactly one live production-disk attachment on that same owner;&lt;br /&gt;
* a matching MASTER intent and generation for the owner;&lt;br /&gt;
* a BACKUP intent for the peer;&lt;br /&gt;
* both NAS domains running;&lt;br /&gt;
* valid production fencing control; and&lt;br /&gt;
* no persistent production-disk attachment.&lt;br /&gt;
&lt;br /&gt;
== Installed files and Git mapping ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose&lt;br /&gt;
! Canonical Git path&lt;br /&gt;
! Deployment mirror or live path&lt;br /&gt;
|-&lt;br /&gt;
| Complete monitoring release&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/&amp;lt;/code&amp;gt;&lt;br /&gt;
| Not deployed as a directory&lt;br /&gt;
|-&lt;br /&gt;
| JSON collector&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;scripts/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Wort: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Zabbix user parameter&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;configs/nas/kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Wort: &amp;lt;code&amp;gt;/etc/zabbix/zabbix_agent2.d/kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Restricted sudo rule&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/zabbix-kitsnet-nas-ha-status.sudoers&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;configs/sudoers/zabbix-kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Wort: &amp;lt;code&amp;gt;/etc/sudoers.d/zabbix-kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Zabbix template&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;configs/nas/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Imported into Zabbix&lt;br /&gt;
|-&lt;br /&gt;
| Deployment controller&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/install-monitoring-on-wort.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
| Run from &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Release notes&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/README.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
| Documentation within the Git release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The MediaWiki documentation is intentionally not stored in Git. MediaWiki page history provides document versioning.&lt;br /&gt;
&lt;br /&gt;
=== Accepted file hashes ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File&lt;br /&gt;
! SHA-256&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;e3760679256dd282171c0cbc384d8d886e994ff83dcb3382e75abf4cf694c13d&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;c1a358b68d7b736907fe6a8c616cf8771ed8b0af0906f1183e01dcabdc6d4299&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;zabbix-kitsnet-nas-ha-status.sudoers&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;f346f2ad0d9f2a30b9917130d15f3e496722c280fa9145cc3b9eebef6d9b183d&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;install-monitoring-on-wort.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;eec85001bd3496022bf98b1e8405adb6629805733144aef0d1aa1a82c2b2d7f3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;README.txt&amp;lt;/code&amp;gt; source&lt;br /&gt;
| &amp;lt;code&amp;gt;4784f4faf7fe29be97b453e8690b8398ac4a80e5eb5ac6d5f5845b26d8c2c606&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;7ad02ed3c5fae21040dc2dba6f09dc31bd7837803cc86dd7d277e310d1bbf372&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Zabbix implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Master item ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Item&lt;br /&gt;
! Key&lt;br /&gt;
! Interval&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| NAS HA status JSON&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.status&amp;lt;/code&amp;gt;&lt;br /&gt;
| 5 seconds&lt;br /&gt;
| Zabbix agent passive item, text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The user parameter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;UserParameter=kitsnet.nas.ha.status,/usr/bin/sudo -n /usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding sudo rule permits the Zabbix account to execute only the read-only collector as root:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;zabbix ALL=(root) NOPASSWD: /usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Root access is required because the durable arbiter state and fencing control are intentionally protected from ordinary users. The collector does not need SSH access to Fox or Anchor.&lt;br /&gt;
&lt;br /&gt;
=== Dependent items ===&lt;br /&gt;
&lt;br /&gt;
All following items are populated from the master JSON using JSONPath preprocessing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Zabbix item key&lt;br /&gt;
! Value&lt;br /&gt;
! Normal stable value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.collection.ok&amp;lt;/code&amp;gt;&lt;br /&gt;
| Whether the complete collection completed&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.collection.duration&amp;lt;/code&amp;gt;&lt;br /&gt;
| Collection duration in milliseconds&lt;br /&gt;
| Normally well below 1,000 ms&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.coherence.code&amp;lt;/code&amp;gt;&lt;br /&gt;
| Numeric overall classification&lt;br /&gt;
| &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.coherence.state&amp;lt;/code&amp;gt;&lt;br /&gt;
| Human-readable overall classification&lt;br /&gt;
| &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;HEALTHY_ANCHOR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.authority.owner&amp;lt;/code&amp;gt;&lt;br /&gt;
| Wort authoritative owner&lt;br /&gt;
| &amp;lt;code&amp;gt;fox&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;anchor&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.authority.generation&amp;lt;/code&amp;gt;&lt;br /&gt;
| Current authority generation&lt;br /&gt;
| Positive integer; must match the owner intent&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.authority.active&amp;lt;/code&amp;gt;&lt;br /&gt;
| Whether the authority has completed activation&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.age&amp;lt;/code&amp;gt;&lt;br /&gt;
| Seconds since the last accepted heartbeat refresh&lt;br /&gt;
| Normally near 0–3 seconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.limit&amp;lt;/code&amp;gt;&lt;br /&gt;
| Applicable lease limit&lt;br /&gt;
| &amp;lt;code&amp;gt;30&amp;lt;/code&amp;gt; while active; &amp;lt;code&amp;gt;60&amp;lt;/code&amp;gt; while acquiring&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.headroom&amp;lt;/code&amp;gt;&lt;br /&gt;
| Seconds remaining before the applicable limit&lt;br /&gt;
| Normally near 27–30 seconds while active&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.valid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Owner, generation, boot, and age validation result&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.fencing.valid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Strict fencing-control validation&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.fox.state&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last durable Fox intent&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BACKUP&amp;lt;/code&amp;gt;, according to ownership&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.fox.generation&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fox intent generation&lt;br /&gt;
| Matches authority generation when Fox owns storage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.anchor.state&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last durable Anchor intent&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BACKUP&amp;lt;/code&amp;gt;, according to ownership&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.anchor.generation&amp;lt;/code&amp;gt;&lt;br /&gt;
| Anchor intent generation&lt;br /&gt;
| Matches authority generation when Anchor owns storage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.domain.fox.running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fox libvirt running state&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.domain.anchor.running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Anchor libvirt running state&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.live.count&amp;lt;/code&amp;gt;&lt;br /&gt;
| Total live production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; attachments&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.live.owner&amp;lt;/code&amp;gt;&lt;br /&gt;
| Domain owner of the sole live production disk&lt;br /&gt;
| Same as authority owner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.fox.live&amp;lt;/code&amp;gt;&lt;br /&gt;
| Production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; count in Fox live XML&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when Fox owns; otherwise &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.anchor.live&amp;lt;/code&amp;gt;&lt;br /&gt;
| Production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; count in Anchor live XML&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when Anchor owns; otherwise &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.persistent.count&amp;lt;/code&amp;gt;&lt;br /&gt;
| Total production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; entries in inactive domain XML&lt;br /&gt;
| &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Existing scheduler-delay items ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Guest&lt;br /&gt;
! Zabbix key&lt;br /&gt;
! Interval&lt;br /&gt;
|-&lt;br /&gt;
| Fox / &amp;lt;code&amp;gt;uv059&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.libvirt.vcpu.delay[uv059]&amp;lt;/code&amp;gt;&lt;br /&gt;
| 30 seconds&lt;br /&gt;
|-&lt;br /&gt;
| Anchor / &amp;lt;code&amp;gt;uv060&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.libvirt.vcpu.delay[uv060]&amp;lt;/code&amp;gt;&lt;br /&gt;
| 30 seconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The helper &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-vcpu-delay-percent&amp;lt;/code&amp;gt; calculates the increase in cumulative libvirt vCPU delay divided by elapsed time and the number of vCPUs. The result estimates the percentage of requested vCPU execution time spent waiting for host scheduling.&lt;br /&gt;
&lt;br /&gt;
The first sample after state creation returns zero because no prior counter exists. Counter rollback, non-positive elapsed time, or an invalid vCPU count also returns zero rather than a misleading negative value.&lt;br /&gt;
&lt;br /&gt;
== Trigger thresholds ==&lt;br /&gt;
&lt;br /&gt;
=== HA triggers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Condition&lt;br /&gt;
! Persistence&lt;br /&gt;
! Severity&lt;br /&gt;
! Operational meaning&lt;br /&gt;
|-&lt;br /&gt;
| No master JSON data&lt;br /&gt;
| 30 seconds&lt;br /&gt;
| High&lt;br /&gt;
| Agent, user parameter, collector, or communication path is unavailable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;collection_ok=0&amp;lt;/code&amp;gt;&lt;br /&gt;
| 15 seconds&lt;br /&gt;
| High&lt;br /&gt;
| The collector is returning controlled failure snapshots.&lt;br /&gt;
|-&lt;br /&gt;
| Collection duration above 1,000 ms&lt;br /&gt;
| 5 minutes&lt;br /&gt;
| Warning&lt;br /&gt;
| Wort or libvirt query latency is elevated.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence code 1&lt;br /&gt;
| Continuously for 20 seconds&lt;br /&gt;
| Warning&lt;br /&gt;
| A release or acquisition transition is taking too long.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence code 2&lt;br /&gt;
| Continuously for 15 seconds&lt;br /&gt;
| High&lt;br /&gt;
| Authority, lease, intent, domain, disk, or fencing state is inconsistent.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence code 3&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| Storage attachment is unsafe.&lt;br /&gt;
|-&lt;br /&gt;
| Lease age above 10 seconds&lt;br /&gt;
| Continuously for 15 seconds&lt;br /&gt;
| Warning&lt;br /&gt;
| Heartbeat delivery is delayed well beyond its normal two-second interval.&lt;br /&gt;
|-&lt;br /&gt;
| Lease age above 20 seconds&lt;br /&gt;
| Continuously for 10 seconds&lt;br /&gt;
| High&lt;br /&gt;
| The owner has little active-lease headroom remaining.&lt;br /&gt;
|-&lt;br /&gt;
| Lease age above 25 seconds&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| The active lease is within five seconds of its 30-second limit.&lt;br /&gt;
|-&lt;br /&gt;
| Lease invalid&lt;br /&gt;
| Continuously for 10 seconds&lt;br /&gt;
| High&lt;br /&gt;
| Owner, generation, boot identifier, or age validation failed.&lt;br /&gt;
|-&lt;br /&gt;
| Fencing control invalid or disabled&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| Automatic fencing cannot be considered fully operational.&lt;br /&gt;
|-&lt;br /&gt;
| Fox or Anchor domain not running&lt;br /&gt;
| Continuously for 15 seconds&lt;br /&gt;
| High&lt;br /&gt;
| A NAS member is unavailable, including a node deliberately destroyed during fencing.&lt;br /&gt;
|-&lt;br /&gt;
| More than one live production-disk attachment&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| Possible double attachment; treat as a data-integrity emergency.&lt;br /&gt;
|-&lt;br /&gt;
| No live production-disk attachment&lt;br /&gt;
| Continuously for 20 seconds&lt;br /&gt;
| High&lt;br /&gt;
| No NAS node has served as production storage owner for too long.&lt;br /&gt;
|-&lt;br /&gt;
| Any persistent production-disk attachment&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| The deployment violates the live-attachment-only design.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The lease-age triggers intentionally overlap. During a worsening event, Zabbix may show Warning, High, and Disaster problems together. The highest severity describes the current urgency; the earlier events preserve the escalation timeline.&lt;br /&gt;
&lt;br /&gt;
=== Scheduler-delay triggers ===&lt;br /&gt;
&lt;br /&gt;
The same thresholds apply separately to Fox and Anchor.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Delay&lt;br /&gt;
! Persistence&lt;br /&gt;
! Severity&lt;br /&gt;
|-&lt;br /&gt;
| Above 5 percent&lt;br /&gt;
| 5 minutes&lt;br /&gt;
| Warning&lt;br /&gt;
|-&lt;br /&gt;
| Above 15 percent&lt;br /&gt;
| 2 minutes&lt;br /&gt;
| High&lt;br /&gt;
|-&lt;br /&gt;
| Above 30 percent&lt;br /&gt;
| 1 minute&lt;br /&gt;
| Disaster&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Scheduler delay is a pressure indicator, not proof that a failover is imminent. Interpret it alongside lease age, collector duration, guest service monitoring, and host resource pressure.&lt;br /&gt;
&lt;br /&gt;
== Graphs ==&lt;br /&gt;
&lt;br /&gt;
The template contains two graphs:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS HA Lease&#039;&#039;&#039; — lease age, lease headroom, and the applicable limit.&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS vCPU Scheduler Delay&#039;&#039;&#039; — Fox and Anchor scheduler-delay percentages.&lt;br /&gt;
&lt;br /&gt;
The lease graph is the clearest historical view of proximity to a stale-owner condition. Under normal operation, lease age remains near the bottom of the graph and headroom remains near the 30-second limit.&lt;br /&gt;
&lt;br /&gt;
== Initial deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Preconditions ===&lt;br /&gt;
&lt;br /&gt;
Before installation:&lt;br /&gt;
&lt;br /&gt;
* Stage 4 r4 NAS HA must already be installed and accepted.&lt;br /&gt;
* Wort must have Zabbix Agent 2, Python 3, sudo, and libvirt tools.&lt;br /&gt;
* The &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt; identity on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; must have a working SSH agent identity for Wort.&lt;br /&gt;
* Do not use &amp;lt;code&amp;gt;IdentitiesOnly=yes&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Connect to Wort as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt; and use sudo on Wort; do not open inbound root SSH.&lt;br /&gt;
* Confirm that the NAS state is stable before using installation acceptance checks.&lt;br /&gt;
&lt;br /&gt;
=== Install or reinstall from Git ===&lt;br /&gt;
&lt;br /&gt;
Run this on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for i in {1..10}; do echo; done&lt;br /&gt;
repo=/srv/git/KNdkr&lt;br /&gt;
report=/tmp/nas-ha-monitoring-install.log&lt;br /&gt;
&lt;br /&gt;
install_nas_monitoring()&lt;br /&gt;
(&lt;br /&gt;
    set -Eeuo pipefail&lt;br /&gt;
    cd &amp;quot;$repo&amp;quot;&lt;br /&gt;
    test &amp;quot;$(git branch --show-current)&amp;quot; = master&lt;br /&gt;
    git fetch --quiet origin master&lt;br /&gt;
    test &amp;quot;$(git rev-parse HEAD)&amp;quot; = &amp;quot;$(git rev-parse origin/master)&amp;quot;&lt;br /&gt;
    git tag -v nas-ha-monitoring-r1 2&amp;gt;/dev/null ||&lt;br /&gt;
        git tag -n99 nas-ha-monitoring-r1&lt;br /&gt;
    src/nas-ha-monitoring/install-monitoring-on-wort.sh&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
install_nas_monitoring 2&amp;gt;&amp;amp;1 | tee &amp;quot;$report&amp;quot;&lt;br /&gt;
install_rc=${PIPESTATUS[0]}&lt;br /&gt;
echo &amp;quot;install_rc=$install_rc&amp;quot;&lt;br /&gt;
echo &amp;quot;saved_output=$report&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer:&lt;br /&gt;
&lt;br /&gt;
# copies the three Wort deployment files through an SSH session initiated as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;;&lt;br /&gt;
# validates Python syntax and the sudoers fragment before installation;&lt;br /&gt;
# refuses to overwrite a different existing deployment;&lt;br /&gt;
# installs the collector as mode 0755;&lt;br /&gt;
# installs the Zabbix configuration as mode 0644;&lt;br /&gt;
# installs the sudoers fragment as mode 0440;&lt;br /&gt;
# restores SELinux file contexts when &amp;lt;code&amp;gt;restorecon&amp;lt;/code&amp;gt; is available;&lt;br /&gt;
# runs the collector as the Zabbix account;&lt;br /&gt;
# requires a healthy, valid, single-owner production state; and&lt;br /&gt;
# restarts only &amp;lt;code&amp;gt;zabbix-agent2.service&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It does not restart Keepalived, NFS, Veeam, heartbeat, or transition services. It does not alter fencing or disk attachments.&lt;br /&gt;
&lt;br /&gt;
=== Import the Zabbix template ===&lt;br /&gt;
&lt;br /&gt;
In Zabbix:&lt;br /&gt;
&lt;br /&gt;
# Open &#039;&#039;&#039;Data collection → Templates&#039;&#039;&#039;.&lt;br /&gt;
# Select &#039;&#039;&#039;Import&#039;&#039;&#039;.&lt;br /&gt;
# Select &amp;lt;code&amp;gt;src/nas-ha-monitoring/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;, or a verified copy of that file.&lt;br /&gt;
# Enable &#039;&#039;&#039;Create new&#039;&#039;&#039;.&lt;br /&gt;
# Enable &#039;&#039;&#039;Update existing&#039;&#039;&#039;.&lt;br /&gt;
# Leave &#039;&#039;&#039;Delete missing&#039;&#039;&#039; disabled.&lt;br /&gt;
# Review the proposed changes and import.&lt;br /&gt;
&lt;br /&gt;
The release preserves the existing template UUID, vCPU item UUIDs, vCPU trigger UUIDs, and scheduler-delay graph UUID. The existing template group name &amp;lt;code&amp;gt;Templates/Montioring&amp;lt;/code&amp;gt;, including its historical spelling, is also preserved.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;KitsNet NAS Hypervisor&#039;&#039;&#039; template is already linked to the Wort host, the new items are inherited automatically. Otherwise, link the template to Wort after import.&lt;br /&gt;
&lt;br /&gt;
== Verification ==&lt;br /&gt;
&lt;br /&gt;
=== Wort collector verification ===&lt;br /&gt;
&lt;br /&gt;
Run from &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for i in {1..10}; do echo; done&lt;br /&gt;
report=/tmp/nas-ha-monitoring-verification.log&lt;br /&gt;
&lt;br /&gt;
verify_nas_monitoring()&lt;br /&gt;
(&lt;br /&gt;
    set -Eeuo pipefail&lt;br /&gt;
    ssh -o BatchMode=yes psmode@wort.lan.kitsnet.us &#039;sudo -n bash -s&#039; &amp;lt;&amp;lt;&#039;REMOTE&#039;&lt;br /&gt;
sha256sum \&lt;br /&gt;
    /usr/local/sbin/kitsnet-nas-ha-status \&lt;br /&gt;
    /etc/zabbix/zabbix_agent2.d/kitsnet-nas-ha-status.conf \&lt;br /&gt;
    /etc/sudoers.d/zabbix-kitsnet-nas-ha-status&lt;br /&gt;
systemctl is-active zabbix-agent2.service&lt;br /&gt;
sudo -u zabbix sudo -n /usr/local/sbin/kitsnet-nas-ha-status |&lt;br /&gt;
    python3 -m json.tool&lt;br /&gt;
zabbix_agent2 -t kitsnet.nas.ha.status&lt;br /&gt;
REMOTE&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
verify_nas_monitoring 2&amp;gt;&amp;amp;1 | tee &amp;quot;$report&amp;quot;&lt;br /&gt;
verification_rc=${PIPESTATUS[0]}&lt;br /&gt;
echo &amp;quot;verification_rc=$verification_rc&amp;quot;&lt;br /&gt;
echo &amp;quot;saved_output=$report&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A normal stable result has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
collection_ok=1&lt;br /&gt;
coherence_code=0&lt;br /&gt;
fencing_control_valid=1&lt;br /&gt;
lease_valid=1&lt;br /&gt;
live_production_vdb_count=1&lt;br /&gt;
persistent_production_vdb_count=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The owner may legitimately be Fox or Anchor. Do not encode generation 13 or Fox ownership as permanent monitoring expectations.&lt;br /&gt;
&lt;br /&gt;
=== Zabbix verification ===&lt;br /&gt;
&lt;br /&gt;
After at least 30 seconds:&lt;br /&gt;
&lt;br /&gt;
# Open &#039;&#039;&#039;Monitoring → Latest data&#039;&#039;&#039;.&lt;br /&gt;
# Select the Wort host.&lt;br /&gt;
# Filter the item name by &amp;lt;code&amp;gt;NAS HA&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Confirm that the master item and every dependent item are supported and have current timestamps.&lt;br /&gt;
# Confirm that the normal stable values listed above are present.&lt;br /&gt;
# Open &#039;&#039;&#039;Monitoring → Hosts → Graphs&#039;&#039;&#039; for Wort and inspect &#039;&#039;&#039;KitsNet NAS HA Lease&#039;&#039;&#039;.&lt;br /&gt;
# Confirm that no new HA problem is open under &#039;&#039;&#039;Monitoring → Problems&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the master item has a value but dependent items do not, inspect preprocessing errors on the dependent items. If the master item is unsupported, test the user parameter directly on Wort before changing the template.&lt;br /&gt;
&lt;br /&gt;
== Operational interpretation ==&lt;br /&gt;
&lt;br /&gt;
=== Normal owner heartbeat ===&lt;br /&gt;
&lt;br /&gt;
The guest heartbeat normally refreshes Wort approximately every two seconds. A typical observed lease age is therefore a small number of seconds. Occasional modest increases are not themselves a failover event.&lt;br /&gt;
&lt;br /&gt;
The validated load-and-delay test produced 15 successful refreshes and a maximum lease age of 8.662 seconds under simultaneous CPU pressure, memory pressure, NFS I/O, a competing MASTER request, and 500 ms per-packet SSH delay. The active lease limit remained 30 seconds, Fox was not fenced, and Anchor did not acquire the disk.&lt;br /&gt;
&lt;br /&gt;
=== What approaching failover looks like ===&lt;br /&gt;
&lt;br /&gt;
A likely developing owner-path problem normally appears in this order:&lt;br /&gt;
&lt;br /&gt;
# Lease age rises above its usual range.&lt;br /&gt;
# Lease headroom falls by the same amount.&lt;br /&gt;
# Scheduler delay, collector duration, guest service alarms, or network alarms may provide an explanation.&lt;br /&gt;
# The 10-second lease-age Warning opens if the condition persists.&lt;br /&gt;
# The 20-second High alarm opens if the lease continues aging.&lt;br /&gt;
# The 25-second Disaster alarm indicates less than five seconds before the active lease limit.&lt;br /&gt;
# Lease validity becomes false after expiry.&lt;br /&gt;
&lt;br /&gt;
Lease expiry by itself does not attach the disk to the peer. The fencing path is exercised when a competing eligible MASTER requests takeover and the complete authority, lease, VM, and attachment checks permit it.&lt;br /&gt;
&lt;br /&gt;
=== Successful failover ===&lt;br /&gt;
&lt;br /&gt;
During an orderly or automatic handoff, a brief coherence code 1 and a brief zero live-disk count can be normal. The alert persistence periods allow those transitions to complete without immediately opening a problem.&lt;br /&gt;
&lt;br /&gt;
After completion, all of the following should change coherently:&lt;br /&gt;
&lt;br /&gt;
* authority owner;&lt;br /&gt;
* authority generation;&lt;br /&gt;
* owner MASTER intent;&lt;br /&gt;
* peer BACKUP intent;&lt;br /&gt;
* live disk owner; and&lt;br /&gt;
* coherence state.&lt;br /&gt;
&lt;br /&gt;
The final state should be &amp;lt;code&amp;gt;HEALTHY_ANCHOR&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt; with a freshly renewed lease.&lt;br /&gt;
&lt;br /&gt;
== Alert response ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Alert&lt;br /&gt;
! First response&lt;br /&gt;
! Prohibited shortcut&lt;br /&gt;
|-&lt;br /&gt;
| Lease age Warning or High&lt;br /&gt;
| Compare lease age with vCPU delay, guest reachability, heartbeat service status, Wort load, and SSH latency. Preserve evidence before intervening.&lt;br /&gt;
| Do not force a failover solely because lease age briefly increased.&lt;br /&gt;
|-&lt;br /&gt;
| Lease within five seconds of expiry&lt;br /&gt;
| Treat as urgent. Determine whether the owner guest is running and whether its heartbeat/control path has stalled. Watch authority and attachment state continuously.&lt;br /&gt;
| Do not manually attach the production LV to the peer.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence inconsistent&lt;br /&gt;
| Compare owner, generation, intents, lease validity, domain states, and live owner from the same JSON snapshot.&lt;br /&gt;
| Do not restart both NAS nodes together.&lt;br /&gt;
|-&lt;br /&gt;
| Unsafe attachment&lt;br /&gt;
| Stop ordinary recovery activity and inspect live and inactive XML on both domains. Protect data integrity first.&lt;br /&gt;
| Do not mount or start NFS on either node until exclusive ownership is proven.&lt;br /&gt;
|-&lt;br /&gt;
| Fencing control invalid&lt;br /&gt;
| Inspect file existence, regular-file type, mode 0600, root ownership, and content &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Determine whether disablement was intentional maintenance.&lt;br /&gt;
| Do not recreate the flag during a controlled rebuild or shutdown procedure that requires fencing disabled.&lt;br /&gt;
|-&lt;br /&gt;
| NAS domain not running&lt;br /&gt;
| Determine whether it was deliberately fenced, administratively stopped, or failed. Confirm where the disk and authority ended.&lt;br /&gt;
| Do not restart a destroyed former owner until storage ownership is known.&lt;br /&gt;
|-&lt;br /&gt;
| Collector failure or no data&lt;br /&gt;
| Check Zabbix Agent 2, the user parameter, sudo validation, SELinux denials, and libvirt query access.&lt;br /&gt;
| Do not weaken the sudo rule to unrestricted commands.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Wort major-version rebuild ==&lt;br /&gt;
&lt;br /&gt;
Monitoring restoration occurs only after the base hypervisor, libvirt configuration, Stage 4 r4 code, authority-state recovery, and controlled HA acceptance are complete.&lt;br /&gt;
&lt;br /&gt;
=== Rebuild sequence ===&lt;br /&gt;
&lt;br /&gt;
# Keep production fencing disabled during the controlled rebuild and recovery procedure, as required by the main NAS HA rebuild runbook.&lt;br /&gt;
# Reinstall Zabbix Agent 2 from the approved Zabbix 7.0 repository.&lt;br /&gt;
# Restore the libvirt domains, network, pools, and live-attachment-only storage design.&lt;br /&gt;
# Restore the Stage 4 r4 Wort scripts and arbiter state according to the NAS HA rebuild procedure.&lt;br /&gt;
# Complete the fencing-disabled HA acceptance and establish a coherent owner.&lt;br /&gt;
# Restore the monitoring collector from Git by running &amp;lt;code&amp;gt;src/nas-ha-monitoring/install-monitoring-on-wort.sh&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Confirm that the collector works through Zabbix Agent 2.&lt;br /&gt;
# Re-enable production fencing only through the separately validated HA enablement procedure.&lt;br /&gt;
# Confirm &amp;lt;code&amp;gt;fencing_control_valid=1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;coherence_code=0&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Import the template only if the Zabbix server configuration was also lost or rebuilt. Ordinarily the existing template remains intact.&lt;br /&gt;
# Verify Latest data, graphs, and Problems.&lt;br /&gt;
&lt;br /&gt;
The monitoring installer expects the production HA system to be coherent and fencing to be valid at its final acceptance check. Therefore, during a rebuild, run it after the HA solution has returned to its final accepted operational state.&lt;br /&gt;
&lt;br /&gt;
== Zabbix server or template recovery ==&lt;br /&gt;
&lt;br /&gt;
If the Zabbix server loses the template:&lt;br /&gt;
&lt;br /&gt;
# Obtain &amp;lt;code&amp;gt;configs/nas/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt; from commit &amp;lt;code&amp;gt;1d1904d1ca9eedfa076358928fdf61999b7bc7a5&amp;lt;/code&amp;gt; or tag &amp;lt;code&amp;gt;nas-ha-monitoring-r1&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Verify its SHA-256 hash.&lt;br /&gt;
# Import with &#039;&#039;&#039;Create new&#039;&#039;&#039; and &#039;&#039;&#039;Update existing&#039;&#039;&#039; enabled.&lt;br /&gt;
# Keep &#039;&#039;&#039;Delete missing&#039;&#039;&#039; disabled unless a separately reviewed change explicitly requires deletion.&lt;br /&gt;
# Link &#039;&#039;&#039;KitsNet NAS Hypervisor&#039;&#039;&#039; to Wort if the linkage was not restored with the Zabbix database.&lt;br /&gt;
# Allow at least 30 seconds for initial collection and dependent-item processing.&lt;br /&gt;
# Perform the Zabbix verification procedure above.&lt;br /&gt;
&lt;br /&gt;
== Security and secrets ==&lt;br /&gt;
&lt;br /&gt;
No private SSH key, password, keytab, Zabbix TLS secret, or other private credential is stored in the monitoring release.&lt;br /&gt;
&lt;br /&gt;
The Zabbix account receives only this additional sudo permission:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The collector has no command-line arguments, rejects no user-supplied domain name because none is accepted, and uses fixed state paths, domain names, and production source paths. This prevents the Zabbix item key from being used as a general libvirt or shell-command interface.&lt;br /&gt;
&lt;br /&gt;
The deployment controller follows KitsNet SSH policy:&lt;br /&gt;
&lt;br /&gt;
* connections originate on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;;&lt;br /&gt;
* the working identity comes from the SSH agent;&lt;br /&gt;
* &amp;lt;code&amp;gt;IdentitiesOnly=yes&amp;lt;/code&amp;gt; is not used; and&lt;br /&gt;
* privilege escalation occurs through sudo on Wort.&lt;br /&gt;
&lt;br /&gt;
== Known scope boundaries ==&lt;br /&gt;
&lt;br /&gt;
The r1 collector measures the authoritative Wort-side HA control and attachment state. It does not directly query inside Fox or Anchor for:&lt;br /&gt;
&lt;br /&gt;
* Keepalived process state or advertisement age;&lt;br /&gt;
* NFS service state or client latency;&lt;br /&gt;
* Veeam service state;&lt;br /&gt;
* guest filesystem mount state;&lt;br /&gt;
* guest heartbeat unit restart count; or&lt;br /&gt;
* guest network packet loss.&lt;br /&gt;
&lt;br /&gt;
Those guest and service metrics should remain on the Fox and Anchor host templates and can be presented beside the Wort HA metrics in a Zabbix dashboard. Wort is deliberately not given broad remote credentials merely to collect them.&lt;br /&gt;
&lt;br /&gt;
== Change control ==&lt;br /&gt;
&lt;br /&gt;
Changes should begin in &amp;lt;code&amp;gt;src/nas-ha-monitoring/&amp;lt;/code&amp;gt;. After testing, update the deployment mirrors in &amp;lt;code&amp;gt;scripts/&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;configs/nas/&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configs/sudoers/&amp;lt;/code&amp;gt;. Validate exact byte equality between canonical files, mirrors, and deployed files before committing.&lt;br /&gt;
&lt;br /&gt;
Stage only the monitoring paths. The repository may contain unrelated modified or untracked work that must not enter a monitoring commit.&lt;br /&gt;
&lt;br /&gt;
For every release:&lt;br /&gt;
&lt;br /&gt;
# validate Python and shell syntax;&lt;br /&gt;
# validate the sudoers fragment with &amp;lt;code&amp;gt;visudo -cf&amp;lt;/code&amp;gt;;&lt;br /&gt;
# import and validate the Zabbix YAML against the deployed Zabbix major version;&lt;br /&gt;
# test the collector as the Zabbix account;&lt;br /&gt;
# verify healthy HA state without initiating a failover;&lt;br /&gt;
# review the staged path list and staged diff;&lt;br /&gt;
# commit;&lt;br /&gt;
# create an annotated monitoring release tag;&lt;br /&gt;
# push both the branch and tag; and&lt;br /&gt;
# verify the remote branch and peeled tag commit IDs.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Zabbix 7.0 dependent items: https://www.zabbix.com/documentation/7.0/en/manual/config/items/itemtypes/dependent_items&lt;br /&gt;
* Zabbix 7.0 template export and import: https://www.zabbix.com/documentation/7.0/en/manual/xml_export_import/templates&lt;br /&gt;
* Git repository: &amp;lt;code&amp;gt;/srv/git/KNdkr&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt;&lt;br /&gt;
* Monitoring release: &amp;lt;code&amp;gt;nas-ha-monitoring-r1&amp;lt;/code&amp;gt;&lt;br /&gt;
* Stage 4 r4 release tag: &amp;lt;code&amp;gt;nas-ha-stage4-r4-production-r2&amp;lt;/code&amp;gt;&lt;br /&gt;
[[Category:High Availability NAS]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Docker:High_Availability_NAS:Monitoring&amp;diff=2711</id>
		<title>KitsNet Operations:Services:Docker:High Availability NAS:Monitoring</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Docker:High_Availability_NAS:Monitoring&amp;diff=2711"/>
		<updated>2026-11-19T15:23:58Z</updated>

		<summary type="html">&lt;p&gt;Psmode: Added web status tool hosted on wort&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KitsNet NAS HA Monitoring =&lt;br /&gt;
&lt;br /&gt;
This document describes the design, implementation, operation, and recovery of the monitoring for the KitsNet Docker NAS high-availability system. It covers the read-only collector installed on Wort and the associated Zabbix instrumentation in the &#039;&#039;&#039;KitsNet NAS Hypervisor&#039;&#039;&#039; template.&lt;br /&gt;
&lt;br /&gt;
The monitoring release documented here is &#039;&#039;&#039;nas-ha-monitoring-r1&#039;&#039;&#039;. It supplements the Stage 4 revision 4 NAS HA implementation. It does not control failover, renew leases, attach or detach storage, restart NAS services, or enable or disable fencing.&lt;br /&gt;
&lt;br /&gt;
== Current accepted state ==&lt;br /&gt;
&lt;br /&gt;
The monitoring implementation was accepted on 9 September 2026 with the following state:&lt;br /&gt;
&lt;br /&gt;
* Wort was the libvirt hypervisor and storage arbiter.&lt;br /&gt;
* Fox (libvirt domain &amp;lt;code&amp;gt;uv059&amp;lt;/code&amp;gt;) was the active NAS owner and Keepalived MASTER.&lt;br /&gt;
* Anchor (libvirt domain &amp;lt;code&amp;gt;uv060&amp;lt;/code&amp;gt;) was the standby NAS and Keepalived BACKUP.&lt;br /&gt;
* The production logical volume was live-attached only to Fox as &amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Neither NAS domain contained the production disk in its persistent XML.&lt;br /&gt;
* Wort authority named Fox, generation 13, active.&lt;br /&gt;
* The active lease was valid with a 30-second limit.&lt;br /&gt;
* Production fencing was enabled through a valid &amp;lt;code&amp;gt;/etc/kitsnet-nas/fencing-enabled&amp;lt;/code&amp;gt; control file.&lt;br /&gt;
* The collector returned &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt;, completed in approximately 66–70 milliseconds, and was accessible through Zabbix Agent 2.&lt;br /&gt;
* Wort was running Zabbix Agent 2 version 7.0.28.&lt;br /&gt;
&lt;br /&gt;
The accepted Git commit is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1d1904d1ca9eedfa076358928fdf61999b7bc7a5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The annotated release tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nas-ha-monitoring-r1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Monitoring objectives ==&lt;br /&gt;
&lt;br /&gt;
The monitoring has four distinct objectives:&lt;br /&gt;
&lt;br /&gt;
# Show whether the complete HA system is internally coherent now.&lt;br /&gt;
# Show how close the current owner is to losing lease freshness.&lt;br /&gt;
# Detect storage-attachment states that could threaten data integrity.&lt;br /&gt;
# Surface hypervisor scheduling pressure that could delay the owner guest and its heartbeat.&lt;br /&gt;
&lt;br /&gt;
The lease metrics are the most direct early warning of an approaching takeover opportunity. vCPU scheduler delay is supporting evidence: it can explain why a guest is responding slowly, but scheduler delay alone does not initiate failover.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
The monitoring uses one read-only JSON master item and Zabbix dependent items.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort state files and libvirt XML&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
/usr/local/sbin/kitsnet-nas-ha-status&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
Zabbix Agent 2 item: kitsnet.nas.ha.status&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
Zabbix server JSONPath preprocessing&lt;br /&gt;
              |&lt;br /&gt;
              v&lt;br /&gt;
Dependent metrics, triggers, and lease graph&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every five seconds, Zabbix requests one JSON document from Wort. Zabbix then extracts all individual HA values from that document. This provides a time-consistent snapshot and avoids running a separate privileged command for every metric.&lt;br /&gt;
&lt;br /&gt;
The pre-existing vCPU scheduler-delay collectors remain separate because they maintain per-domain counters and calculate change over time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web-Based NAS HA Status Dashboard ==&lt;br /&gt;
&lt;br /&gt;
On 19 November 2026, a browser-based, read-only NAS HA status dashboard was installed on Wort. It provides an immediately understandable, color-coded view of the current HA state without requiring access to Zabbix or interpreting the collector&#039;s raw JSON output.&lt;br /&gt;
&lt;br /&gt;
The dashboard supplements the existing Zabbix monitoring. It does not replace Zabbix&#039;s historical data collection, graphs, triggers, or alerting.&lt;br /&gt;
&lt;br /&gt;
=== Access ===&lt;br /&gt;
&lt;br /&gt;
The dashboard is available from a browser on the KitsNet management network:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[http://wort.lan.kitsnet.us/nas-ha/ KitsNet NAS HA Status Dashboard]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Direct URLs:&lt;br /&gt;
&lt;br /&gt;
* Dashboard: http://wort.lan.kitsnet.us/nas-ha/&lt;br /&gt;
* Current JSON snapshot: http://wort.lan.kitsnet.us/nas-ha/status.json&lt;br /&gt;
&lt;br /&gt;
The dashboard refreshes automatically approximately every 10 seconds. No manual refresh is normally necessary.&lt;br /&gt;
&lt;br /&gt;
Access should remain restricted to authorized internal networks or VPN connections. The current deployment uses HTTP rather than HTTPS.&lt;br /&gt;
&lt;br /&gt;
=== Display and interpretation ===&lt;br /&gt;
&lt;br /&gt;
The page displays:&lt;br /&gt;
&lt;br /&gt;
* Overall HA health, prominently color-coded.&lt;br /&gt;
* Current authoritative MASTER (Fox or Anchor).&lt;br /&gt;
* Standby NAS member.&lt;br /&gt;
* Current production disk owner.&lt;br /&gt;
* Remaining authority lease headroom.&lt;br /&gt;
* A table of 13 HA integrity checks, each with its observed value and result.&lt;br /&gt;
* An expandable section containing the original collector JSON.&lt;br /&gt;
* The last collection timestamp and age of the displayed snapshot.&lt;br /&gt;
&lt;br /&gt;
The overall status uses these classifications:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Display status&lt;br /&gt;
! Color&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| HEALTHY&lt;br /&gt;
| Green&lt;br /&gt;
| All dashboard integrity checks pass.&lt;br /&gt;
|-&lt;br /&gt;
| DEGRADED&lt;br /&gt;
| Amber&lt;br /&gt;
| No critical check failed, but one or more warning conditions exist.&lt;br /&gt;
|-&lt;br /&gt;
| CRITICAL&lt;br /&gt;
| Red&lt;br /&gt;
| At least one critical HA integrity check failed.&lt;br /&gt;
|-&lt;br /&gt;
| STATUS UNKNOWN&lt;br /&gt;
| Gray&lt;br /&gt;
| Status collection failed or the dashboard cannot obtain a valid current snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| STALE / UNKNOWN&lt;br /&gt;
| Gray&lt;br /&gt;
| The last collected snapshot is more than 30 seconds old. The previous healthy state must not be interpreted as current.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A successful failover to Anchor is considered healthy when the authority, intents, lease, fencing, and disk ownership are mutually consistent. The dashboard does not require Fox to remain MASTER.&lt;br /&gt;
&lt;br /&gt;
The individual checks cover collection success, HA coherence, authority, active and standby VM states, MASTER and BACKUP intents, production disk ownership, live and persistent disk attachments, fencing validity, lease validity, and lease headroom.&lt;br /&gt;
&lt;br /&gt;
Lease headroom below 10 seconds is classified as a warning; zero or negative headroom is critical.&lt;br /&gt;
&lt;br /&gt;
The dashboard&#039;s classifications are intended for immediate operational visibility. Zabbix remains the authoritative source for historical trends, time-based trigger evaluation, and alert severity escalation.&lt;br /&gt;
&lt;br /&gt;
=== Architecture ===&lt;br /&gt;
&lt;br /&gt;
The dashboard runs entirely on Wort, independently of the Fox and Anchor NAS filesystems.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Wort HA state and libvirt&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
/usr/local/sbin/kitsnet-nas-ha-status&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
Root-owned Python web collector&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
/var/www/html/nas-ha/status.json&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
Apache HTTPD on Wort&lt;br /&gt;
          |&lt;br /&gt;
          v&lt;br /&gt;
Browser dashboard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The existing read-only HA status collector is reused unchanged.&lt;br /&gt;
&lt;br /&gt;
A systemd timer invokes a Python formatter approximately every 10 seconds. The formatter executes the HA collector, evaluates the result, and atomically publishes a JSON status snapshot.&lt;br /&gt;
&lt;br /&gt;
Apache serves only static HTML and JSON files. No CGI, server-side application framework, database, or privileged Apache execution is required.&lt;br /&gt;
&lt;br /&gt;
The dashboard is located on Wort&#039;s local &amp;lt;code&amp;gt;/var&amp;lt;/code&amp;gt; XFS filesystem, backed by &amp;lt;code&amp;gt;/dev/mapper/T0h-var&amp;lt;/code&amp;gt;. Consequently, the page and its collector do not depend on the availability of the production HA NAS storage.&lt;br /&gt;
&lt;br /&gt;
The Python collector runs as root through a systemd oneshot service because the underlying HA state requires privileged access. Apache itself does not receive those privileges.&lt;br /&gt;
&lt;br /&gt;
=== Installed files and services ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose&lt;br /&gt;
! Location&lt;br /&gt;
|-&lt;br /&gt;
| Existing read-only HA collector&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Web dashboard collector and formatter&lt;br /&gt;
| &amp;lt;code&amp;gt;/usr/local/libexec/kitsnet-nas-ha-web.py&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Dashboard HTML and JavaScript&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/www/html/nas-ha/index.html&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Current JSON snapshot&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/www/html/nas-ha/status.json&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| systemd collection service&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/systemd/system/kitsnet-nas-ha-web.service&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| systemd collection timer&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/systemd/system/kitsnet-nas-ha-web.timer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Web server&lt;br /&gt;
| Existing Apache HTTPD on Wort&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The collection timer is enabled to start at boot. Its configuration uses &amp;lt;code&amp;gt;OnUnitInactiveSec=10s&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AccuracySec=1s&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The collector has a seven-second command timeout and publishes an UNKNOWN result if execution or JSON processing fails.&lt;br /&gt;
&lt;br /&gt;
A browser-side stale-data check independently verifies snapshot freshness. If collection stops, an old green status changes to STALE / UNKNOWN after 30 seconds rather than continuing to report HEALTHY.&lt;br /&gt;
&lt;br /&gt;
=== Operational commands ===&lt;br /&gt;
&lt;br /&gt;
To check the timer and collector service on Wort:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl status kitsnet-nas-ha-web.timer&lt;br /&gt;
systemctl status kitsnet-nas-ha-web.service&lt;br /&gt;
systemctl list-timers kitsnet-nas-ha-web.timer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To execute an immediate collection:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl start kitsnet-nas-ha-web.service&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To inspect the current snapshot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo python3 -m json.tool \&lt;br /&gt;
    /var/www/html/nas-ha/status.json&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To confirm that Apache serves the dashboard:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
curl -I http://127.0.0.1/nas-ha/&lt;br /&gt;
curl -I http://127.0.0.1/nas-ha/status.json&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both HTTP requests should normally return &amp;lt;code&amp;gt;200 OK&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To inspect collection errors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo journalctl -u kitsnet-nas-ha-web.service \&lt;br /&gt;
    --since &amp;quot;1 hour ago&amp;quot; --no-pager&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the timer is stopped or disabled, restart it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl enable --now kitsnet-nas-ha-web.timer&lt;br /&gt;
sudo systemctl start kitsnet-nas-ha-web.service&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These commands affect only the dashboard monitoring components. They do not initiate failover or alter HA disk ownership.&lt;br /&gt;
&lt;br /&gt;
=== Historical monitoring and Zabbix integration ===&lt;br /&gt;
&lt;br /&gt;
The web dashboard is a current-state display. It replaces its JSON snapshot during each collection and does not maintain a historical database.&lt;br /&gt;
&lt;br /&gt;
Historical monitoring remains the responsibility of the existing Zabbix implementation, which collects the HA master JSON item every five seconds and maintains dependent items according to their configured history and trend-retention settings.&lt;br /&gt;
&lt;br /&gt;
Use Zabbix for:&lt;br /&gt;
&lt;br /&gt;
* Historical lease age and headroom.&lt;br /&gt;
* HA coherence transitions and changes of MASTER.&lt;br /&gt;
* Collector performance trends.&lt;br /&gt;
* Historical fencing and disk-attachment observations.&lt;br /&gt;
* Fox and Anchor vCPU scheduling-delay history.&lt;br /&gt;
* Trigger history, event duration, and escalation.&lt;br /&gt;
&lt;br /&gt;
The existing Zabbix graphs are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS HA Lease&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS vCPU Scheduler Delay&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are available through the Wort host&#039;s graphs in Zabbix.&lt;br /&gt;
&lt;br /&gt;
The web dashboard and Zabbix independently invoke the same underlying read-only collector. Neither depends on the other&#039;s availability.&lt;br /&gt;
&lt;br /&gt;
=== Initial deployment verification ===&lt;br /&gt;
&lt;br /&gt;
The installation was verified on 19 November 2026:&lt;br /&gt;
&lt;br /&gt;
* Apache returned HTTP 200 for both the dashboard and JSON snapshot.&lt;br /&gt;
* The systemd timer was active and enabled.&lt;br /&gt;
* Automatic collections were occurring approximately every 10 seconds.&lt;br /&gt;
* All 13 dashboard integrity checks passed.&lt;br /&gt;
* The authoritative owner was Fox, generation 51.&lt;br /&gt;
* Anchor was running as BACKUP.&lt;br /&gt;
* Exactly one live production disk attachment existed, owned by Fox.&lt;br /&gt;
* No persistent production disk attachments existed.&lt;br /&gt;
* Fencing and the authority lease were valid.&lt;br /&gt;
* Observed collection duration was approximately 65–72 milliseconds.&lt;br /&gt;
&lt;br /&gt;
The initial browser display reported HEALTHY.&lt;br /&gt;
&lt;br /&gt;
These are deployment observations, not permanently expected ownership or generation values.&lt;br /&gt;
&lt;br /&gt;
=== Scope and change control ===&lt;br /&gt;
&lt;br /&gt;
The dashboard is an operational presentation layer added after the original &amp;lt;code&amp;gt;nas-ha-monitoring-r1&amp;lt;/code&amp;gt; release.&lt;br /&gt;
&lt;br /&gt;
It is not part of the original annotated release tag or accepted file hashes documented elsewhere on this page.&lt;br /&gt;
&lt;br /&gt;
The dashboard does not:&lt;br /&gt;
&lt;br /&gt;
* Modify authority or intent records.&lt;br /&gt;
* Renew or invalidate leases.&lt;br /&gt;
* Enable or disable fencing.&lt;br /&gt;
* Attach or detach production storage.&lt;br /&gt;
* Start, stop, or restart either NAS VM.&lt;br /&gt;
* Initiate a failover or recovery operation.&lt;br /&gt;
&lt;br /&gt;
Changes to the dashboard must not modify the underlying Stage 4 r4 HA control mechanisms.&lt;br /&gt;
&lt;br /&gt;
During a Wort rebuild, restore the base HA system and its existing collector first. Restore the Apache dashboard files and systemd units only after the underlying collector is functioning correctly.&lt;br /&gt;
&lt;br /&gt;
The dashboard is an additional operational tool, not a replacement for the existing Zabbix monitoring release or its historical data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data sources on Wort ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Source&lt;br /&gt;
! Information used&lt;br /&gt;
! Persistence&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/lib/kitsnet-nas-arbiter/owner.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Authoritative owner, generation, and active status&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/lib/kitsnet-nas-arbiter/fox.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last published Fox intent and generation&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/var/lib/kitsnet-nas-arbiter/anchor.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last published Anchor intent and generation&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/run/kitsnet-nas-arbiter/lease.json&amp;lt;/code&amp;gt;&lt;br /&gt;
| Current owner lease, generation, boot identifier, and monotonic timestamp&lt;br /&gt;
| Runtime; recreated after boot&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/proc/sys/kernel/random/boot_id&amp;lt;/code&amp;gt;&lt;br /&gt;
| Confirms that the lease belongs to the current Wort boot&lt;br /&gt;
| Runtime&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/proc/uptime&amp;lt;/code&amp;gt; through Python monotonic time&lt;br /&gt;
| Calculates lease age without wall-clock dependence&lt;br /&gt;
| Runtime&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;/etc/kitsnet-nas/fencing-enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
| Confirms that production fencing is enabled with the required content, type, mode, and ownership&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| libvirt live domain XML&lt;br /&gt;
| Shows which running domain owns the production LV as &amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt;&lt;br /&gt;
| Runtime&lt;br /&gt;
|-&lt;br /&gt;
| libvirt inactive domain XML&lt;br /&gt;
| Detects any prohibited persistent production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; definition&lt;br /&gt;
| Durable&lt;br /&gt;
|-&lt;br /&gt;
| libvirt domain state&lt;br /&gt;
| Confirms whether Fox and Anchor are running&lt;br /&gt;
| Runtime&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The production source matched by the collector is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/dev/T1/uv059-dkrnfs1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The collector recognizes only these owner-to-domain mappings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! HA owner&lt;br /&gt;
! Libvirt domain&lt;br /&gt;
|-&lt;br /&gt;
| Fox&lt;br /&gt;
| &amp;lt;code&amp;gt;uv059&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Anchor&lt;br /&gt;
| &amp;lt;code&amp;gt;uv060&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Collector design ==&lt;br /&gt;
&lt;br /&gt;
=== Read-only behavior ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;kitsnet-nas-ha-status&amp;lt;/code&amp;gt; performs only file reads and these libvirt queries:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;virsh domstate&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;virsh dumpxml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;virsh dumpxml --inactive&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It does not call &amp;lt;code&amp;gt;kitsnet-nas-storage&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;kitsnet-nas-intent&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;virsh destroy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;virsh attach-disk&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;virsh detach-disk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The collector always attempts to return valid JSON. If collection raises an exception, it returns &amp;lt;code&amp;gt;collection_ok=0&amp;lt;/code&amp;gt; and a bounded error string rather than emitting partial normal data.&lt;br /&gt;
&lt;br /&gt;
=== Lease calculation ===&lt;br /&gt;
&lt;br /&gt;
For an active authority, the configured lease limit is 30 seconds. During acquisition, before the authority becomes active, the limit is 60 seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;lease age = Wort monotonic time - stored lease monotonic time&lt;br /&gt;
lease headroom = applicable lease limit - lease age&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A lease is valid only when all of the following are true:&lt;br /&gt;
&lt;br /&gt;
* The authority owner is Fox or Anchor.&lt;br /&gt;
* The lease owner matches the authority owner.&lt;br /&gt;
* The lease generation matches the authority generation.&lt;br /&gt;
* The lease boot identifier matches the current Wort boot identifier.&lt;br /&gt;
* The calculated age is between -1 second and the applicable lease limit.&lt;br /&gt;
&lt;br /&gt;
The one-second negative allowance tolerates insignificant numeric timing effects. It does not permit a lease from another boot or generation.&lt;br /&gt;
&lt;br /&gt;
=== Coherence classification ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Code&lt;br /&gt;
! State&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;HEALTHY_ANCHOR&amp;lt;/code&amp;gt;&lt;br /&gt;
| Authority, lease, intent, domain, fencing, and disk attachment agree.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;code&amp;gt;TRANSITION_NO_OWNER&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;TRANSITION_ACQUIRING&amp;lt;/code&amp;gt;&lt;br /&gt;
| A normally brief interval exists between release and activation.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| &amp;lt;code&amp;gt;INCONSISTENT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;DEGRADED_FENCING_CONTROL&amp;lt;/code&amp;gt;&lt;br /&gt;
| The state cannot be accepted as fully coherent, or the fencing control is invalid.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| &amp;lt;code&amp;gt;UNSAFE_ATTACHMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
| The production LV appears live on more than one NAS domain, or appears in persistent domain XML.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The collector evaluates unsafe attachment before all other classifications. An invalid fencing control is evaluated next. A healthy result requires:&lt;br /&gt;
&lt;br /&gt;
* exactly one active authority owner;&lt;br /&gt;
* a valid current lease;&lt;br /&gt;
* exactly one live production-disk attachment on that same owner;&lt;br /&gt;
* a matching MASTER intent and generation for the owner;&lt;br /&gt;
* a BACKUP intent for the peer;&lt;br /&gt;
* both NAS domains running;&lt;br /&gt;
* valid production fencing control; and&lt;br /&gt;
* no persistent production-disk attachment.&lt;br /&gt;
&lt;br /&gt;
== Installed files and Git mapping ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose&lt;br /&gt;
! Canonical Git path&lt;br /&gt;
! Deployment mirror or live path&lt;br /&gt;
|-&lt;br /&gt;
| Complete monitoring release&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/&amp;lt;/code&amp;gt;&lt;br /&gt;
| Not deployed as a directory&lt;br /&gt;
|-&lt;br /&gt;
| JSON collector&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;scripts/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Wort: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Zabbix user parameter&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;configs/nas/kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Wort: &amp;lt;code&amp;gt;/etc/zabbix/zabbix_agent2.d/kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Restricted sudo rule&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/zabbix-kitsnet-nas-ha-status.sudoers&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;configs/sudoers/zabbix-kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Wort: &amp;lt;code&amp;gt;/etc/sudoers.d/zabbix-kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Zabbix template&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;&lt;br /&gt;
| Git mirror: &amp;lt;code&amp;gt;configs/nas/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;Imported into Zabbix&lt;br /&gt;
|-&lt;br /&gt;
| Deployment controller&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/install-monitoring-on-wort.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
| Run from &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Release notes&lt;br /&gt;
| &amp;lt;code&amp;gt;src/nas-ha-monitoring/README.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
| Documentation within the Git release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The MediaWiki documentation is intentionally not stored in Git. MediaWiki page history provides document versioning.&lt;br /&gt;
&lt;br /&gt;
=== Accepted file hashes ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File&lt;br /&gt;
! SHA-256&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet-nas-ha-status&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;e3760679256dd282171c0cbc384d8d886e994ff83dcb3382e75abf4cf694c13d&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet-nas-ha-status.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;c1a358b68d7b736907fe6a8c616cf8771ed8b0af0906f1183e01dcabdc6d4299&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;zabbix-kitsnet-nas-ha-status.sudoers&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;f346f2ad0d9f2a30b9917130d15f3e496722c280fa9145cc3b9eebef6d9b183d&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;install-monitoring-on-wort.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;eec85001bd3496022bf98b1e8405adb6629805733144aef0d1aa1a82c2b2d7f3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;README.txt&amp;lt;/code&amp;gt; source&lt;br /&gt;
| &amp;lt;code&amp;gt;4784f4faf7fe29be97b453e8690b8398ac4a80e5eb5ac6d5f5845b26d8c2c606&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;7ad02ed3c5fae21040dc2dba6f09dc31bd7837803cc86dd7d277e310d1bbf372&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Zabbix implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Master item ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Item&lt;br /&gt;
! Key&lt;br /&gt;
! Interval&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| NAS HA status JSON&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.status&amp;lt;/code&amp;gt;&lt;br /&gt;
| 5 seconds&lt;br /&gt;
| Zabbix agent passive item, text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The user parameter is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;UserParameter=kitsnet.nas.ha.status,/usr/bin/sudo -n /usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding sudo rule permits the Zabbix account to execute only the read-only collector as root:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;zabbix ALL=(root) NOPASSWD: /usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Root access is required because the durable arbiter state and fencing control are intentionally protected from ordinary users. The collector does not need SSH access to Fox or Anchor.&lt;br /&gt;
&lt;br /&gt;
=== Dependent items ===&lt;br /&gt;
&lt;br /&gt;
All following items are populated from the master JSON using JSONPath preprocessing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Zabbix item key&lt;br /&gt;
! Value&lt;br /&gt;
! Normal stable value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.collection.ok&amp;lt;/code&amp;gt;&lt;br /&gt;
| Whether the complete collection completed&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.collection.duration&amp;lt;/code&amp;gt;&lt;br /&gt;
| Collection duration in milliseconds&lt;br /&gt;
| Normally well below 1,000 ms&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.coherence.code&amp;lt;/code&amp;gt;&lt;br /&gt;
| Numeric overall classification&lt;br /&gt;
| &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.coherence.state&amp;lt;/code&amp;gt;&lt;br /&gt;
| Human-readable overall classification&lt;br /&gt;
| &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;HEALTHY_ANCHOR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.authority.owner&amp;lt;/code&amp;gt;&lt;br /&gt;
| Wort authoritative owner&lt;br /&gt;
| &amp;lt;code&amp;gt;fox&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;anchor&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.authority.generation&amp;lt;/code&amp;gt;&lt;br /&gt;
| Current authority generation&lt;br /&gt;
| Positive integer; must match the owner intent&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.authority.active&amp;lt;/code&amp;gt;&lt;br /&gt;
| Whether the authority has completed activation&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.age&amp;lt;/code&amp;gt;&lt;br /&gt;
| Seconds since the last accepted heartbeat refresh&lt;br /&gt;
| Normally near 0–3 seconds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.limit&amp;lt;/code&amp;gt;&lt;br /&gt;
| Applicable lease limit&lt;br /&gt;
| &amp;lt;code&amp;gt;30&amp;lt;/code&amp;gt; while active; &amp;lt;code&amp;gt;60&amp;lt;/code&amp;gt; while acquiring&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.headroom&amp;lt;/code&amp;gt;&lt;br /&gt;
| Seconds remaining before the applicable limit&lt;br /&gt;
| Normally near 27–30 seconds while active&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.lease.valid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Owner, generation, boot, and age validation result&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.fencing.valid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Strict fencing-control validation&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.fox.state&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last durable Fox intent&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BACKUP&amp;lt;/code&amp;gt;, according to ownership&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.fox.generation&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fox intent generation&lt;br /&gt;
| Matches authority generation when Fox owns storage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.anchor.state&amp;lt;/code&amp;gt;&lt;br /&gt;
| Last durable Anchor intent&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BACKUP&amp;lt;/code&amp;gt;, according to ownership&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.intent.anchor.generation&amp;lt;/code&amp;gt;&lt;br /&gt;
| Anchor intent generation&lt;br /&gt;
| Matches authority generation when Anchor owns storage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.domain.fox.running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fox libvirt running state&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.domain.anchor.running&amp;lt;/code&amp;gt;&lt;br /&gt;
| Anchor libvirt running state&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.live.count&amp;lt;/code&amp;gt;&lt;br /&gt;
| Total live production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; attachments&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.live.owner&amp;lt;/code&amp;gt;&lt;br /&gt;
| Domain owner of the sole live production disk&lt;br /&gt;
| Same as authority owner&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.fox.live&amp;lt;/code&amp;gt;&lt;br /&gt;
| Production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; count in Fox live XML&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when Fox owns; otherwise &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.anchor.live&amp;lt;/code&amp;gt;&lt;br /&gt;
| Production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; count in Anchor live XML&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when Anchor owns; otherwise &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.nas.ha.disk.persistent.count&amp;lt;/code&amp;gt;&lt;br /&gt;
| Total production-&amp;lt;code&amp;gt;vdb&amp;lt;/code&amp;gt; entries in inactive domain XML&lt;br /&gt;
| &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Existing scheduler-delay items ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Guest&lt;br /&gt;
! Zabbix key&lt;br /&gt;
! Interval&lt;br /&gt;
|-&lt;br /&gt;
| Fox / &amp;lt;code&amp;gt;uv059&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.libvirt.vcpu.delay[uv059]&amp;lt;/code&amp;gt;&lt;br /&gt;
| 30 seconds&lt;br /&gt;
|-&lt;br /&gt;
| Anchor / &amp;lt;code&amp;gt;uv060&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;kitsnet.libvirt.vcpu.delay[uv060]&amp;lt;/code&amp;gt;&lt;br /&gt;
| 30 seconds&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The helper &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-vcpu-delay-percent&amp;lt;/code&amp;gt; calculates the increase in cumulative libvirt vCPU delay divided by elapsed time and the number of vCPUs. The result estimates the percentage of requested vCPU execution time spent waiting for host scheduling.&lt;br /&gt;
&lt;br /&gt;
The first sample after state creation returns zero because no prior counter exists. Counter rollback, non-positive elapsed time, or an invalid vCPU count also returns zero rather than a misleading negative value.&lt;br /&gt;
&lt;br /&gt;
== Trigger thresholds ==&lt;br /&gt;
&lt;br /&gt;
=== HA triggers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Condition&lt;br /&gt;
! Persistence&lt;br /&gt;
! Severity&lt;br /&gt;
! Operational meaning&lt;br /&gt;
|-&lt;br /&gt;
| No master JSON data&lt;br /&gt;
| 30 seconds&lt;br /&gt;
| High&lt;br /&gt;
| Agent, user parameter, collector, or communication path is unavailable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;collection_ok=0&amp;lt;/code&amp;gt;&lt;br /&gt;
| 15 seconds&lt;br /&gt;
| High&lt;br /&gt;
| The collector is returning controlled failure snapshots.&lt;br /&gt;
|-&lt;br /&gt;
| Collection duration above 1,000 ms&lt;br /&gt;
| 5 minutes&lt;br /&gt;
| Warning&lt;br /&gt;
| Wort or libvirt query latency is elevated.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence code 1&lt;br /&gt;
| Continuously for 20 seconds&lt;br /&gt;
| Warning&lt;br /&gt;
| A release or acquisition transition is taking too long.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence code 2&lt;br /&gt;
| Continuously for 15 seconds&lt;br /&gt;
| High&lt;br /&gt;
| Authority, lease, intent, domain, disk, or fencing state is inconsistent.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence code 3&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| Storage attachment is unsafe.&lt;br /&gt;
|-&lt;br /&gt;
| Lease age above 10 seconds&lt;br /&gt;
| Continuously for 15 seconds&lt;br /&gt;
| Warning&lt;br /&gt;
| Heartbeat delivery is delayed well beyond its normal two-second interval.&lt;br /&gt;
|-&lt;br /&gt;
| Lease age above 20 seconds&lt;br /&gt;
| Continuously for 10 seconds&lt;br /&gt;
| High&lt;br /&gt;
| The owner has little active-lease headroom remaining.&lt;br /&gt;
|-&lt;br /&gt;
| Lease age above 25 seconds&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| The active lease is within five seconds of its 30-second limit.&lt;br /&gt;
|-&lt;br /&gt;
| Lease invalid&lt;br /&gt;
| Continuously for 10 seconds&lt;br /&gt;
| High&lt;br /&gt;
| Owner, generation, boot identifier, or age validation failed.&lt;br /&gt;
|-&lt;br /&gt;
| Fencing control invalid or disabled&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| Automatic fencing cannot be considered fully operational.&lt;br /&gt;
|-&lt;br /&gt;
| Fox or Anchor domain not running&lt;br /&gt;
| Continuously for 15 seconds&lt;br /&gt;
| High&lt;br /&gt;
| A NAS member is unavailable, including a node deliberately destroyed during fencing.&lt;br /&gt;
|-&lt;br /&gt;
| More than one live production-disk attachment&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| Possible double attachment; treat as a data-integrity emergency.&lt;br /&gt;
|-&lt;br /&gt;
| No live production-disk attachment&lt;br /&gt;
| Continuously for 20 seconds&lt;br /&gt;
| High&lt;br /&gt;
| No NAS node has served as production storage owner for too long.&lt;br /&gt;
|-&lt;br /&gt;
| Any persistent production-disk attachment&lt;br /&gt;
| Immediate&lt;br /&gt;
| Disaster&lt;br /&gt;
| The deployment violates the live-attachment-only design.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The lease-age triggers intentionally overlap. During a worsening event, Zabbix may show Warning, High, and Disaster problems together. The highest severity describes the current urgency; the earlier events preserve the escalation timeline.&lt;br /&gt;
&lt;br /&gt;
=== Scheduler-delay triggers ===&lt;br /&gt;
&lt;br /&gt;
The same thresholds apply separately to Fox and Anchor.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Delay&lt;br /&gt;
! Persistence&lt;br /&gt;
! Severity&lt;br /&gt;
|-&lt;br /&gt;
| Above 5 percent&lt;br /&gt;
| 5 minutes&lt;br /&gt;
| Warning&lt;br /&gt;
|-&lt;br /&gt;
| Above 15 percent&lt;br /&gt;
| 2 minutes&lt;br /&gt;
| High&lt;br /&gt;
|-&lt;br /&gt;
| Above 30 percent&lt;br /&gt;
| 1 minute&lt;br /&gt;
| Disaster&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Scheduler delay is a pressure indicator, not proof that a failover is imminent. Interpret it alongside lease age, collector duration, guest service monitoring, and host resource pressure.&lt;br /&gt;
&lt;br /&gt;
== Graphs ==&lt;br /&gt;
&lt;br /&gt;
The template contains two graphs:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS HA Lease&#039;&#039;&#039; — lease age, lease headroom, and the applicable limit.&lt;br /&gt;
* &#039;&#039;&#039;KitsNet NAS vCPU Scheduler Delay&#039;&#039;&#039; — Fox and Anchor scheduler-delay percentages.&lt;br /&gt;
&lt;br /&gt;
The lease graph is the clearest historical view of proximity to a stale-owner condition. Under normal operation, lease age remains near the bottom of the graph and headroom remains near the 30-second limit.&lt;br /&gt;
&lt;br /&gt;
== Initial deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Preconditions ===&lt;br /&gt;
&lt;br /&gt;
Before installation:&lt;br /&gt;
&lt;br /&gt;
* Stage 4 r4 NAS HA must already be installed and accepted.&lt;br /&gt;
* Wort must have Zabbix Agent 2, Python 3, sudo, and libvirt tools.&lt;br /&gt;
* The &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt; identity on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; must have a working SSH agent identity for Wort.&lt;br /&gt;
* Do not use &amp;lt;code&amp;gt;IdentitiesOnly=yes&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Connect to Wort as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt; and use sudo on Wort; do not open inbound root SSH.&lt;br /&gt;
* Confirm that the NAS state is stable before using installation acceptance checks.&lt;br /&gt;
&lt;br /&gt;
=== Install or reinstall from Git ===&lt;br /&gt;
&lt;br /&gt;
Run this on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for i in {1..10}; do echo; done&lt;br /&gt;
repo=/srv/git/KNdkr&lt;br /&gt;
report=/tmp/nas-ha-monitoring-install.log&lt;br /&gt;
&lt;br /&gt;
install_nas_monitoring()&lt;br /&gt;
(&lt;br /&gt;
    set -Eeuo pipefail&lt;br /&gt;
    cd &amp;quot;$repo&amp;quot;&lt;br /&gt;
    test &amp;quot;$(git branch --show-current)&amp;quot; = master&lt;br /&gt;
    git fetch --quiet origin master&lt;br /&gt;
    test &amp;quot;$(git rev-parse HEAD)&amp;quot; = &amp;quot;$(git rev-parse origin/master)&amp;quot;&lt;br /&gt;
    git tag -v nas-ha-monitoring-r1 2&amp;gt;/dev/null ||&lt;br /&gt;
        git tag -n99 nas-ha-monitoring-r1&lt;br /&gt;
    src/nas-ha-monitoring/install-monitoring-on-wort.sh&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
install_nas_monitoring 2&amp;gt;&amp;amp;1 | tee &amp;quot;$report&amp;quot;&lt;br /&gt;
install_rc=${PIPESTATUS[0]}&lt;br /&gt;
echo &amp;quot;install_rc=$install_rc&amp;quot;&lt;br /&gt;
echo &amp;quot;saved_output=$report&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer:&lt;br /&gt;
&lt;br /&gt;
# copies the three Wort deployment files through an SSH session initiated as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;;&lt;br /&gt;
# validates Python syntax and the sudoers fragment before installation;&lt;br /&gt;
# refuses to overwrite a different existing deployment;&lt;br /&gt;
# installs the collector as mode 0755;&lt;br /&gt;
# installs the Zabbix configuration as mode 0644;&lt;br /&gt;
# installs the sudoers fragment as mode 0440;&lt;br /&gt;
# restores SELinux file contexts when &amp;lt;code&amp;gt;restorecon&amp;lt;/code&amp;gt; is available;&lt;br /&gt;
# runs the collector as the Zabbix account;&lt;br /&gt;
# requires a healthy, valid, single-owner production state; and&lt;br /&gt;
# restarts only &amp;lt;code&amp;gt;zabbix-agent2.service&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It does not restart Keepalived, NFS, Veeam, heartbeat, or transition services. It does not alter fencing or disk attachments.&lt;br /&gt;
&lt;br /&gt;
=== Import the Zabbix template ===&lt;br /&gt;
&lt;br /&gt;
In Zabbix:&lt;br /&gt;
&lt;br /&gt;
# Open &#039;&#039;&#039;Data collection → Templates&#039;&#039;&#039;.&lt;br /&gt;
# Select &#039;&#039;&#039;Import&#039;&#039;&#039;.&lt;br /&gt;
# Select &amp;lt;code&amp;gt;src/nas-ha-monitoring/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt;, or a verified copy of that file.&lt;br /&gt;
# Enable &#039;&#039;&#039;Create new&#039;&#039;&#039;.&lt;br /&gt;
# Enable &#039;&#039;&#039;Update existing&#039;&#039;&#039;.&lt;br /&gt;
# Leave &#039;&#039;&#039;Delete missing&#039;&#039;&#039; disabled.&lt;br /&gt;
# Review the proposed changes and import.&lt;br /&gt;
&lt;br /&gt;
The release preserves the existing template UUID, vCPU item UUIDs, vCPU trigger UUIDs, and scheduler-delay graph UUID. The existing template group name &amp;lt;code&amp;gt;Templates/Montioring&amp;lt;/code&amp;gt;, including its historical spelling, is also preserved.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;KitsNet NAS Hypervisor&#039;&#039;&#039; template is already linked to the Wort host, the new items are inherited automatically. Otherwise, link the template to Wort after import.&lt;br /&gt;
&lt;br /&gt;
== Verification ==&lt;br /&gt;
&lt;br /&gt;
=== Wort collector verification ===&lt;br /&gt;
&lt;br /&gt;
Run from &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for i in {1..10}; do echo; done&lt;br /&gt;
report=/tmp/nas-ha-monitoring-verification.log&lt;br /&gt;
&lt;br /&gt;
verify_nas_monitoring()&lt;br /&gt;
(&lt;br /&gt;
    set -Eeuo pipefail&lt;br /&gt;
    ssh -o BatchMode=yes psmode@wort.lan.kitsnet.us &#039;sudo -n bash -s&#039; &amp;lt;&amp;lt;&#039;REMOTE&#039;&lt;br /&gt;
sha256sum \&lt;br /&gt;
    /usr/local/sbin/kitsnet-nas-ha-status \&lt;br /&gt;
    /etc/zabbix/zabbix_agent2.d/kitsnet-nas-ha-status.conf \&lt;br /&gt;
    /etc/sudoers.d/zabbix-kitsnet-nas-ha-status&lt;br /&gt;
systemctl is-active zabbix-agent2.service&lt;br /&gt;
sudo -u zabbix sudo -n /usr/local/sbin/kitsnet-nas-ha-status |&lt;br /&gt;
    python3 -m json.tool&lt;br /&gt;
zabbix_agent2 -t kitsnet.nas.ha.status&lt;br /&gt;
REMOTE&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
verify_nas_monitoring 2&amp;gt;&amp;amp;1 | tee &amp;quot;$report&amp;quot;&lt;br /&gt;
verification_rc=${PIPESTATUS[0]}&lt;br /&gt;
echo &amp;quot;verification_rc=$verification_rc&amp;quot;&lt;br /&gt;
echo &amp;quot;saved_output=$report&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A normal stable result has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
collection_ok=1&lt;br /&gt;
coherence_code=0&lt;br /&gt;
fencing_control_valid=1&lt;br /&gt;
lease_valid=1&lt;br /&gt;
live_production_vdb_count=1&lt;br /&gt;
persistent_production_vdb_count=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The owner may legitimately be Fox or Anchor. Do not encode generation 13 or Fox ownership as permanent monitoring expectations.&lt;br /&gt;
&lt;br /&gt;
=== Zabbix verification ===&lt;br /&gt;
&lt;br /&gt;
After at least 30 seconds:&lt;br /&gt;
&lt;br /&gt;
# Open &#039;&#039;&#039;Monitoring → Latest data&#039;&#039;&#039;.&lt;br /&gt;
# Select the Wort host.&lt;br /&gt;
# Filter the item name by &amp;lt;code&amp;gt;NAS HA&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Confirm that the master item and every dependent item are supported and have current timestamps.&lt;br /&gt;
# Confirm that the normal stable values listed above are present.&lt;br /&gt;
# Open &#039;&#039;&#039;Monitoring → Hosts → Graphs&#039;&#039;&#039; for Wort and inspect &#039;&#039;&#039;KitsNet NAS HA Lease&#039;&#039;&#039;.&lt;br /&gt;
# Confirm that no new HA problem is open under &#039;&#039;&#039;Monitoring → Problems&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the master item has a value but dependent items do not, inspect preprocessing errors on the dependent items. If the master item is unsupported, test the user parameter directly on Wort before changing the template.&lt;br /&gt;
&lt;br /&gt;
== Operational interpretation ==&lt;br /&gt;
&lt;br /&gt;
=== Normal owner heartbeat ===&lt;br /&gt;
&lt;br /&gt;
The guest heartbeat normally refreshes Wort approximately every two seconds. A typical observed lease age is therefore a small number of seconds. Occasional modest increases are not themselves a failover event.&lt;br /&gt;
&lt;br /&gt;
The validated load-and-delay test produced 15 successful refreshes and a maximum lease age of 8.662 seconds under simultaneous CPU pressure, memory pressure, NFS I/O, a competing MASTER request, and 500 ms per-packet SSH delay. The active lease limit remained 30 seconds, Fox was not fenced, and Anchor did not acquire the disk.&lt;br /&gt;
&lt;br /&gt;
=== What approaching failover looks like ===&lt;br /&gt;
&lt;br /&gt;
A likely developing owner-path problem normally appears in this order:&lt;br /&gt;
&lt;br /&gt;
# Lease age rises above its usual range.&lt;br /&gt;
# Lease headroom falls by the same amount.&lt;br /&gt;
# Scheduler delay, collector duration, guest service alarms, or network alarms may provide an explanation.&lt;br /&gt;
# The 10-second lease-age Warning opens if the condition persists.&lt;br /&gt;
# The 20-second High alarm opens if the lease continues aging.&lt;br /&gt;
# The 25-second Disaster alarm indicates less than five seconds before the active lease limit.&lt;br /&gt;
# Lease validity becomes false after expiry.&lt;br /&gt;
&lt;br /&gt;
Lease expiry by itself does not attach the disk to the peer. The fencing path is exercised when a competing eligible MASTER requests takeover and the complete authority, lease, VM, and attachment checks permit it.&lt;br /&gt;
&lt;br /&gt;
=== Successful failover ===&lt;br /&gt;
&lt;br /&gt;
During an orderly or automatic handoff, a brief coherence code 1 and a brief zero live-disk count can be normal. The alert persistence periods allow those transitions to complete without immediately opening a problem.&lt;br /&gt;
&lt;br /&gt;
After completion, all of the following should change coherently:&lt;br /&gt;
&lt;br /&gt;
* authority owner;&lt;br /&gt;
* authority generation;&lt;br /&gt;
* owner MASTER intent;&lt;br /&gt;
* peer BACKUP intent;&lt;br /&gt;
* live disk owner; and&lt;br /&gt;
* coherence state.&lt;br /&gt;
&lt;br /&gt;
The final state should be &amp;lt;code&amp;gt;HEALTHY_ANCHOR&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;HEALTHY_FOX&amp;lt;/code&amp;gt; with a freshly renewed lease.&lt;br /&gt;
&lt;br /&gt;
== Alert response ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Alert&lt;br /&gt;
! First response&lt;br /&gt;
! Prohibited shortcut&lt;br /&gt;
|-&lt;br /&gt;
| Lease age Warning or High&lt;br /&gt;
| Compare lease age with vCPU delay, guest reachability, heartbeat service status, Wort load, and SSH latency. Preserve evidence before intervening.&lt;br /&gt;
| Do not force a failover solely because lease age briefly increased.&lt;br /&gt;
|-&lt;br /&gt;
| Lease within five seconds of expiry&lt;br /&gt;
| Treat as urgent. Determine whether the owner guest is running and whether its heartbeat/control path has stalled. Watch authority and attachment state continuously.&lt;br /&gt;
| Do not manually attach the production LV to the peer.&lt;br /&gt;
|-&lt;br /&gt;
| Coherence inconsistent&lt;br /&gt;
| Compare owner, generation, intents, lease validity, domain states, and live owner from the same JSON snapshot.&lt;br /&gt;
| Do not restart both NAS nodes together.&lt;br /&gt;
|-&lt;br /&gt;
| Unsafe attachment&lt;br /&gt;
| Stop ordinary recovery activity and inspect live and inactive XML on both domains. Protect data integrity first.&lt;br /&gt;
| Do not mount or start NFS on either node until exclusive ownership is proven.&lt;br /&gt;
|-&lt;br /&gt;
| Fencing control invalid&lt;br /&gt;
| Inspect file existence, regular-file type, mode 0600, root ownership, and content &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Determine whether disablement was intentional maintenance.&lt;br /&gt;
| Do not recreate the flag during a controlled rebuild or shutdown procedure that requires fencing disabled.&lt;br /&gt;
|-&lt;br /&gt;
| NAS domain not running&lt;br /&gt;
| Determine whether it was deliberately fenced, administratively stopped, or failed. Confirm where the disk and authority ended.&lt;br /&gt;
| Do not restart a destroyed former owner until storage ownership is known.&lt;br /&gt;
|-&lt;br /&gt;
| Collector failure or no data&lt;br /&gt;
| Check Zabbix Agent 2, the user parameter, sudo validation, SELinux denials, and libvirt query access.&lt;br /&gt;
| Do not weaken the sudo rule to unrestricted commands.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Wort major-version rebuild ==&lt;br /&gt;
&lt;br /&gt;
Monitoring restoration occurs only after the base hypervisor, libvirt configuration, Stage 4 r4 code, authority-state recovery, and controlled HA acceptance are complete.&lt;br /&gt;
&lt;br /&gt;
=== Rebuild sequence ===&lt;br /&gt;
&lt;br /&gt;
# Keep production fencing disabled during the controlled rebuild and recovery procedure, as required by the main NAS HA rebuild runbook.&lt;br /&gt;
# Reinstall Zabbix Agent 2 from the approved Zabbix 7.0 repository.&lt;br /&gt;
# Restore the libvirt domains, network, pools, and live-attachment-only storage design.&lt;br /&gt;
# Restore the Stage 4 r4 Wort scripts and arbiter state according to the NAS HA rebuild procedure.&lt;br /&gt;
# Complete the fencing-disabled HA acceptance and establish a coherent owner.&lt;br /&gt;
# Restore the monitoring collector from Git by running &amp;lt;code&amp;gt;src/nas-ha-monitoring/install-monitoring-on-wort.sh&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Confirm that the collector works through Zabbix Agent 2.&lt;br /&gt;
# Re-enable production fencing only through the separately validated HA enablement procedure.&lt;br /&gt;
# Confirm &amp;lt;code&amp;gt;fencing_control_valid=1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;coherence_code=0&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Import the template only if the Zabbix server configuration was also lost or rebuilt. Ordinarily the existing template remains intact.&lt;br /&gt;
# Verify Latest data, graphs, and Problems.&lt;br /&gt;
&lt;br /&gt;
The monitoring installer expects the production HA system to be coherent and fencing to be valid at its final acceptance check. Therefore, during a rebuild, run it after the HA solution has returned to its final accepted operational state.&lt;br /&gt;
&lt;br /&gt;
== Zabbix server or template recovery ==&lt;br /&gt;
&lt;br /&gt;
If the Zabbix server loses the template:&lt;br /&gt;
&lt;br /&gt;
# Obtain &amp;lt;code&amp;gt;configs/nas/KitsNet-NAS-Hypervisor-zabbix-7.0.yaml&amp;lt;/code&amp;gt; from commit &amp;lt;code&amp;gt;1d1904d1ca9eedfa076358928fdf61999b7bc7a5&amp;lt;/code&amp;gt; or tag &amp;lt;code&amp;gt;nas-ha-monitoring-r1&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Verify its SHA-256 hash.&lt;br /&gt;
# Import with &#039;&#039;&#039;Create new&#039;&#039;&#039; and &#039;&#039;&#039;Update existing&#039;&#039;&#039; enabled.&lt;br /&gt;
# Keep &#039;&#039;&#039;Delete missing&#039;&#039;&#039; disabled unless a separately reviewed change explicitly requires deletion.&lt;br /&gt;
# Link &#039;&#039;&#039;KitsNet NAS Hypervisor&#039;&#039;&#039; to Wort if the linkage was not restored with the Zabbix database.&lt;br /&gt;
# Allow at least 30 seconds for initial collection and dependent-item processing.&lt;br /&gt;
# Perform the Zabbix verification procedure above.&lt;br /&gt;
&lt;br /&gt;
== Security and secrets ==&lt;br /&gt;
&lt;br /&gt;
No private SSH key, password, keytab, Zabbix TLS secret, or other private credential is stored in the monitoring release.&lt;br /&gt;
&lt;br /&gt;
The Zabbix account receives only this additional sudo permission:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/sbin/kitsnet-nas-ha-status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The collector has no command-line arguments, rejects no user-supplied domain name because none is accepted, and uses fixed state paths, domain names, and production source paths. This prevents the Zabbix item key from being used as a general libvirt or shell-command interface.&lt;br /&gt;
&lt;br /&gt;
The deployment controller follows KitsNet SSH policy:&lt;br /&gt;
&lt;br /&gt;
* connections originate on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;psmode&amp;lt;/code&amp;gt;;&lt;br /&gt;
* the working identity comes from the SSH agent;&lt;br /&gt;
* &amp;lt;code&amp;gt;IdentitiesOnly=yes&amp;lt;/code&amp;gt; is not used; and&lt;br /&gt;
* privilege escalation occurs through sudo on Wort.&lt;br /&gt;
&lt;br /&gt;
== Known scope boundaries ==&lt;br /&gt;
&lt;br /&gt;
The r1 collector measures the authoritative Wort-side HA control and attachment state. It does not directly query inside Fox or Anchor for:&lt;br /&gt;
&lt;br /&gt;
* Keepalived process state or advertisement age;&lt;br /&gt;
* NFS service state or client latency;&lt;br /&gt;
* Veeam service state;&lt;br /&gt;
* guest filesystem mount state;&lt;br /&gt;
* guest heartbeat unit restart count; or&lt;br /&gt;
* guest network packet loss.&lt;br /&gt;
&lt;br /&gt;
Those guest and service metrics should remain on the Fox and Anchor host templates and can be presented beside the Wort HA metrics in a Zabbix dashboard. Wort is deliberately not given broad remote credentials merely to collect them.&lt;br /&gt;
&lt;br /&gt;
== Change control ==&lt;br /&gt;
&lt;br /&gt;
Changes should begin in &amp;lt;code&amp;gt;src/nas-ha-monitoring/&amp;lt;/code&amp;gt;. After testing, update the deployment mirrors in &amp;lt;code&amp;gt;scripts/&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;configs/nas/&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configs/sudoers/&amp;lt;/code&amp;gt;. Validate exact byte equality between canonical files, mirrors, and deployed files before committing.&lt;br /&gt;
&lt;br /&gt;
Stage only the monitoring paths. The repository may contain unrelated modified or untracked work that must not enter a monitoring commit.&lt;br /&gt;
&lt;br /&gt;
For every release:&lt;br /&gt;
&lt;br /&gt;
# validate Python and shell syntax;&lt;br /&gt;
# validate the sudoers fragment with &amp;lt;code&amp;gt;visudo -cf&amp;lt;/code&amp;gt;;&lt;br /&gt;
# import and validate the Zabbix YAML against the deployed Zabbix major version;&lt;br /&gt;
# test the collector as the Zabbix account;&lt;br /&gt;
# verify healthy HA state without initiating a failover;&lt;br /&gt;
# review the staged path list and staged diff;&lt;br /&gt;
# commit;&lt;br /&gt;
# create an annotated monitoring release tag;&lt;br /&gt;
# push both the branch and tag; and&lt;br /&gt;
# verify the remote branch and peeled tag commit IDs.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Zabbix 7.0 dependent items: https://www.zabbix.com/documentation/7.0/en/manual/config/items/itemtypes/dependent_items&lt;br /&gt;
* Zabbix 7.0 template export and import: https://www.zabbix.com/documentation/7.0/en/manual/xml_export_import/templates&lt;br /&gt;
* Git repository: &amp;lt;code&amp;gt;/srv/git/KNdkr&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;mgr1&amp;lt;/code&amp;gt;&lt;br /&gt;
* Monitoring release: &amp;lt;code&amp;gt;nas-ha-monitoring-r1&amp;lt;/code&amp;gt;&lt;br /&gt;
* Stage 4 r4 release tag: &amp;lt;code&amp;gt;nas-ha-stage4-r4-production-r2&amp;lt;/code&amp;gt;&lt;br /&gt;
[[Category:High Availability NAS]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2704</id>
		<title>KitsNet Operations:Services:LDAP:Authentication Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2704"/>
		<updated>2026-09-27T18:22:35Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
KitsNet applications such as MediaWiki and Grafana authenticate users against the KNADA Active Directory domain using LDAP/LDAPS.&lt;br /&gt;
A failed login does ‘’‘not’’’ necessarily indicate an LDAP server, TLS, CA, or application configuration problem. In particular, an expired KNADA user password may be presented by applications only as a generic authentication failure.&lt;br /&gt;
=== Recommended Diagnostic Order ===&lt;br /&gt;
When one or more LDAP-authenticated applications reject a user’s credentials, use the following sequence before changing application configuration.&lt;br /&gt;
==== Check the affected KNADA user account ====&lt;br /&gt;
On a Samba AD domain controller, such as frangelico:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo samba-tool user show USERNAME&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Review the account state and password information for indications that the password has expired or that the account is otherwise restricted.&lt;br /&gt;
==== Test the user’s password directly over LDAPS ====&lt;br /&gt;
From a system with the KNADA CA installed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ldapwhoami \&lt;br /&gt;
  -x \&lt;br /&gt;
  -H ldaps://frangelico.knada.lan.kitsnet.us:636 \&lt;br /&gt;
  -D &#039;USERNAME@knada.lan.kitsnet.us&#039; \&lt;br /&gt;
  -W&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful authentication returns the authenticated LDAP identity.&lt;br /&gt;
If this fails, do not immediately assume that TLS or LDAP connectivity is broken. Check the user’s password expiration and account state first.&lt;br /&gt;
==== Test Kerberos authentication ====&lt;br /&gt;
A direct Kerberos test provides an additional check of the user’s KNADA credential:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kdestroy 2&amp;gt;/dev/null || true&lt;br /&gt;
kinit USERNAME@KNADA.LAN.KITSNET.US&lt;br /&gt;
klist&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful kinit followed by a valid TGT in klist confirms that the user’s password is accepted by Active Directory.&lt;br /&gt;
==== Verify application service-account LDAP access ====&lt;br /&gt;
Applications normally use a service account to search Active Directory before authenticating the individual user.&lt;br /&gt;
For the Wiki, the service account is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CN=svc-wiki-ldap,CN=Users,DC=knada,DC=lan,DC=kitsnet,DC=us&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify that the application service account can:&lt;br /&gt;
establish an LDAPS connection;&lt;br /&gt;
validate the KNADA server certificate;&lt;br /&gt;
bind successfully;&lt;br /&gt;
search the KNADA directory.&lt;br /&gt;
A successful service-account bind proves that the application’s LDAP infrastructure is substantially healthy, but it does ‘’‘not’’’ prove that an individual user’s password is valid.&lt;br /&gt;
==== Verify TLS and CA trust only if necessary ====&lt;br /&gt;
The current KNADA LDAP CA is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
O=KitsNet&lt;br /&gt;
OU=KNADA LDAP&lt;br /&gt;
CN=KitsNet KNADA LDAP CA 2026&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
SHA-256 fingerprint:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
A1:26:57:8E:37:05:52:65:2E:26:7E:48:B0:66:7A:5D:04:4F:C8:BB:A3:4E:E8:B7:12:97:A1:3F:A3:28:15:4F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The application-specific CA bundle used by Wiki and other Swarm services contains three certificates:&lt;br /&gt;
Historical Frangelico Samba-generated CA&lt;br /&gt;
Historical Emperador Samba-generated CA&lt;br /&gt;
Current KitsNet KNADA LDAP CA 2026&lt;br /&gt;
When inspecting a multi-certificate PEM bundle, note that:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl x509 -in bundle.pem -noout -subject -issuer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
displays only the ‘’‘first certificate’’’ in the file.&lt;br /&gt;
Do not conclude that the bundle lacks the current CA based solely on that command. Split or enumerate all certificates in the bundle before diagnosing it as stale.&lt;br /&gt;
=== September 2026 Incident ===&lt;br /&gt;
In September 2026, KNADA authentication failed simultaneously in MediaWiki and Grafana.&lt;br /&gt;
Initial investigation verified:&lt;br /&gt;
IPv4 and IPv6 connectivity to both KNADA domain controllers;&lt;br /&gt;
LDAP and LDAPS availability;&lt;br /&gt;
successful TLS certificate validation;&lt;br /&gt;
correct application CA bundles;&lt;br /&gt;
successful Wiki service-account binds to both Frangelico and Emperador;&lt;br /&gt;
successful LDAP directory searches from the running Wiki container.&lt;br /&gt;
The actual cause was that the affected user’s KNADA password had expired.&lt;br /&gt;
Neither MediaWiki nor Grafana clearly reported the password-expired condition to the user. Both presented the condition as a generic login/authentication failure.&lt;br /&gt;
This incident established the following troubleshooting rule:&lt;br /&gt;
‘’‘When multiple LDAP-authenticated applications reject the same user’s otherwise known-good credentials, check that user’s AD password/account state before changing LDAP, TLS, CA, or application configuration.’’’&lt;br /&gt;
=== Host CA Trust Note ===&lt;br /&gt;
During the same investigation, it was discovered that several Rocky Linux systems did not have the current KNADA LDAP CA installed in their system trust store.&lt;br /&gt;
This was corrected separately through the KitsNet Ansible CA-distribution process.&lt;br /&gt;
That host-trust issue was a valid configuration defect, but it was ‘’‘not’’’ the cause of the MediaWiki and Grafana login failures in this incident because those applications already used their own correct KNADA CA bundles.&lt;br /&gt;
&lt;br /&gt;
[[Category:LDAP]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2703</id>
		<title>KitsNet Operations:Services:LDAP:Authentication Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2703"/>
		<updated>2026-09-27T18:22:16Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LDAP Authentication Troubleshooting ==&lt;br /&gt;
KitsNet applications such as MediaWiki and Grafana authenticate users against the KNADA Active Directory domain using LDAP/LDAPS.&lt;br /&gt;
A failed login does ‘’‘not’’’ necessarily indicate an LDAP server, TLS, CA, or application configuration problem. In particular, an expired KNADA user password may be presented by applications only as a generic authentication failure.&lt;br /&gt;
=== Recommended Diagnostic Order ===&lt;br /&gt;
When one or more LDAP-authenticated applications reject a user’s credentials, use the following sequence before changing application configuration.&lt;br /&gt;
==== Check the affected KNADA user account ====&lt;br /&gt;
On a Samba AD domain controller, such as frangelico:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo samba-tool user show USERNAME&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Review the account state and password information for indications that the password has expired or that the account is otherwise restricted.&lt;br /&gt;
==== Test the user’s password directly over LDAPS ====&lt;br /&gt;
From a system with the KNADA CA installed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ldapwhoami \&lt;br /&gt;
  -x \&lt;br /&gt;
  -H ldaps://frangelico.knada.lan.kitsnet.us:636 \&lt;br /&gt;
  -D &#039;USERNAME@knada.lan.kitsnet.us&#039; \&lt;br /&gt;
  -W&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful authentication returns the authenticated LDAP identity.&lt;br /&gt;
If this fails, do not immediately assume that TLS or LDAP connectivity is broken. Check the user’s password expiration and account state first.&lt;br /&gt;
==== Test Kerberos authentication ====&lt;br /&gt;
A direct Kerberos test provides an additional check of the user’s KNADA credential:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kdestroy 2&amp;gt;/dev/null || true&lt;br /&gt;
kinit USERNAME@KNADA.LAN.KITSNET.US&lt;br /&gt;
klist&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful kinit followed by a valid TGT in klist confirms that the user’s password is accepted by Active Directory.&lt;br /&gt;
==== Verify application service-account LDAP access ====&lt;br /&gt;
Applications normally use a service account to search Active Directory before authenticating the individual user.&lt;br /&gt;
For the Wiki, the service account is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CN=svc-wiki-ldap,CN=Users,DC=knada,DC=lan,DC=kitsnet,DC=us&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify that the application service account can:&lt;br /&gt;
establish an LDAPS connection;&lt;br /&gt;
validate the KNADA server certificate;&lt;br /&gt;
bind successfully;&lt;br /&gt;
search the KNADA directory.&lt;br /&gt;
A successful service-account bind proves that the application’s LDAP infrastructure is substantially healthy, but it does ‘’‘not’’’ prove that an individual user’s password is valid.&lt;br /&gt;
==== Verify TLS and CA trust only if necessary ====&lt;br /&gt;
The current KNADA LDAP CA is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
O=KitsNet&lt;br /&gt;
OU=KNADA LDAP&lt;br /&gt;
CN=KitsNet KNADA LDAP CA 2026&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
SHA-256 fingerprint:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
A1:26:57:8E:37:05:52:65:2E:26:7E:48:B0:66:7A:5D:04:4F:C8:BB:A3:4E:E8:B7:12:97:A1:3F:A3:28:15:4F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The application-specific CA bundle used by Wiki and other Swarm services contains three certificates:&lt;br /&gt;
Historical Frangelico Samba-generated CA&lt;br /&gt;
Historical Emperador Samba-generated CA&lt;br /&gt;
Current KitsNet KNADA LDAP CA 2026&lt;br /&gt;
When inspecting a multi-certificate PEM bundle, note that:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl x509 -in bundle.pem -noout -subject -issuer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
displays only the ‘’‘first certificate’’’ in the file.&lt;br /&gt;
Do not conclude that the bundle lacks the current CA based solely on that command. Split or enumerate all certificates in the bundle before diagnosing it as stale.&lt;br /&gt;
=== September 2026 Incident ===&lt;br /&gt;
In September 2026, KNADA authentication failed simultaneously in MediaWiki and Grafana.&lt;br /&gt;
Initial investigation verified:&lt;br /&gt;
IPv4 and IPv6 connectivity to both KNADA domain controllers;&lt;br /&gt;
LDAP and LDAPS availability;&lt;br /&gt;
successful TLS certificate validation;&lt;br /&gt;
correct application CA bundles;&lt;br /&gt;
successful Wiki service-account binds to both Frangelico and Emperador;&lt;br /&gt;
successful LDAP directory searches from the running Wiki container.&lt;br /&gt;
The actual cause was that the affected user’s KNADA password had expired.&lt;br /&gt;
Neither MediaWiki nor Grafana clearly reported the password-expired condition to the user. Both presented the condition as a generic login/authentication failure.&lt;br /&gt;
This incident established the following troubleshooting rule:&lt;br /&gt;
‘’‘When multiple LDAP-authenticated applications reject the same user’s otherwise known-good credentials, check that user’s AD password/account state before changing LDAP, TLS, CA, or application configuration.’’’&lt;br /&gt;
=== Host CA Trust Note ===&lt;br /&gt;
During the same investigation, it was discovered that several Rocky Linux systems did not have the current KNADA LDAP CA installed in their system trust store.&lt;br /&gt;
This was corrected separately through the KitsNet Ansible CA-distribution process.&lt;br /&gt;
That host-trust issue was a valid configuration defect, but it was ‘’‘not’’’ the cause of the MediaWiki and Grafana login failures in this incident because those applications already used their own correct KNADA CA bundles.&lt;br /&gt;
&lt;br /&gt;
[[Category:LDAP]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2702</id>
		<title>KitsNet Operations:Services:LDAP:Authentication Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2702"/>
		<updated>2026-09-27T18:20:25Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LDAP Authentication Troubleshooting ==&lt;br /&gt;
KitsNet applications such as MediaWiki and Grafana authenticate users against the KNADA Active Directory domain using LDAP/LDAPS.&lt;br /&gt;
A failed login does ‘’‘not’’’ necessarily indicate an LDAP server, TLS, CA, or application configuration problem. In particular, an expired KNADA user password may be presented by applications only as a generic authentication failure.&lt;br /&gt;
=== Recommended Diagnostic Order ===&lt;br /&gt;
When one or more LDAP-authenticated applications reject a user’s credentials, use the following sequence before changing application configuration.&lt;br /&gt;
==== 1. Check the affected KNADA user account ====&lt;br /&gt;
On a Samba AD domain controller, such as frangelico:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo samba-tool user show USERNAME&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Review the account state and password information for indications that the password has expired or that the account is otherwise restricted.&lt;br /&gt;
==== 2. Test the user’s password directly over LDAPS ====&lt;br /&gt;
From a system with the KNADA CA installed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ldapwhoami \&lt;br /&gt;
  -x \&lt;br /&gt;
  -H ldaps://frangelico.knada.lan.kitsnet.us:636 \&lt;br /&gt;
  -D &#039;USERNAME@knada.lan.kitsnet.us&#039; \&lt;br /&gt;
  -W&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful authentication returns the authenticated LDAP identity.&lt;br /&gt;
If this fails, do not immediately assume that TLS or LDAP connectivity is broken. Check the user’s password expiration and account state first.&lt;br /&gt;
==== 3. Test Kerberos authentication ====&lt;br /&gt;
A direct Kerberos test provides an additional check of the user’s KNADA credential:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kdestroy 2&amp;gt;/dev/null || true&lt;br /&gt;
kinit USERNAME@KNADA.LAN.KITSNET.US&lt;br /&gt;
klist&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful kinit followed by a valid TGT in klist confirms that the user’s password is accepted by Active Directory.&lt;br /&gt;
==== 4. Verify application service-account LDAP access ====&lt;br /&gt;
Applications normally use a service account to search Active Directory before authenticating the individual user.&lt;br /&gt;
For the Wiki, the service account is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CN=svc-wiki-ldap,CN=Users,DC=knada,DC=lan,DC=kitsnet,DC=us&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify that the application service account can:&lt;br /&gt;
establish an LDAPS connection;&lt;br /&gt;
validate the KNADA server certificate;&lt;br /&gt;
bind successfully;&lt;br /&gt;
search the KNADA directory.&lt;br /&gt;
A successful service-account bind proves that the application’s LDAP infrastructure is substantially healthy, but it does ‘’‘not’’’ prove that an individual user’s password is valid.&lt;br /&gt;
==== 5. Verify TLS and CA trust only if necessary ====&lt;br /&gt;
The current KNADA LDAP CA is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
O=KitsNet&lt;br /&gt;
OU=KNADA LDAP&lt;br /&gt;
CN=KitsNet KNADA LDAP CA 2026&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
SHA-256 fingerprint:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
A1:26:57:8E:37:05:52:65:2E:26:7E:48:B0:66:7A:5D:04:4F:C8:BB:A3:4E:E8:B7:12:97:A1:3F:A3:28:15:4F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The application-specific CA bundle used by Wiki and other Swarm services contains three certificates:&lt;br /&gt;
Historical Frangelico Samba-generated CA&lt;br /&gt;
Historical Emperador Samba-generated CA&lt;br /&gt;
Current KitsNet KNADA LDAP CA 2026&lt;br /&gt;
When inspecting a multi-certificate PEM bundle, note that:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl x509 -in bundle.pem -noout -subject -issuer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
displays only the ‘’‘first certificate’’’ in the file.&lt;br /&gt;
Do not conclude that the bundle lacks the current CA based solely on that command. Split or enumerate all certificates in the bundle before diagnosing it as stale.&lt;br /&gt;
=== September 2026 Incident ===&lt;br /&gt;
In September 2026, KNADA authentication failed simultaneously in MediaWiki and Grafana.&lt;br /&gt;
Initial investigation verified:&lt;br /&gt;
IPv4 and IPv6 connectivity to both KNADA domain controllers;&lt;br /&gt;
LDAP and LDAPS availability;&lt;br /&gt;
successful TLS certificate validation;&lt;br /&gt;
correct application CA bundles;&lt;br /&gt;
successful Wiki service-account binds to both Frangelico and Emperador;&lt;br /&gt;
successful LDAP directory searches from the running Wiki container.&lt;br /&gt;
The actual cause was that the affected user’s KNADA password had expired.&lt;br /&gt;
Neither MediaWiki nor Grafana clearly reported the password-expired condition to the user. Both presented the condition as a generic login/authentication failure.&lt;br /&gt;
This incident established the following troubleshooting rule:&lt;br /&gt;
‘’‘When multiple LDAP-authenticated applications reject the same user’s otherwise known-good credentials, check that user’s AD password/account state before changing LDAP, TLS, CA, or application configuration.’’’&lt;br /&gt;
=== Host CA Trust Note ===&lt;br /&gt;
During the same investigation, it was discovered that several Rocky Linux systems did not have the current KNADA LDAP CA installed in their system trust store.&lt;br /&gt;
This was corrected separately through the KitsNet Ansible CA-distribution process.&lt;br /&gt;
That host-trust issue was a valid configuration defect, but it was ‘’‘not’’’ the cause of the MediaWiki and Grafana login failures in this incident because those applications already used their own correct KNADA CA bundles.&lt;br /&gt;
[[Category:LDAP]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2701</id>
		<title>KitsNet Operations:Services:LDAP:Authentication Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:LDAP:Authentication_Troubleshooting&amp;diff=2701"/>
		<updated>2026-09-27T18:19:22Z</updated>

		<summary type="html">&lt;p&gt;Psmode: Created page with &amp;quot;== LDAP Authentication Troubleshooting == KitsNet applications such as MediaWiki and Grafana authenticate users against the KNADA Active Directory domain using LDAP/LDAPS. A failed login does ‘’‘not’’’ necessarily indicate an LDAP server, TLS, CA, or application configuration problem. In particular, an expired KNADA user password may be presented by applications only as a generic authentication failure. === Recommended Diagnostic Order === When one or more LD...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LDAP Authentication Troubleshooting ==&lt;br /&gt;
KitsNet applications such as MediaWiki and Grafana authenticate users against the KNADA Active Directory domain using LDAP/LDAPS.&lt;br /&gt;
A failed login does ‘’‘not’’’ necessarily indicate an LDAP server, TLS, CA, or application configuration problem. In particular, an expired KNADA user password may be presented by applications only as a generic authentication failure.&lt;br /&gt;
=== Recommended Diagnostic Order ===&lt;br /&gt;
When one or more LDAP-authenticated applications reject a user’s credentials, use the following sequence before changing application configuration.&lt;br /&gt;
==== 1. Check the affected KNADA user account ====&lt;br /&gt;
On a Samba AD domain controller, such as frangelico:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo samba-tool user show USERNAME&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Review the account state and password information for indications that the password has expired or that the account is otherwise restricted.&lt;br /&gt;
==== 2. Test the user’s password directly over LDAPS ====&lt;br /&gt;
From a system with the KNADA CA installed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ldapwhoami \&lt;br /&gt;
  -x \&lt;br /&gt;
  -H ldaps://frangelico.knada.lan.kitsnet.us:636 \&lt;br /&gt;
  -D &#039;USERNAME@knada.lan.kitsnet.us&#039; \&lt;br /&gt;
  -W&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful authentication returns the authenticated LDAP identity.&lt;br /&gt;
If this fails, do not immediately assume that TLS or LDAP connectivity is broken. Check the user’s password expiration and account state first.&lt;br /&gt;
==== 3. Test Kerberos authentication ====&lt;br /&gt;
A direct Kerberos test provides an additional check of the user’s KNADA credential:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kdestroy 2&amp;gt;/dev/null || true&lt;br /&gt;
kinit USERNAME@KNADA.LAN.KITSNET.US&lt;br /&gt;
klist&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A successful kinit followed by a valid TGT in klist confirms that the user’s password is accepted by Active Directory.&lt;br /&gt;
==== 4. Verify application service-account LDAP access ====&lt;br /&gt;
Applications normally use a service account to search Active Directory before authenticating the individual user.&lt;br /&gt;
For the Wiki, the service account is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CN=svc-wiki-ldap,CN=Users,DC=knada,DC=lan,DC=kitsnet,DC=us&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify that the application service account can:&lt;br /&gt;
establish an LDAPS connection;&lt;br /&gt;
validate the KNADA server certificate;&lt;br /&gt;
bind successfully;&lt;br /&gt;
search the KNADA directory.&lt;br /&gt;
A successful service-account bind proves that the application’s LDAP infrastructure is substantially healthy, but it does ‘’‘not’’’ prove that an individual user’s password is valid.&lt;br /&gt;
==== 5. Verify TLS and CA trust only if necessary ====&lt;br /&gt;
The current KNADA LDAP CA is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
O=KitsNet&lt;br /&gt;
OU=KNADA LDAP&lt;br /&gt;
CN=KitsNet KNADA LDAP CA 2026&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
SHA-256 fingerprint:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
A1:26:57:8E:37:05:52:65:2E:26:7E:48:B0:66:7A:5D:04:4F:C8:BB:A3:4E:E8:B7:12:97:A1:3F:A3:28:15:4F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The application-specific CA bundle used by Wiki and other Swarm services contains three certificates:&lt;br /&gt;
Historical Frangelico Samba-generated CA&lt;br /&gt;
Historical Emperador Samba-generated CA&lt;br /&gt;
Current KitsNet KNADA LDAP CA 2026&lt;br /&gt;
When inspecting a multi-certificate PEM bundle, note that:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl x509 -in bundle.pem -noout -subject -issuer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
displays only the ‘’‘first certificate’’’ in the file.&lt;br /&gt;
Do not conclude that the bundle lacks the current CA based solely on that command. Split or enumerate all certificates in the bundle before diagnosing it as stale.&lt;br /&gt;
=== September 2026 Incident ===&lt;br /&gt;
In September 2026, KNADA authentication failed simultaneously in MediaWiki and Grafana.&lt;br /&gt;
Initial investigation verified:&lt;br /&gt;
IPv4 and IPv6 connectivity to both KNADA domain controllers;&lt;br /&gt;
LDAP and LDAPS availability;&lt;br /&gt;
successful TLS certificate validation;&lt;br /&gt;
correct application CA bundles;&lt;br /&gt;
successful Wiki service-account binds to both Frangelico and Emperador;&lt;br /&gt;
successful LDAP directory searches from the running Wiki container.&lt;br /&gt;
The actual cause was that the affected user’s KNADA password had expired.&lt;br /&gt;
Neither MediaWiki nor Grafana clearly reported the password-expired condition to the user. Both presented the condition as a generic login/authentication failure.&lt;br /&gt;
This incident established the following troubleshooting rule:&lt;br /&gt;
‘’‘When multiple LDAP-authenticated applications reject the same user’s otherwise known-good credentials, check that user’s AD password/account state before changing LDAP, TLS, CA, or application configuration.’’’&lt;br /&gt;
=== Host CA Trust Note ===&lt;br /&gt;
During the same investigation, it was discovered that several Rocky Linux systems did not have the current KNADA LDAP CA installed in their system trust store.&lt;br /&gt;
This was corrected separately through the KitsNet Ansible CA-distribution process.&lt;br /&gt;
That host-trust issue was a valid configuration defect, but it was ‘’‘not’’’ the cause of the MediaWiki and Grafana login failures in this incident because those applications already used their own correct KNADA CA bundles.&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Services&amp;diff=2696</id>
		<title>KitsNet Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Services&amp;diff=2696"/>
		<updated>2026-09-22T12:58:07Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
This page provides the hierarchical index of KitsNet service documentation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;categorytree mode=&amp;quot;pages&amp;quot; depth=&amp;quot;5&amp;quot; hideroot=&amp;quot;on&amp;quot; showcount=&amp;quot;off&amp;quot;&amp;gt;&lt;br /&gt;
KitsNet Services&lt;br /&gt;
&amp;lt;/categorytree&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Mail_Gateway:No-Subscription_Warning_Suppression&amp;diff=2695</id>
		<title>KitsNet Operations:Services:Mail Gateway:No-Subscription Warning Suppression</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Mail_Gateway:No-Subscription_Warning_Suppression&amp;diff=2695"/>
		<updated>2026-09-22T12:54:52Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
This local customization suppresses Proxmox Mail Gateway (PMG) &#039;&#039;&#039;&amp;quot;No valid subscription&amp;quot;&#039;&#039;&#039; warnings in the web interface without pretending that the system has a valid subscription and without changing PMG mail filtering, repository configuration, licensing state, or subscription data.&lt;br /&gt;
&lt;br /&gt;
The customization is intended for the KitsNet PMG host &#039;&#039;&#039;dusse&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Initially tested with:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| proxmox-mailgateway&lt;br /&gt;
| 9.1&lt;br /&gt;
|-&lt;br /&gt;
| pmg-api&lt;br /&gt;
| 9.1.2&lt;br /&gt;
|-&lt;br /&gt;
| pmg-gui&lt;br /&gt;
| 5.2.2&lt;br /&gt;
|-&lt;br /&gt;
| proxmox-widget-toolkit&lt;br /&gt;
| 5.2.8&lt;br /&gt;
|-&lt;br /&gt;
| pmg-mobile-quarantine-ui&lt;br /&gt;
| 0.5.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Files Installed ==&lt;br /&gt;
&lt;br /&gt;
; Main patcher&lt;br /&gt;
: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-pmg-nosub-patch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; APT/DPKG wrapper&lt;br /&gt;
: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-pmg-nosub-apt-hook&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; APT hook&lt;br /&gt;
: &amp;lt;code&amp;gt;/etc/apt/apt.conf.d/99-kitsnet-pmg-nosub&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Log&lt;br /&gt;
: &amp;lt;code&amp;gt;/var/log/kitsnet-pmg-nosub-patch.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified by the Patcher ==&lt;br /&gt;
&lt;br /&gt;
=== Proxmox Widget Toolkit ===&lt;br /&gt;
&lt;br /&gt;
File:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modification:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Proxmox.Utils.checked_command()&amp;lt;/code&amp;gt; is changed so that the requested command executes immediately instead of displaying the generic &#039;&#039;&#039;&amp;quot;No valid subscription&amp;quot;&#039;&#039;&#039; warning.&lt;br /&gt;
&lt;br /&gt;
=== PMG GUI ===&lt;br /&gt;
&lt;br /&gt;
File:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/pmg-gui/js/pmgmanagerlib.js&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifications:&lt;br /&gt;
&lt;br /&gt;
* The PMG dashboard subscription-warning panel is hidden.&lt;br /&gt;
* The explicit subscription check performed while changing into a logged-in/user view is suppressed.&lt;br /&gt;
&lt;br /&gt;
The actual PMG &#039;&#039;&#039;Subscription&#039;&#039;&#039; configuration page remains available and continues to report the real subscription state.&lt;br /&gt;
&lt;br /&gt;
== Normal Use ==&lt;br /&gt;
&lt;br /&gt;
The patch is normally reapplied automatically after Debian/Proxmox package operations by the APT post-invoke hook.&lt;br /&gt;
&lt;br /&gt;
No routine manual action should be required.&lt;br /&gt;
&lt;br /&gt;
== Manual Check ==&lt;br /&gt;
&lt;br /&gt;
To verify that all expected KitsNet modifications are currently present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo /usr/local/sbin/kitsnet-pmg-nosub-patch --check&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expected successful output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OK: all KitsNet PMG subscription-suppression patches are present.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A nonzero return code means one or more expected modifications are absent.&lt;br /&gt;
&lt;br /&gt;
== Manual Apply / Reapply ==&lt;br /&gt;
&lt;br /&gt;
To apply or reapply the customization manually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo /usr/local/sbin/kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The patcher is &#039;&#039;&#039;idempotent&#039;&#039;&#039;. Running it when all patches are already present does not make additional changes.&lt;br /&gt;
&lt;br /&gt;
== After Applying the Patch ==&lt;br /&gt;
&lt;br /&gt;
Browser JavaScript may remain cached.&lt;br /&gt;
&lt;br /&gt;
After applying or reapplying the patch, hard-refresh PMG browser sessions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ctrl+Shift+R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do this for both:&lt;br /&gt;
&lt;br /&gt;
* administrator sessions&lt;br /&gt;
* quarantine / ordinary-user sessions&lt;br /&gt;
&lt;br /&gt;
== Automatic Reapplication After Updates ==&lt;br /&gt;
&lt;br /&gt;
APT runs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/sbin/kitsnet-pmg-nosub-apt-hook&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after package operations.&lt;br /&gt;
&lt;br /&gt;
That wrapper runs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/sbin/kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and records the result in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/var/log/kitsnet-pmg-nosub-patch.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The wrapper always exits successfully so that a cosmetic local PMG GUI customization can never cause an APT or Proxmox package upgrade to fail.&lt;br /&gt;
&lt;br /&gt;
== Safe Failure Behavior ==&lt;br /&gt;
&lt;br /&gt;
The patcher only modifies files when the expected source-code structures are found exactly.&lt;br /&gt;
&lt;br /&gt;
If a future Proxmox release changes the relevant JavaScript enough that the known patterns no longer match, the patcher:&lt;br /&gt;
&lt;br /&gt;
* makes no speculative modification&lt;br /&gt;
* reports the mismatch&lt;br /&gt;
* returns an error&lt;br /&gt;
* records the problem in the log when run automatically&lt;br /&gt;
* allows the package upgrade itself to complete normally&lt;br /&gt;
&lt;br /&gt;
This is intentional.&lt;br /&gt;
&lt;br /&gt;
After a major PMG or &amp;lt;code&amp;gt;proxmox-widget-toolkit&amp;lt;/code&amp;gt; update, inspect the new source before changing the patcher to match the new implementation.&lt;br /&gt;
&lt;br /&gt;
== Checking the Log ==&lt;br /&gt;
&lt;br /&gt;
Recent results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo tail -100 /var/log/kitsnet-pmg-nosub-patch.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search the system journal for automatic-patch warnings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo journalctl -t kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backups ==&lt;br /&gt;
&lt;br /&gt;
Whenever the patcher modifies one of the PMG JavaScript files, it creates a timestamped backup alongside that file.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.kitsnet-prepatch-YYYYMMDD-HHMMSS&lt;br /&gt;
&lt;br /&gt;
/usr/share/javascript/pmg-gui/js/pmgmanagerlib.js.kitsnet-prepatch-YYYYMMDD-HHMMSS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier manual backups may also exist with names such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*.kitsnet-nosub-backup-YYYYMMDD-HHMMSS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These backups are intended for troubleshooting and rollback.&lt;br /&gt;
&lt;br /&gt;
== Removing / Disabling Automatic Reapplication ==&lt;br /&gt;
&lt;br /&gt;
To stop automatically reapplying the customization after package updates, remove or rename the APT hook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo rm /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does &#039;&#039;&#039;not&#039;&#039;&#039; restore the original JavaScript files. It only disables the automatic post-package invocation.&lt;br /&gt;
&lt;br /&gt;
== Restoring Stock Proxmox Files ==&lt;br /&gt;
&lt;br /&gt;
The cleanest way to restore current package-provided versions is normally to reinstall the packages that own the modified files.&lt;br /&gt;
&lt;br /&gt;
First identify the installed package versions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dpkg-query -W proxmox-widget-toolkit pmg-gui&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable the KitsNet APT hook before reinstalling packages, otherwise the patch will be reapplied immediately:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mv /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub \&lt;br /&gt;
    /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub.disabled&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reinstall the affected packages using the normal Proxmox/Debian package-management procedure.&lt;br /&gt;
&lt;br /&gt;
Afterward, hard-refresh the browser.&lt;br /&gt;
&lt;br /&gt;
== What This Patch Does NOT Do ==&lt;br /&gt;
&lt;br /&gt;
This customization does &#039;&#039;&#039;not&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* install or emulate a Proxmox subscription&lt;br /&gt;
* alter the PMG API subscription result&lt;br /&gt;
* enable the enterprise repository&lt;br /&gt;
* disable repository warnings unless separately customized&lt;br /&gt;
* change SpamAssassin, ClamAV, SMTP, quarantine, filtering, or delivery&lt;br /&gt;
* alter licensing or support entitlement&lt;br /&gt;
* modify the PMG mobile quarantine bundle unless explicitly extended&lt;br /&gt;
&lt;br /&gt;
== Known Separate Warning ==&lt;br /&gt;
&lt;br /&gt;
The yellow dashboard message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Non production-ready repository enabled!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is a separate repository-status warning. It is not part of the no-subscription suppression described here.&lt;br /&gt;
&lt;br /&gt;
== Source Markers ==&lt;br /&gt;
&lt;br /&gt;
The installed JavaScript modifications are intentionally marked with &#039;&#039;&#039;KITSNET&#039;&#039;&#039; comments so they are easy to locate.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
KITSNET: suppress no-subscription warning&lt;br /&gt;
&lt;br /&gt;
KITSNET: hide no-subscription dashboard panel&lt;br /&gt;
&lt;br /&gt;
KITSNET: suppress subscription check when changing views&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Quick Reference ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Task&lt;br /&gt;
! Command&lt;br /&gt;
|-&lt;br /&gt;
| Check patch status&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo /usr/local/sbin/kitsnet-pmg-nosub-patch --check&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Apply / reapply&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo /usr/local/sbin/kitsnet-pmg-nosub-patch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| View log&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo tail -100 /var/log/kitsnet-pmg-nosub-patch.log&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hard-refresh browser&lt;br /&gt;
| &amp;lt;code&amp;gt;Ctrl+Shift+R&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Maintenance Note ==&lt;br /&gt;
&lt;br /&gt;
This is a local KitsNet customization to package-managed JavaScript files.&lt;br /&gt;
&lt;br /&gt;
Proxmox updates are expected to replace those files. The patcher and APT hook exist specifically so the customization can be safely and repeatably reapplied after updates.&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Mail_Gateway:No-Subscription_Warning_Suppression&amp;diff=2694</id>
		<title>KitsNet Operations:Services:Mail Gateway:No-Subscription Warning Suppression</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Mail_Gateway:No-Subscription_Warning_Suppression&amp;diff=2694"/>
		<updated>2026-09-22T12:54:15Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
This local customization suppresses Proxmox Mail Gateway (PMG) &#039;&#039;&#039;&amp;quot;No valid subscription&amp;quot;&#039;&#039;&#039; warnings in the web interface without pretending that the system has a valid subscription and without changing PMG mail filtering, repository configuration, licensing state, or subscription data.&lt;br /&gt;
&lt;br /&gt;
The customization is intended for the KitsNet PMG host &#039;&#039;&#039;dusse&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Initially tested with:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| proxmox-mailgateway&lt;br /&gt;
| 9.1&lt;br /&gt;
|-&lt;br /&gt;
| pmg-api&lt;br /&gt;
| 9.1.2&lt;br /&gt;
|-&lt;br /&gt;
| pmg-gui&lt;br /&gt;
| 5.2.2&lt;br /&gt;
|-&lt;br /&gt;
| proxmox-widget-toolkit&lt;br /&gt;
| 5.2.8&lt;br /&gt;
|-&lt;br /&gt;
| pmg-mobile-quarantine-ui&lt;br /&gt;
| 0.5.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Files Installed ==&lt;br /&gt;
&lt;br /&gt;
; Main patcher&lt;br /&gt;
: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-pmg-nosub-patch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; APT/DPKG wrapper&lt;br /&gt;
: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-pmg-nosub-apt-hook&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; APT hook&lt;br /&gt;
: &amp;lt;code&amp;gt;/etc/apt/apt.conf.d/99-kitsnet-pmg-nosub&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Log&lt;br /&gt;
: &amp;lt;code&amp;gt;/var/log/kitsnet-pmg-nosub-patch.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified by the Patcher ==&lt;br /&gt;
&lt;br /&gt;
=== Proxmox Widget Toolkit ===&lt;br /&gt;
&lt;br /&gt;
File:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modification:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Proxmox.Utils.checked_command()&amp;lt;/code&amp;gt; is changed so that the requested command executes immediately instead of displaying the generic &#039;&#039;&#039;&amp;quot;No valid subscription&amp;quot;&#039;&#039;&#039; warning.&lt;br /&gt;
&lt;br /&gt;
=== PMG GUI ===&lt;br /&gt;
&lt;br /&gt;
File:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/pmg-gui/js/pmgmanagerlib.js&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifications:&lt;br /&gt;
&lt;br /&gt;
* The PMG dashboard subscription-warning panel is hidden.&lt;br /&gt;
* The explicit subscription check performed while changing into a logged-in/user view is suppressed.&lt;br /&gt;
&lt;br /&gt;
The actual PMG &#039;&#039;&#039;Subscription&#039;&#039;&#039; configuration page remains available and continues to report the real subscription state.&lt;br /&gt;
&lt;br /&gt;
== Normal Use ==&lt;br /&gt;
&lt;br /&gt;
The patch is normally reapplied automatically after Debian/Proxmox package operations by the APT post-invoke hook.&lt;br /&gt;
&lt;br /&gt;
No routine manual action should be required.&lt;br /&gt;
&lt;br /&gt;
== Manual Check ==&lt;br /&gt;
&lt;br /&gt;
To verify that all expected KitsNet modifications are currently present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo /usr/local/sbin/kitsnet-pmg-nosub-patch --check&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expected successful output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OK: all KitsNet PMG subscription-suppression patches are present.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A nonzero return code means one or more expected modifications are absent.&lt;br /&gt;
&lt;br /&gt;
== Manual Apply / Reapply ==&lt;br /&gt;
&lt;br /&gt;
To apply or reapply the customization manually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo /usr/local/sbin/kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The patcher is &#039;&#039;&#039;idempotent&#039;&#039;&#039;. Running it when all patches are already present does not make additional changes.&lt;br /&gt;
&lt;br /&gt;
== After Applying the Patch ==&lt;br /&gt;
&lt;br /&gt;
Browser JavaScript may remain cached.&lt;br /&gt;
&lt;br /&gt;
After applying or reapplying the patch, hard-refresh PMG browser sessions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ctrl+Shift+R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do this for both:&lt;br /&gt;
&lt;br /&gt;
* administrator sessions&lt;br /&gt;
* quarantine / ordinary-user sessions&lt;br /&gt;
&lt;br /&gt;
== Automatic Reapplication After Updates ==&lt;br /&gt;
&lt;br /&gt;
APT runs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/sbin/kitsnet-pmg-nosub-apt-hook&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after package operations.&lt;br /&gt;
&lt;br /&gt;
That wrapper runs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/sbin/kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and records the result in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/var/log/kitsnet-pmg-nosub-patch.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The wrapper always exits successfully so that a cosmetic local PMG GUI customization can never cause an APT or Proxmox package upgrade to fail.&lt;br /&gt;
&lt;br /&gt;
== Safe Failure Behavior ==&lt;br /&gt;
&lt;br /&gt;
The patcher only modifies files when the expected source-code structures are found exactly.&lt;br /&gt;
&lt;br /&gt;
If a future Proxmox release changes the relevant JavaScript enough that the known patterns no longer match, the patcher:&lt;br /&gt;
&lt;br /&gt;
* makes no speculative modification&lt;br /&gt;
* reports the mismatch&lt;br /&gt;
* returns an error&lt;br /&gt;
* records the problem in the log when run automatically&lt;br /&gt;
* allows the package upgrade itself to complete normally&lt;br /&gt;
&lt;br /&gt;
This is intentional.&lt;br /&gt;
&lt;br /&gt;
After a major PMG or &amp;lt;code&amp;gt;proxmox-widget-toolkit&amp;lt;/code&amp;gt; update, inspect the new source before changing the patcher to match the new implementation.&lt;br /&gt;
&lt;br /&gt;
== Checking the Log ==&lt;br /&gt;
&lt;br /&gt;
Recent results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo tail -100 /var/log/kitsnet-pmg-nosub-patch.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search the system journal for automatic-patch warnings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo journalctl -t kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backups ==&lt;br /&gt;
&lt;br /&gt;
Whenever the patcher modifies one of the PMG JavaScript files, it creates a timestamped backup alongside that file.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.kitsnet-prepatch-YYYYMMDD-HHMMSS&lt;br /&gt;
&lt;br /&gt;
/usr/share/javascript/pmg-gui/js/pmgmanagerlib.js.kitsnet-prepatch-YYYYMMDD-HHMMSS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier manual backups may also exist with names such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*.kitsnet-nosub-backup-YYYYMMDD-HHMMSS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These backups are intended for troubleshooting and rollback.&lt;br /&gt;
&lt;br /&gt;
== Removing / Disabling Automatic Reapplication ==&lt;br /&gt;
&lt;br /&gt;
To stop automatically reapplying the customization after package updates, remove or rename the APT hook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo rm /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does &#039;&#039;&#039;not&#039;&#039;&#039; restore the original JavaScript files. It only disables the automatic post-package invocation.&lt;br /&gt;
&lt;br /&gt;
== Restoring Stock Proxmox Files ==&lt;br /&gt;
&lt;br /&gt;
The cleanest way to restore current package-provided versions is normally to reinstall the packages that own the modified files.&lt;br /&gt;
&lt;br /&gt;
First identify the installed package versions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dpkg-query -W proxmox-widget-toolkit pmg-gui&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable the KitsNet APT hook before reinstalling packages, otherwise the patch will be reapplied immediately:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mv /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub \&lt;br /&gt;
    /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub.disabled&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reinstall the affected packages using the normal Proxmox/Debian package-management procedure.&lt;br /&gt;
&lt;br /&gt;
Afterward, hard-refresh the browser.&lt;br /&gt;
&lt;br /&gt;
== What This Patch Does NOT Do ==&lt;br /&gt;
&lt;br /&gt;
This customization does &#039;&#039;&#039;not&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* install or emulate a Proxmox subscription&lt;br /&gt;
* alter the PMG API subscription result&lt;br /&gt;
* enable the enterprise repository&lt;br /&gt;
* disable repository warnings unless separately customized&lt;br /&gt;
* change SpamAssassin, ClamAV, SMTP, quarantine, filtering, or delivery&lt;br /&gt;
* alter licensing or support entitlement&lt;br /&gt;
* modify the PMG mobile quarantine bundle unless explicitly extended&lt;br /&gt;
&lt;br /&gt;
== Known Separate Warning ==&lt;br /&gt;
&lt;br /&gt;
The yellow dashboard message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Non production-ready repository enabled!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is a separate repository-status warning. It is not part of the no-subscription suppression described here.&lt;br /&gt;
&lt;br /&gt;
== Source Markers ==&lt;br /&gt;
&lt;br /&gt;
The installed JavaScript modifications are intentionally marked with &#039;&#039;&#039;KITSNET&#039;&#039;&#039; comments so they are easy to locate.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
KITSNET: suppress no-subscription warning&lt;br /&gt;
&lt;br /&gt;
KITSNET: hide no-subscription dashboard panel&lt;br /&gt;
&lt;br /&gt;
KITSNET: suppress subscription check when changing views&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Quick Reference ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Task&lt;br /&gt;
! Command&lt;br /&gt;
|-&lt;br /&gt;
| Check patch status&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo /usr/local/sbin/kitsnet-pmg-nosub-patch --check&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Apply / reapply&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo /usr/local/sbin/kitsnet-pmg-nosub-patch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| View log&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo tail -100 /var/log/kitsnet-pmg-nosub-patch.log&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hard-refresh browser&lt;br /&gt;
| &amp;lt;code&amp;gt;Ctrl+Shift+R&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Maintenance Note ==&lt;br /&gt;
&lt;br /&gt;
This is a local KitsNet customization to package-managed JavaScript files.&lt;br /&gt;
&lt;br /&gt;
Proxmox updates are expected to replace those files. The patcher and APT hook exist specifically so the customization can be safely and repeatably reapplied after updates.&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Mail_Gateway:No-Subscription_Warning_Suppression&amp;diff=2693</id>
		<title>KitsNet Operations:Services:Mail Gateway:No-Subscription Warning Suppression</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Services:Mail_Gateway:No-Subscription_Warning_Suppression&amp;diff=2693"/>
		<updated>2026-09-22T12:54:03Z</updated>

		<summary type="html">&lt;p&gt;Psmode: Created page with &amp;quot;__NOTOC__ = KitsNet PMG No-Subscription Warning Suppression =  == Purpose ==  This local customization suppresses Proxmox Mail Gateway (PMG) &amp;#039;&amp;#039;&amp;#039;&amp;quot;No valid subscription&amp;quot;&amp;#039;&amp;#039;&amp;#039; warnings in the web interface without pretending that the system has a valid subscription and without changing PMG mail filtering, repository configuration, licensing state, or subscription data.  The customization is intended for the KitsNet PMG host &amp;#039;&amp;#039;&amp;#039;dusse&amp;#039;&amp;#039;&amp;#039;.  Initially tested with:  {| class=&amp;quot;wiki...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
= KitsNet PMG No-Subscription Warning Suppression =&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
&lt;br /&gt;
This local customization suppresses Proxmox Mail Gateway (PMG) &#039;&#039;&#039;&amp;quot;No valid subscription&amp;quot;&#039;&#039;&#039; warnings in the web interface without pretending that the system has a valid subscription and without changing PMG mail filtering, repository configuration, licensing state, or subscription data.&lt;br /&gt;
&lt;br /&gt;
The customization is intended for the KitsNet PMG host &#039;&#039;&#039;dusse&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Initially tested with:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| proxmox-mailgateway&lt;br /&gt;
| 9.1&lt;br /&gt;
|-&lt;br /&gt;
| pmg-api&lt;br /&gt;
| 9.1.2&lt;br /&gt;
|-&lt;br /&gt;
| pmg-gui&lt;br /&gt;
| 5.2.2&lt;br /&gt;
|-&lt;br /&gt;
| proxmox-widget-toolkit&lt;br /&gt;
| 5.2.8&lt;br /&gt;
|-&lt;br /&gt;
| pmg-mobile-quarantine-ui&lt;br /&gt;
| 0.5.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Files Installed ==&lt;br /&gt;
&lt;br /&gt;
; Main patcher&lt;br /&gt;
: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-pmg-nosub-patch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; APT/DPKG wrapper&lt;br /&gt;
: &amp;lt;code&amp;gt;/usr/local/sbin/kitsnet-pmg-nosub-apt-hook&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; APT hook&lt;br /&gt;
: &amp;lt;code&amp;gt;/etc/apt/apt.conf.d/99-kitsnet-pmg-nosub&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Log&lt;br /&gt;
: &amp;lt;code&amp;gt;/var/log/kitsnet-pmg-nosub-patch.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified by the Patcher ==&lt;br /&gt;
&lt;br /&gt;
=== Proxmox Widget Toolkit ===&lt;br /&gt;
&lt;br /&gt;
File:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modification:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Proxmox.Utils.checked_command()&amp;lt;/code&amp;gt; is changed so that the requested command executes immediately instead of displaying the generic &#039;&#039;&#039;&amp;quot;No valid subscription&amp;quot;&#039;&#039;&#039; warning.&lt;br /&gt;
&lt;br /&gt;
=== PMG GUI ===&lt;br /&gt;
&lt;br /&gt;
File:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/pmg-gui/js/pmgmanagerlib.js&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modifications:&lt;br /&gt;
&lt;br /&gt;
* The PMG dashboard subscription-warning panel is hidden.&lt;br /&gt;
* The explicit subscription check performed while changing into a logged-in/user view is suppressed.&lt;br /&gt;
&lt;br /&gt;
The actual PMG &#039;&#039;&#039;Subscription&#039;&#039;&#039; configuration page remains available and continues to report the real subscription state.&lt;br /&gt;
&lt;br /&gt;
== Normal Use ==&lt;br /&gt;
&lt;br /&gt;
The patch is normally reapplied automatically after Debian/Proxmox package operations by the APT post-invoke hook.&lt;br /&gt;
&lt;br /&gt;
No routine manual action should be required.&lt;br /&gt;
&lt;br /&gt;
== Manual Check ==&lt;br /&gt;
&lt;br /&gt;
To verify that all expected KitsNet modifications are currently present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo /usr/local/sbin/kitsnet-pmg-nosub-patch --check&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expected successful output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OK: all KitsNet PMG subscription-suppression patches are present.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A nonzero return code means one or more expected modifications are absent.&lt;br /&gt;
&lt;br /&gt;
== Manual Apply / Reapply ==&lt;br /&gt;
&lt;br /&gt;
To apply or reapply the customization manually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo /usr/local/sbin/kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The patcher is &#039;&#039;&#039;idempotent&#039;&#039;&#039;. Running it when all patches are already present does not make additional changes.&lt;br /&gt;
&lt;br /&gt;
== After Applying the Patch ==&lt;br /&gt;
&lt;br /&gt;
Browser JavaScript may remain cached.&lt;br /&gt;
&lt;br /&gt;
After applying or reapplying the patch, hard-refresh PMG browser sessions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ctrl+Shift+R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do this for both:&lt;br /&gt;
&lt;br /&gt;
* administrator sessions&lt;br /&gt;
* quarantine / ordinary-user sessions&lt;br /&gt;
&lt;br /&gt;
== Automatic Reapplication After Updates ==&lt;br /&gt;
&lt;br /&gt;
APT runs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/sbin/kitsnet-pmg-nosub-apt-hook&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after package operations.&lt;br /&gt;
&lt;br /&gt;
That wrapper runs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/sbin/kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and records the result in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/var/log/kitsnet-pmg-nosub-patch.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The wrapper always exits successfully so that a cosmetic local PMG GUI customization can never cause an APT or Proxmox package upgrade to fail.&lt;br /&gt;
&lt;br /&gt;
== Safe Failure Behavior ==&lt;br /&gt;
&lt;br /&gt;
The patcher only modifies files when the expected source-code structures are found exactly.&lt;br /&gt;
&lt;br /&gt;
If a future Proxmox release changes the relevant JavaScript enough that the known patterns no longer match, the patcher:&lt;br /&gt;
&lt;br /&gt;
* makes no speculative modification&lt;br /&gt;
* reports the mismatch&lt;br /&gt;
* returns an error&lt;br /&gt;
* records the problem in the log when run automatically&lt;br /&gt;
* allows the package upgrade itself to complete normally&lt;br /&gt;
&lt;br /&gt;
This is intentional.&lt;br /&gt;
&lt;br /&gt;
After a major PMG or &amp;lt;code&amp;gt;proxmox-widget-toolkit&amp;lt;/code&amp;gt; update, inspect the new source before changing the patcher to match the new implementation.&lt;br /&gt;
&lt;br /&gt;
== Checking the Log ==&lt;br /&gt;
&lt;br /&gt;
Recent results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo tail -100 /var/log/kitsnet-pmg-nosub-patch.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search the system journal for automatic-patch warnings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo journalctl -t kitsnet-pmg-nosub-patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backups ==&lt;br /&gt;
&lt;br /&gt;
Whenever the patcher modifies one of the PMG JavaScript files, it creates a timestamped backup alongside that file.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.kitsnet-prepatch-YYYYMMDD-HHMMSS&lt;br /&gt;
&lt;br /&gt;
/usr/share/javascript/pmg-gui/js/pmgmanagerlib.js.kitsnet-prepatch-YYYYMMDD-HHMMSS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Earlier manual backups may also exist with names such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*.kitsnet-nosub-backup-YYYYMMDD-HHMMSS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These backups are intended for troubleshooting and rollback.&lt;br /&gt;
&lt;br /&gt;
== Removing / Disabling Automatic Reapplication ==&lt;br /&gt;
&lt;br /&gt;
To stop automatically reapplying the customization after package updates, remove or rename the APT hook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo rm /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does &#039;&#039;&#039;not&#039;&#039;&#039; restore the original JavaScript files. It only disables the automatic post-package invocation.&lt;br /&gt;
&lt;br /&gt;
== Restoring Stock Proxmox Files ==&lt;br /&gt;
&lt;br /&gt;
The cleanest way to restore current package-provided versions is normally to reinstall the packages that own the modified files.&lt;br /&gt;
&lt;br /&gt;
First identify the installed package versions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dpkg-query -W proxmox-widget-toolkit pmg-gui&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable the KitsNet APT hook before reinstalling packages, otherwise the patch will be reapplied immediately:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo mv /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub \&lt;br /&gt;
    /etc/apt/apt.conf.d/99-kitsnet-pmg-nosub.disabled&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then reinstall the affected packages using the normal Proxmox/Debian package-management procedure.&lt;br /&gt;
&lt;br /&gt;
Afterward, hard-refresh the browser.&lt;br /&gt;
&lt;br /&gt;
== What This Patch Does NOT Do ==&lt;br /&gt;
&lt;br /&gt;
This customization does &#039;&#039;&#039;not&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* install or emulate a Proxmox subscription&lt;br /&gt;
* alter the PMG API subscription result&lt;br /&gt;
* enable the enterprise repository&lt;br /&gt;
* disable repository warnings unless separately customized&lt;br /&gt;
* change SpamAssassin, ClamAV, SMTP, quarantine, filtering, or delivery&lt;br /&gt;
* alter licensing or support entitlement&lt;br /&gt;
* modify the PMG mobile quarantine bundle unless explicitly extended&lt;br /&gt;
&lt;br /&gt;
== Known Separate Warning ==&lt;br /&gt;
&lt;br /&gt;
The yellow dashboard message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Non production-ready repository enabled!&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is a separate repository-status warning. It is not part of the no-subscription suppression described here.&lt;br /&gt;
&lt;br /&gt;
== Source Markers ==&lt;br /&gt;
&lt;br /&gt;
The installed JavaScript modifications are intentionally marked with &#039;&#039;&#039;KITSNET&#039;&#039;&#039; comments so they are easy to locate.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
KITSNET: suppress no-subscription warning&lt;br /&gt;
&lt;br /&gt;
KITSNET: hide no-subscription dashboard panel&lt;br /&gt;
&lt;br /&gt;
KITSNET: suppress subscription check when changing views&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Quick Reference ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Task&lt;br /&gt;
! Command&lt;br /&gt;
|-&lt;br /&gt;
| Check patch status&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo /usr/local/sbin/kitsnet-pmg-nosub-patch --check&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Apply / reapply&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo /usr/local/sbin/kitsnet-pmg-nosub-patch&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| View log&lt;br /&gt;
| &amp;lt;code&amp;gt;sudo tail -100 /var/log/kitsnet-pmg-nosub-patch.log&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hard-refresh browser&lt;br /&gt;
| &amp;lt;code&amp;gt;Ctrl+Shift+R&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Maintenance Note ==&lt;br /&gt;
&lt;br /&gt;
This is a local KitsNet customization to package-managed JavaScript files.&lt;br /&gt;
&lt;br /&gt;
Proxmox updates are expected to replace those files. The patcher and APT hook exist specifically so the customization can be safely and repeatably reapplied after updates.&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=Linux:Tips_and_Tricks&amp;diff=2692</id>
		<title>Linux:Tips and Tricks</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=Linux:Tips_and_Tricks&amp;diff=2692"/>
		<updated>2026-09-18T21:40:06Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NONUMBERHEADINGS__&lt;br /&gt;
====Find files modified in past N days====&lt;br /&gt;
&amp;lt;code&amp;gt;find &#039;&#039;path&#039;&#039; -mtime -&#039;&#039;N&#039;&#039; -ls&amp;lt;/code&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
[psmode@wort ~]$ find /kvm/ -mtime -3 -ls&lt;br /&gt;
102090127      4 drwxr-xr-x   7  root     root         4096 Jan  3 09:46 /kvm/&lt;br /&gt;
  2038539      4 drwxr-xr-x   2  root     kitsnet_adm     4096 Jan  3 09:13 /kvm/socat-kvm&lt;br /&gt;
  2038573      4 -rw-r--r--   1  root     root               5 Jan  3 09:13 /kvm/socat-kvm/uv040&lt;br /&gt;
101237691      8 -rw-r--r--   1  root     kitsnet_adm     6370 Jan  3 09:46 /kvm/uv034.xml&lt;br /&gt;
102163845     12 -rw-r--r--   1  root     root            9096 Jan  3 09:46 /kvm/uv039.xml&lt;br /&gt;
102090129     12 -rw-r--r--   1  root     root            8303 Jan  3 09:46 /kvm/uv040.xml&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Search files modified in past N days ====&lt;br /&gt;
&amp;lt;code&amp;gt;find &#039;&#039;path&#039;&#039; -mtime -&#039;&#039;N&#039;&#039; -type f -exec grep &#039;&#039;pattern&#039;&#039;  {} /dev/null \;&amp;lt;/code&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
[psmode@ciroc ~]$ sudo find /etc -mtime -9 -type f -exec grep mailroom1  {} /dev/null \;&lt;br /&gt;
/etc/httpd/conf/httpd.conf:    DocumentRoot &amp;quot;/var/www/virt-html/mailroom1.kitsnet.us&amp;quot;&lt;br /&gt;
/etc/httpd/conf/httpd.conf:    ServerName mailroom1.kitsnet.us&lt;br /&gt;
/etc/httpd/conf/httpd.conf:#RewriteCond %{SERVER_NAME} =mailroom1.kitsnet.us&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Shell script debugging modes====&lt;br /&gt;
A good explanation of the debugging modes is given by [https://www.tecmint.com/enable-shell-debug-mode-linux/ How To Enable Shell Script Debugging Mode in Linux]. Basically, there are three modes&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; (short for verbose) – tells the shell to show all lines in a script while they are read, it activates verbose mode.&lt;br /&gt;
*&amp;lt;code&amp;gt;-n&amp;lt;/code&amp;gt; (short for noexec or no execution) – instructs the shell read all the commands, however doesn’t execute them. This options activates syntax checking mode.&lt;br /&gt;
*&amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; (short for xtrace or execution trace) – tells the shell to display all commands and their arguments on the terminal while they are executed. This option enables shell tracing mode.&lt;br /&gt;
&lt;br /&gt;
Which may be invoked by any of three different ways:&lt;br /&gt;
&lt;br /&gt;
#Modifying the first line of a shell script: &amp;lt;code&amp;gt;#!/bin/sh &#039;&#039;option(s)&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
#Invoking shell with debugging options: &amp;lt;code&amp;gt;$ /bin/bash &#039;&#039;option(s)&#039;&#039; &#039;&#039;script_name&#039;&#039; &#039;&#039;argument1 ... argumentN&#039;&#039;&amp;lt;/code&amp;gt;   &lt;br /&gt;
#Using set shell built-in command in the middle of the script: &amp;lt;code&amp;gt;$ set -&#039;&#039;option&#039;&#039;&amp;lt;/code&amp;gt; to enable or &amp;lt;code&amp;gt;$ set +&#039;&#039;option&#039;&#039;&amp;lt;/code&amp;gt; to disable&lt;br /&gt;
&lt;br /&gt;
====Network Diagnostics====&lt;br /&gt;
See also [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmcli Red Hat 7 Networking Guide 3.3. Configuring IP Networking with nmcli] and [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/index RED HAT ENTERPRISE LINUX 8 Configuring and managing networking] and [https://docs.rockylinux.org/guides/network/basic_network_configuration/ Network Configuration - Rocky Linux 9] and [https://opensource.com/article/22/8/migrate-networkmanager-keyfiles-configuration How I migrated to NetworkManager keyfiles for configuration]&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# ip address&lt;br /&gt;
# ip link&lt;br /&gt;
# ip route&lt;br /&gt;
# ip -6 route&lt;br /&gt;
# firewall-cmd --list-all --zone=... (replace ... with whatever zones you are working with)&lt;br /&gt;
# nmcli connection show &lt;br /&gt;
# nmcli connection show --active&lt;br /&gt;
# nmcli device status&lt;br /&gt;
# nmcli connection show &amp;lt;device&amp;gt;&lt;br /&gt;
# sysctl -a | grep -E &#039;forwarding&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====How to use diff and patch====&lt;br /&gt;
The diff utility can be used to generate a patch file. Basically, the differences are put togetehr with syntax from the patch utility so that the resulting file can be used to turn another copy of the original file into the desired final state file. A good reference article is [https://www.pair.com/support/kb/paircloud-diff-and-patch/ available online] The high level syntax is:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# diff -u file1.html file2.html &amp;gt; patchfile.patch&lt;br /&gt;
# patch file1.html patchfile.patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;To reverse the patch, use:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# patch -p0 -R -i patchfile.patch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Explore filesystem utilization====&lt;br /&gt;
I have installed [https://dev.yorhel.nl/ncdu NCurses Disk Usage] (ncdu ) on all KitsNet Linux systems.&lt;br /&gt;
&lt;br /&gt;
====Time coordination with chrony====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
yum install -y chrony                    # to install  &lt;br /&gt;
systemctl enable chronyd                 # to enable  &lt;br /&gt;
systemctl start chronyd                  # to start  &lt;br /&gt;
chronyc tracking                         # To get information about the main time reference&lt;br /&gt;
chronyc sources -v                       # equivalent information to the ntpq&lt;br /&gt;
ntpdate pool.ntp.org                     # To quickly synchronize a server&lt;br /&gt;
timedatectl                              # display time and synchronization status&lt;br /&gt;
chronyc -m &#039;burst 3/3&#039; &#039;makestep 0.1 3&#039;  # sync time using timesources NOW&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;If for some reason the clock is thrown off (e.g. after VM migration), you can force an immediate resync, but &amp;lt;code&amp;gt;makestep&amp;lt;/code&amp;gt; just allows the clock to be corrected by step instead of slow slew. You should add the &amp;lt;code&amp;gt;burst&amp;lt;/code&amp;gt; command to make a new set of measurements.&lt;br /&gt;
&lt;br /&gt;
====How to mount a multi-partition disk image in Linux====&lt;br /&gt;
&lt;br /&gt;
You can use &#039;&#039;&#039;kpartx&#039;&#039;&#039; or &#039;&#039;&#039;partx&#039;&#039;&#039; to create loop devices for the partitions on the image, and then mount them. So either:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;$ sudo kpartx -v -a file.iso&lt;br /&gt;
 add map loop0p1 (253:17): 0 8382464 linear 7:1 2048&lt;br /&gt;
 $ mount /dev/mapper/loop0p1 ./mnt_point&lt;br /&gt;
 ...  do something with the partition  ...&lt;br /&gt;
 $ umount ./mnt_point&lt;br /&gt;
 $ kpartx -d -v file.iso&lt;br /&gt;
 del devmap : loop0p1&lt;br /&gt;
 loop deleted : /dev/loop0&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo partx -a -v file.iso&lt;br /&gt;
partition: none, disk: file.iso, lower: 0, upper: 0&lt;br /&gt;
Trying to use &#039;/dev/loop0&#039; for the loop device&lt;br /&gt;
/dev/loop0: partition table type &#039;dos&#039; detected&lt;br /&gt;
range recount: max partno=1, lower=0, upper=0&lt;br /&gt;
/dev/loop0: partition #1 added&lt;br /&gt;
$ mount /dev/loop0p1 ./mnt_point&lt;br /&gt;
...  do something with the partition  ...&lt;br /&gt;
$ umount /dev/loop0p1 ./mnt_point&lt;br /&gt;
$ sudo partx -d -v /dev/loop0&lt;br /&gt;
partition: none, disk: /dev/loop0, lower: 0, upper: 0&lt;br /&gt;
/dev/loop0: partition #1 removed&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====DHCP Lease Renewal====&lt;br /&gt;
&lt;br /&gt;
[https://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/ Linux Force DHCP Client (dhclient) to Renew IP Address] covers this in greater detail for a number of platforms and environments. For KitsNet, the two methods that work are based on &amp;lt;code&amp;gt;dhclient&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====dhclient=====&lt;br /&gt;
The &amp;lt;kbd&amp;gt;-r&amp;lt;/kbd&amp;gt; flag explicitly releases the current lease, and once the lease has been released, the client exits. For example, open terminal application and type the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dhclient -r&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now obtain fresh IP address using DHCP on Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dhclient&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====nmcli=====&lt;br /&gt;
The NetworkManager daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices command-line tool for controlling NetworkManager. The &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt; is a command-line tool for controlling NetworkManager and getting its status. To renew IP address using nmcli for connection named ‘nixcraft_5G’ (use ‘&amp;lt;code&amp;gt;nmcli con&amp;lt;/code&amp;gt;‘ command to get list of all connections):&lt;br /&gt;
 nmcli con&lt;br /&gt;
 nmcli con down id &#039;nixcraft_5G&#039;&lt;br /&gt;
 nmcli con up id &#039;nixcraft_5G&#039;&lt;br /&gt;
 # Attempt to update device with changes to the currently active &lt;br /&gt;
 # connection made since it was last applied and then try it again&lt;br /&gt;
 nmcli device reapply &#039;nixcraft_5G&#039;&lt;br /&gt;
&lt;br /&gt;
====GRUB2====&lt;br /&gt;
[[Media:Grub.pdf|the GNU GRUB manual - The GRand Unified Bootloader, version 2.12]], originally downloaded from [https://www.gnu.org/software/grub/manual/grub/grub.pdf here]&lt;br /&gt;
&lt;br /&gt;
=====Booting into Rescue mode or Emergency Mode=====&lt;br /&gt;
[https://www.thegeekdiary.com/how-to-boot-into-rescue-mode-or-emergency-mode-through-systemd-in-centos-rhel-7-and-8/ How to Boot into Rescue Mode or Emergency Mode Through Systemd in CentOS/RHEL 7 and 8]&amp;lt;blockquote&amp;gt;Rescue mode is equivalent to single user mode and requires the root password. Rescue mode allows you to repair your system in situations when it is unable to complete a regular booting process. Rescue mode will try to mount all local file systems and start some important system services, but it does not activate network interfaces neither allow multiple users to be logged in.&lt;br /&gt;
&lt;br /&gt;
Emergency mode provides the most minimal environment possible and allows you to repair your system even in situations when the system is unable to enter rescue mode. In emergency mode, the system mounts the root file system as read-only, does not attempt to mount any other local file systems, does not activate network interfaces.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#During bootup, when the GRUB2 menu shows up, press the &amp;lt;code&amp;gt;&#039;&#039;&#039;e&#039;&#039;&#039;&amp;lt;/code&amp;gt; key for edit.&lt;br /&gt;
#Add a parameter to the end of the linux16 line. For rescue mode add &amp;lt;code&amp;gt;systemd.unit=rescue.target&amp;lt;/code&amp;gt;, for emergency mode add &amp;lt;code&amp;gt;systemd.unit=emergency.target&amp;lt;/code&amp;gt;&lt;br /&gt;
#Press &amp;lt;code&amp;gt;&#039;&#039;&#039;Ctrl+x&#039;&#039;&#039;&amp;lt;/code&amp;gt; to boot the system with the parameter.&lt;br /&gt;
&lt;br /&gt;
===== Change Default Boot Selection (or, how to downgrade the OS) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
sudo grubby --info=ALL | grep ^kernel               #which versions are on the menu&lt;br /&gt;
sudo grubby --grub2 --default-title                 #which is the current default&lt;br /&gt;
sudo grubby --set-default &amp;quot;/boot/vmlinuz-5.14.0-362.13.1.el9_3.x86_64&amp;quot;  #Set the default to this by path&lt;br /&gt;
sudo grubby --set-default 0                         #reset the default to the top (most recent) choice)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== MegaRAID ====&lt;br /&gt;
Copy of [[Media:51530-00 RevP MegaRAID SAS SW UserGd.pdf|MegaRAID SAS Software User Guide]] (August 2014) from Avago Technologies&lt;br /&gt;
&lt;br /&gt;
===== CLI =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Handy CLI Commands&lt;br /&gt;
!Task&lt;br /&gt;
!Command&lt;br /&gt;
|-&lt;br /&gt;
|Show VD reconstruction/migration status&lt;br /&gt;
|&amp;lt;code&amp;gt;storcli64 /c0 /vall show migrate&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Show VD rebuild status&lt;br /&gt;
|&amp;lt;code&amp;gt;storcli64 /c0 /eall /sall show rebuild&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;storcli64 -PDRbld -ShowProg -PhysDrv[&#039;&#039;252:3&#039;&#039;] -a0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Show PD detailed status&lt;br /&gt;
|&amp;lt;code&amp;gt;storcli64 -pdlist -aALL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Silence alarm&lt;br /&gt;
|&amp;lt;code&amp;gt;storcli64 /c0 set alarm=silence&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Show VD detailed status&lt;br /&gt;
|&amp;lt;code&amp;gt;storcli64 -LDInfo -Lall -a0&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
it seems that either &amp;lt;code&amp;gt;&#039;&#039;&#039;-&#039;&#039;&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;&#039;&#039;/&#039;&#039;&#039;&amp;lt;/code&amp;gt; may be used to introduce command switches.&lt;br /&gt;
&lt;br /&gt;
===== Replacing a failed or failing disk =====&lt;br /&gt;
See [https://www.advancedclustering.com/act_kb/replacing-a-disk-with-megacli/ REPLACING AN LSI RAID DISK WITH MEGACLI]&lt;br /&gt;
&lt;br /&gt;
# Check is the status of the VD and of the PDs&lt;br /&gt;
#Set the original disk offline if an error has not already cause the controller to set it offline: &amp;lt;code&amp;gt;storcli64 -pdoffline -physdrv[&#039;&#039;252:3&#039;&#039;] -a0&amp;lt;/code&amp;gt;&lt;br /&gt;
#Mark the failed disk as missing: &amp;lt;code&amp;gt;storcli64 -pdmarkmissing -physdrv[&#039;&#039;252:3&#039;&#039;] -aAll&amp;lt;/code&amp;gt;&lt;br /&gt;
#Mark the failed disk as prepared for removal: &amp;lt;code&amp;gt;storcli64 -pdprprmv -physdrv[&#039;&#039;252:3&#039;&#039;] -a0&amp;lt;/code&amp;gt;&lt;br /&gt;
#Replace the faulty disk (in other systems, pdlocate can be helpful)&lt;br /&gt;
#If you don’t use hot spares you will need to add the disk to the array and start the rebuild manually: &amp;lt;code&amp;gt;storcli64 -PdReplaceMissing -PhysDrv[&#039;&#039;252:3&#039;&#039;] -Array0 -row0 -a0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;storcli64 -PDRbld -Start -PhysDrv[&#039;&#039;252:3&#039;&#039;] -a0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Systemctl====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Commands to show and manipulate services&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
|List all the &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; service which are in &amp;lt;code&amp;gt;state=active&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sub=running&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;systemctl list-units --type=service --state=running&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|List all the &amp;lt;code&amp;gt;systemd&amp;lt;/code&amp;gt; serice which are in &amp;lt;code&amp;gt;state=active&amp;lt;/code&amp;gt; and sub either running or exited&lt;br /&gt;
|&amp;lt;code&amp;gt;systemctl list-units --type=service --state=active&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|To enable and start a service at the same time&lt;br /&gt;
|&amp;lt;code&amp;gt;systemctl enable --now &#039;&#039;service&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Show enabled units&lt;br /&gt;
|&amp;lt;code&amp;gt;systemctl list-unit-files --state=enabled&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Manual SMTP session ====&lt;br /&gt;
Not exactly an Linux tip, but close enough. I got tired of re-inventing this, so I asked ChatGPT. Additional information is available from [https://mailtrap.io/blog/smtp-commands-and-responses/ SMTP Commands and Response Codes Guide]&lt;br /&gt;
&lt;br /&gt;
* Open a terminal and type: &amp;lt;code&amp;gt;telnet &amp;lt;SMTP_server_address&amp;gt; 25&amp;lt;/code&amp;gt;&lt;br /&gt;
* Once connected, you&#039;ll see a response from the server. Typically, it will start with something like&amp;lt;code&amp;gt;220 &amp;lt;SMTP_server_address&amp;gt; ESMTP&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enter the following commands to send an email:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
HELO &amp;lt;smtp_client_domain&amp;gt;&lt;br /&gt;
MAIL FROM:&amp;lt;sender_email_address&amp;gt;&lt;br /&gt;
RCPT TO:&amp;lt;recipient_email_address&amp;gt;&lt;br /&gt;
DATA&lt;br /&gt;
Subject: Your subject here&lt;br /&gt;
Your email body here.&lt;br /&gt;
.&lt;br /&gt;
QUIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* After typing &amp;lt;code&amp;gt;DATA&amp;lt;/code&amp;gt;, you&#039;ll be prompted to enter the body of your email. After composing your message, end it with a period . on a new line.&lt;br /&gt;
* Finally, type &amp;lt;code&amp;gt;QUIT&amp;lt;/code&amp;gt; to close the connection.&lt;br /&gt;
&lt;br /&gt;
==== Monitoring utilities on wort ====&lt;br /&gt;
Aside from systat, iostat, top and glances, wort has some additional utilities installed that can be used to capture information about disk IO performance amongst other things.&lt;br /&gt;
&lt;br /&gt;
* [https://htop.dev/ htop] is an interactive process viewer&lt;br /&gt;
* [https://github.com/dstat-real/dstat/blob/master/README.adoc dstat] has been forked to [https://github.com/scottchiefbaker/dool dool] because RedHat hijacked the name&lt;br /&gt;
** Try &amp;lt;code&amp;gt;dstat -tcdD total,nvme0n1,sda,sdb,sdc,sdd,sde,sdf  --disk-wait --disk-util 30&amp;lt;/code&amp;gt;&lt;br /&gt;
* [https://pcp.io/ pcp] (Performance Co-Pilot) supports [https://access.redhat.com/articles/2450251 storage performance analysis] and other things&lt;br /&gt;
&lt;br /&gt;
==== After installtion of microcode_ctl, initramfs hasn&#039;t been re-generated for all the installed kernel packages ====&lt;br /&gt;
Need to run &amp;lt;code&amp;gt;dracut&amp;lt;/code&amp;gt; against all installed kernels to make sure they all get the updated microocde. &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
find  /lib/modules -name &amp;quot;*.dep&amp;quot; | awk -v FS=/ &#039; {system(&amp;quot;sudo dracut -f --kver &amp;quot; $4)}&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bash functions with parameters instead of alias ====&lt;br /&gt;
See https://askubuntu.com/questions/666130/bash-alias-with-parameters for background. Basically, aliases cannot part out parameters positionally as with a shell script; bash just expands the alias and anything else on the command line is parsed subsequently. So doing clever things like using a parameter twice in the exmpansion is not going to work with just an alias. If a script is not wanted, an alias is the way to go.&lt;br /&gt;
&lt;br /&gt;
Here is one used to do XML dumps of VMs to a file named for the VM:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
dxml() { virsh dumpxml $1 &amp;gt; $1.xml ;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;As with bash scripts, the &amp;lt;code&amp;gt;$@&amp;lt;/code&amp;gt; macro can be used to substiture for &amp;quot;rest of line&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Rescue physical disk ===&lt;br /&gt;
Once physical disks start throwing bad blocks consistently, it may be best to take an image of the disk and use that to restore to a new volume. However, traditional usage od the &amp;lt;code&amp;gt;dd&amp;lt;/code&amp;gt; command will probably not work, since it will give up at the first read error. The best tool for the job is thus &amp;lt;code&amp;gt;[https://www.gnu.org/software/ddrescue/ ddrescue]&amp;lt;/code&amp;gt; . This tool implmenets direct, non-cached reads, multiple passes,  selectable retries a logging mechaism, generation of a graphical map, detailed progress and more. Until i can make it more generic, here is the script used to rescue the SD card on the PictureFrame Raspberry Pi; the SD card was 12 years old by the time it failed.&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# CONFIGURATION&lt;br /&gt;
SOURCE_DEVICE=&amp;quot;/dev/sdf&amp;quot;            # Replace with your source device&lt;br /&gt;
DEST_IMAGE=&amp;quot;/mnt/rpi/pictureframe/rescue-sdf.img&amp;quot;             # Output disk image&lt;br /&gt;
LOGFILE=&amp;quot;/mnt/rpi/pictureframe/rescue-sdf.log&amp;quot;                # Persistent log file&lt;br /&gt;
MAX_RETRIES=5                       # Number of retry passes&lt;br /&gt;
BLOCK_SIZE=&amp;quot;512&amp;quot;                    # Use small blocks to isolate errors&lt;br /&gt;
&lt;br /&gt;
# COLORS (optional for nice output)&lt;br /&gt;
GREEN=&amp;quot;\e[32m&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\e[33m&amp;quot;&lt;br /&gt;
RED=&amp;quot;\e[31m&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\e[0m&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Check if running as root&lt;br /&gt;
if [ &amp;quot;$EUID&amp;quot; -ne 0 ]; then&lt;br /&gt;
  echo -e &amp;quot;${RED}Please run as root.${RESET}&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Confirm device&lt;br /&gt;
echo -e &amp;quot;${YELLOW}About to recover from: ${SOURCE_DEVICE}&amp;quot;&lt;br /&gt;
echo -e &amp;quot;Output image: ${DEST_IMAGE}&amp;quot;&lt;br /&gt;
echo -e &amp;quot;Log file: ${LOGFILE}${RESET}&amp;quot;&lt;br /&gt;
read -rp &amp;quot;Continue? [y/N]: &amp;quot; confirm&lt;br /&gt;
[[ &amp;quot;$confirm&amp;quot; != &amp;quot;y&amp;quot; &amp;amp;&amp;amp; &amp;quot;$confirm&amp;quot; != &amp;quot;Y&amp;quot; ]] &amp;amp;&amp;amp; exit 0&lt;br /&gt;
&lt;br /&gt;
# Initial fast pass: skip errors for speed&lt;br /&gt;
echo -e &amp;quot;${GREEN}Starting initial fast copy pass...${RESET}&amp;quot;&lt;br /&gt;
ddrescue -f -n -b &amp;quot;$BLOCK_SIZE&amp;quot; &amp;quot;$SOURCE_DEVICE&amp;quot; &amp;quot;$DEST_IMAGE&amp;quot; &amp;quot;$LOGFILE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Retry pass: go over bad areas&lt;br /&gt;
echo -e &amp;quot;${YELLOW}Retrying failed sectors up to $MAX_RETRIES times...${RESET}&amp;quot;&lt;br /&gt;
ddrescue -d -r&amp;quot;$MAX_RETRIES&amp;quot; -b &amp;quot;$BLOCK_SIZE&amp;quot; &amp;quot;$SOURCE_DEVICE&amp;quot; &amp;quot;$DEST_IMAGE&amp;quot; &amp;quot;$LOGFILE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Done&lt;br /&gt;
echo -e &amp;quot;${GREEN}Recovery completed. Image saved to ${DEST_IMAGE}${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The utility [https://sourceforge.net/projects/ddrescueview/ ddrescueview] may be used to visualize the map generated in the log file from the run.&lt;br /&gt;
&lt;br /&gt;
[[File:Rescue-sdf-vierw.png|thumb|left|Visualization of rescued volume with some unrecoverable blocks]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network:LAN:absolut:CAPsMAN_Troubleshooting_Guide&amp;diff=2690</id>
		<title>KitsNet Network:LAN:absolut:CAPsMAN Troubleshooting Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network:LAN:absolut:CAPsMAN_Troubleshooting_Guide&amp;diff=2690"/>
		<updated>2026-09-18T21:38:28Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
This guide documents troubleshooting procedures for the KitsNet wireless&lt;br /&gt;
infrastructure using MikroTik CAPsMAN.&lt;br /&gt;
&lt;br /&gt;
Controller: &#039;&#039;&#039;absolut (CHR)&#039;&#039;&#039;  &lt;br /&gt;
Edge router: &#039;&#039;&#039;courvoisier&#039;&#039;&#039;  &lt;br /&gt;
CAP devices: &#039;&#039;&#039;able&#039;&#039;&#039;, &#039;&#039;&#039;baker&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Quick Diagnostic Checklist ==&lt;br /&gt;
&lt;br /&gt;
When wireless problems occur, check the following first:&lt;br /&gt;
&lt;br /&gt;
# Are the CAP devices connected to CAPsMAN?&lt;br /&gt;
# Are radios provisioned correctly?&lt;br /&gt;
# Are datapaths correct?&lt;br /&gt;
# Are clients completing WPA authentication?&lt;br /&gt;
# Are DHCP leases being issued?&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Verify CAP Registration ==&lt;br /&gt;
&lt;br /&gt;
On the CAPsMAN controller (absolut):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man remote-cap print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expected output:&lt;br /&gt;
&lt;br /&gt;
* able – Run&lt;br /&gt;
* baker – Run&lt;br /&gt;
&lt;br /&gt;
If a CAP is missing:&lt;br /&gt;
&lt;br /&gt;
Possible causes:&lt;br /&gt;
&lt;br /&gt;
* wrong controller IP&lt;br /&gt;
* CAP locked to another controller&lt;br /&gt;
* CAP discovery blocked&lt;br /&gt;
* certificate mismatch&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Verify Radios and Provisioning ==&lt;br /&gt;
&lt;br /&gt;
Check radio provisioning:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man interface print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expected radios:&lt;br /&gt;
&lt;br /&gt;
* able 2.4 GHz&lt;br /&gt;
* able 5 GHz&lt;br /&gt;
* baker 2.4 GHz&lt;br /&gt;
* baker 5 GHz&lt;br /&gt;
&lt;br /&gt;
If radios are missing:&lt;br /&gt;
&lt;br /&gt;
Check provisioning rules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man provisioning print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Common causes:&lt;br /&gt;
&lt;br /&gt;
* incorrect radio MAC match&lt;br /&gt;
* wrong provisioning rule order&lt;br /&gt;
* configuration name mismatch&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Check Client Associations ==&lt;br /&gt;
&lt;br /&gt;
On the controller:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man registration-table print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This shows connected wireless clients.&lt;br /&gt;
&lt;br /&gt;
Important fields:&lt;br /&gt;
&lt;br /&gt;
* signal strength&lt;br /&gt;
* TX/RX rate&lt;br /&gt;
* interface name&lt;br /&gt;
&lt;br /&gt;
If clients are not appearing:&lt;br /&gt;
&lt;br /&gt;
Possible causes:&lt;br /&gt;
&lt;br /&gt;
* WPA authentication failure&lt;br /&gt;
* incorrect security profile&lt;br /&gt;
* wrong SSID configuration&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Diagnosing 4-Way Handshake Failures ==&lt;br /&gt;
&lt;br /&gt;
Symptoms:&lt;br /&gt;
&lt;br /&gt;
* clients see the SSID but cannot connect&lt;br /&gt;
* repeated authentication attempts&lt;br /&gt;
* log entries referencing handshake failures&lt;br /&gt;
&lt;br /&gt;
Check controller log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/log print where message~&amp;quot;handshake&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Possible causes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Cause !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Security profile mismatch&lt;br /&gt;
| SSID uses wrong WPA2/WPA3 configuration&lt;br /&gt;
|-&lt;br /&gt;
| Datapath misconfiguration&lt;br /&gt;
| bridge or VLAN incorrect&lt;br /&gt;
|-&lt;br /&gt;
| CAP not synchronized&lt;br /&gt;
| radio using stale configuration&lt;br /&gt;
|-&lt;br /&gt;
| client compatibility issue&lt;br /&gt;
| older devices cannot use WPA3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Recommended test:&lt;br /&gt;
&lt;br /&gt;
Temporarily force WPA2 only.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== CAP Cannot Discover Controller ==&lt;br /&gt;
&lt;br /&gt;
Check CAP configuration:&lt;br /&gt;
&lt;br /&gt;
On the CAP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important values:&lt;br /&gt;
&lt;br /&gt;
* enabled: yes&lt;br /&gt;
* discovery interface correct&lt;br /&gt;
* caps-man-addresses correct&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
caps-man-addresses: 192.168.15.x&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test connectivity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ping 192.168.15.x&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== CAP Locked to Wrong Controller ==&lt;br /&gt;
&lt;br /&gt;
CAPs can be locked to a specific controller.&lt;br /&gt;
&lt;br /&gt;
Check:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If necessary unlock:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap set lock-to-caps-man=no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Certificate Problems ==&lt;br /&gt;
&lt;br /&gt;
If certificates are used for CAP authentication:&lt;br /&gt;
&lt;br /&gt;
Check controller certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man manager print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check CAP certificate usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Common issues:&lt;br /&gt;
&lt;br /&gt;
* certificate not copied during migration&lt;br /&gt;
* CA mismatch&lt;br /&gt;
* expired certificate&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Datapath Problems ==&lt;br /&gt;
&lt;br /&gt;
Datapaths determine how traffic flows.&lt;br /&gt;
&lt;br /&gt;
Check datapaths:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man datapath print detail&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important field:&lt;br /&gt;
&lt;br /&gt;
* local-forwarding&lt;br /&gt;
&lt;br /&gt;
Interpretation:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| yes&lt;br /&gt;
| traffic stays on CAP&lt;br /&gt;
|-&lt;br /&gt;
| no&lt;br /&gt;
| traffic tunnels to controller&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For KitsNet architecture:&lt;br /&gt;
&lt;br /&gt;
* client traffic should be &#039;&#039;&#039;local-forwarded&#039;&#039;&#039;&lt;br /&gt;
* controller should not carry client traffic&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== DHCP Problems ==&lt;br /&gt;
&lt;br /&gt;
If clients connect but cannot obtain an IP address:&lt;br /&gt;
&lt;br /&gt;
Check DHCP leases.&lt;br /&gt;
&lt;br /&gt;
On Courvoisier (Guest network):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/ip dhcp-server lease print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Radix (main network):&lt;br /&gt;
&lt;br /&gt;
Check LAN DHCP server.&lt;br /&gt;
&lt;br /&gt;
If no leases appear:&lt;br /&gt;
&lt;br /&gt;
Possible causes:&lt;br /&gt;
&lt;br /&gt;
* datapath bridging incorrect&lt;br /&gt;
* VLAN mismatch&lt;br /&gt;
* firewall blocking broadcast&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Signal and RF Issues ==&lt;br /&gt;
&lt;br /&gt;
Check client signal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man registration-table print stats&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Key metrics:&lt;br /&gt;
&lt;br /&gt;
* signal&lt;br /&gt;
* tx-rate&lt;br /&gt;
* rx-rate&lt;br /&gt;
&lt;br /&gt;
Poor signal can cause authentication failures.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== CAP Offline ==&lt;br /&gt;
&lt;br /&gt;
If a CAP disappears entirely:&lt;br /&gt;
&lt;br /&gt;
Check device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/system resource print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify:&lt;br /&gt;
&lt;br /&gt;
* device powered&lt;br /&gt;
* Ethernet link up&lt;br /&gt;
* bridge port active&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Fast Recovery Commands ==&lt;br /&gt;
&lt;br /&gt;
Force CAP reconnection:&lt;br /&gt;
&lt;br /&gt;
On CAP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap disable&lt;br /&gt;
/interface wireless cap enable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart CAPsMAN:&lt;br /&gt;
&lt;br /&gt;
On controller:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man manager set enabled=no&lt;br /&gt;
/caps-man manager set enabled=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Emergency Fallback ==&lt;br /&gt;
&lt;br /&gt;
If CAPsMAN fails completely, a CAP can run standalone.&lt;br /&gt;
&lt;br /&gt;
On CAP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap disable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then configure local wireless interfaces.&lt;br /&gt;
&lt;br /&gt;
This restores temporary connectivity until CAPsMAN is repaired.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Monitoring Commands ==&lt;br /&gt;
&lt;br /&gt;
Useful commands during operations:&lt;br /&gt;
&lt;br /&gt;
Controller:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man remote-cap print&lt;br /&gt;
/caps-man interface print&lt;br /&gt;
/caps-man registration-table print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CAP device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap print&lt;br /&gt;
/interface wireless print&lt;br /&gt;
/log print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Preventative Practices ==&lt;br /&gt;
&lt;br /&gt;
To reduce wireless failures:&lt;br /&gt;
&lt;br /&gt;
* keep RouterOS versions synchronized&lt;br /&gt;
* maintain symmetric CAP provisioning&lt;br /&gt;
* avoid overlapping channels&lt;br /&gt;
* document datapath design&lt;br /&gt;
* test migrations on one CAP first&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Related Documentation ==&lt;br /&gt;
&lt;br /&gt;
* Wireless Architecture&lt;br /&gt;
* CAPsMAN Migration Procedure&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network:LAN:absolut:CAPsMAN_Operational_Commands_Cheat_Sheet&amp;diff=2689</id>
		<title>KitsNet Network:LAN:absolut:CAPsMAN Operational Commands Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network:LAN:absolut:CAPsMAN_Operational_Commands_Cheat_Sheet&amp;diff=2689"/>
		<updated>2026-09-18T21:37:55Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
This page contains the most commonly used RouterOS commands for operating&lt;br /&gt;
the KitsNet CAPsMAN wireless infrastructure.&lt;br /&gt;
&lt;br /&gt;
Controller: &#039;&#039;&#039;absolut&#039;&#039;&#039;  &lt;br /&gt;
CAP devices: &#039;&#039;&#039;able&#039;&#039;&#039;, &#039;&#039;&#039;baker&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The commands below are intended for quick diagnostics and operational use.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Controller Health ==&lt;br /&gt;
&lt;br /&gt;
Verify CAPsMAN service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man manager print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expected:&lt;br /&gt;
&lt;br /&gt;
* enabled: yes&lt;br /&gt;
&lt;br /&gt;
Restart CAPsMAN service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man manager set enabled=no&lt;br /&gt;
/caps-man manager set enabled=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== CAP Connectivity ==&lt;br /&gt;
&lt;br /&gt;
List CAP devices connected to the controller:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man remote-cap print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detailed view:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man remote-cap print detail&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expected:&lt;br /&gt;
&lt;br /&gt;
* able – Run&lt;br /&gt;
* baker – Run&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Radio Interfaces ==&lt;br /&gt;
&lt;br /&gt;
View radios managed by CAPsMAN:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man interface print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Useful fields:&lt;br /&gt;
&lt;br /&gt;
* radio-mac&lt;br /&gt;
* channel&lt;br /&gt;
* configuration&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Client Associations ==&lt;br /&gt;
&lt;br /&gt;
Show connected wireless clients:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man registration-table print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extended statistics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man registration-table print stats&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important metrics:&lt;br /&gt;
&lt;br /&gt;
* signal&lt;br /&gt;
* tx-rate&lt;br /&gt;
* rx-rate&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Provisioning Rules ==&lt;br /&gt;
&lt;br /&gt;
Check provisioning configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man provisioning print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Provisioning determines:&lt;br /&gt;
&lt;br /&gt;
* which SSIDs appear on each radio&lt;br /&gt;
* how CAP radios are configured&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Wireless Configurations ==&lt;br /&gt;
&lt;br /&gt;
List configuration profiles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man configuration print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each configuration includes:&lt;br /&gt;
&lt;br /&gt;
* SSID&lt;br /&gt;
* channel&lt;br /&gt;
* security profile&lt;br /&gt;
* datapath&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Datapath Verification ==&lt;br /&gt;
&lt;br /&gt;
View datapaths:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man datapath print detail&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Key field:&lt;br /&gt;
&lt;br /&gt;
* local-forwarding&lt;br /&gt;
&lt;br /&gt;
Interpretation:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| yes&lt;br /&gt;
| client traffic stays on CAP&lt;br /&gt;
|-&lt;br /&gt;
| no&lt;br /&gt;
| client traffic tunnels to controller&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For KitsNet architecture:&lt;br /&gt;
&lt;br /&gt;
* traffic should normally be &#039;&#039;&#039;local-forwarded&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Security Profiles ==&lt;br /&gt;
&lt;br /&gt;
List security settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man security print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check for:&lt;br /&gt;
&lt;br /&gt;
* WPA2 / WPA3 settings&lt;br /&gt;
* passphrase configuration&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Channel Configuration ==&lt;br /&gt;
&lt;br /&gt;
View channel definitions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man channel print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These define:&lt;br /&gt;
&lt;br /&gt;
* frequency&lt;br /&gt;
* channel width&lt;br /&gt;
* band&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Log Monitoring ==&lt;br /&gt;
&lt;br /&gt;
Look for wireless errors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/log print where topics~&amp;quot;caps&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search authentication failures:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/log print where message~&amp;quot;handshake&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== CAP Device Commands ==&lt;br /&gt;
&lt;br /&gt;
Run these on &#039;&#039;&#039;able&#039;&#039;&#039; or &#039;&#039;&#039;baker&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Check CAP configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart CAP mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap disable&lt;br /&gt;
/interface wireless cap enable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify wireless interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== DHCP Verification ==&lt;br /&gt;
&lt;br /&gt;
Main WLAN DHCP (Radix):&lt;br /&gt;
&lt;br /&gt;
Verify clients receive leases from Radix.&lt;br /&gt;
&lt;br /&gt;
Guest WLAN DHCP (Courvoisier):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/ip dhcp-server lease print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== RF Diagnostics ==&lt;br /&gt;
&lt;br /&gt;
Check signal quality:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man registration-table print stats&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Typical signal values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Signal !! Quality&lt;br /&gt;
|-&lt;br /&gt;
| -40 dBm&lt;br /&gt;
| excellent&lt;br /&gt;
|-&lt;br /&gt;
| -55 dBm&lt;br /&gt;
| very good&lt;br /&gt;
|-&lt;br /&gt;
| -65 dBm&lt;br /&gt;
| acceptable&lt;br /&gt;
|-&lt;br /&gt;
| -75 dBm&lt;br /&gt;
| poor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== CAP Discovery ==&lt;br /&gt;
&lt;br /&gt;
Verify CAP discovery configuration:&lt;br /&gt;
&lt;br /&gt;
On CAP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/interface wireless cap print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check:&lt;br /&gt;
&lt;br /&gt;
* discovery interface&lt;br /&gt;
* caps-man-addresses&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Quick Status Dashboard ==&lt;br /&gt;
&lt;br /&gt;
These commands give a quick operational snapshot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/caps-man remote-cap print&lt;br /&gt;
/caps-man interface print&lt;br /&gt;
/caps-man registration-table print&lt;br /&gt;
/caps-man datapath print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Safe Recovery Steps ==&lt;br /&gt;
&lt;br /&gt;
If wireless service fails:&lt;br /&gt;
&lt;br /&gt;
1. Restart CAPsMAN&lt;br /&gt;
2. Restart CAP radios&lt;br /&gt;
3. Verify CAP connectivity&lt;br /&gt;
4. Check DHCP leases&lt;br /&gt;
5. Review logs&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Related Documentation ==&lt;br /&gt;
&lt;br /&gt;
* Wireless Architecture&lt;br /&gt;
* CAPsMAN Migration Procedure&lt;br /&gt;
* CAPsMAN Troubleshooting Guide&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network&amp;diff=2686</id>
		<title>KitsNet Network</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network&amp;diff=2686"/>
		<updated>2026-09-18T21:36:07Z</updated>

		<summary type="html">&lt;p&gt;Psmode: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NONUMBERHEADINGS__&lt;br /&gt;
Landing page for Network-related material&lt;br /&gt;
&lt;br /&gt;
===Diagrams===&lt;br /&gt;
&lt;br /&gt;
* [http://wiki.kitsnet.us/instaweb/KitsNet_Network.html Network diagram]&lt;br /&gt;
* [[KitsNet Network:Diagram2]]&lt;br /&gt;
&lt;br /&gt;
===Wide Area Network===&lt;br /&gt;
{{Special:Prefixindex/KitsNet_Network:WAN}}&lt;br /&gt;
&lt;br /&gt;
===Local Area Network===&lt;br /&gt;
{{Special:Prefixindex/KitsNet_Network:LAN}}&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=File:KitsNet_Network_Diagram.png&amp;diff=2685</id>
		<title>File:KitsNet Network Diagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=File:KitsNet_Network_Diagram.png&amp;diff=2685"/>
		<updated>2026-09-18T21:32:54Z</updated>

		<summary type="html">&lt;p&gt;Psmode: DrawioEditor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network:Diagram2&amp;diff=2684</id>
		<title>KitsNet Network:Diagram2</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Network:Diagram2&amp;diff=2684"/>
		<updated>2026-09-18T20:54:19Z</updated>

		<summary type="html">&lt;p&gt;Psmode: Created page with &amp;quot;&amp;lt;drawio filename=&amp;quot;KitsNet Network Diagram&amp;quot; editmode=&amp;quot;inline&amp;quot; alignment=&amp;quot;center&amp;quot; alt=&amp;quot;v2.0&amp;quot; /&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;drawio filename=&amp;quot;KitsNet Network Diagram&amp;quot; editmode=&amp;quot;inline&amp;quot; alignment=&amp;quot;center&amp;quot; alt=&amp;quot;v2.0&amp;quot; /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
	<entry>
		<id>https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Builds:Linux:galliano&amp;diff=2672</id>
		<title>KitsNet Operations:Builds:Linux:galliano</title>
		<link rel="alternate" type="text/html" href="https://wiki.kitsnet.us/w/index.php?title=KitsNet_Operations:Builds:Linux:galliano&amp;diff=2672"/>
		<updated>2026-09-18T20:35:22Z</updated>

		<summary type="html">&lt;p&gt;Psmode: (username removed) (log details removed)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[KitsNet Operations:Retired Builds:Linux:galliano]]&lt;/div&gt;</summary>
		<author><name>Psmode</name></author>
	</entry>
</feed>