A GLPI plugin that adds a rich resource capacity dashboard to Computer records — showing physical RAM, CPU cores, storage, and VM allocations side-by-side.
| Section | What it shows |
|---|---|
| Summary Cards | Physical RAM, Allocated RAM, Available RAM, CPU Cores, Physical Storage, Storage Summary |
| Utilisation Bars | RAM, CPU Core, and Disk utilisation — colour-coded green → amber → red |
| Physical Drives | Drive model, type (SSD/HDD/NVMe badge), raw capacity, serial number |
| Logical Volumes | Mount point, filesystem, total/free size, per-volume progress bar |
| VM Breakdown | Per-VM RAM and vCPU allocation, storage, RAM share bar, totals and available rows |
| Print Report | One-click Print Report button in the tab toolbar, or direct URL access |
- Zero custom database tables — reads exclusively from GLPI core tables populated by GLPI Agent
- Dual-source capacity merge — uses
GREATEST(per_item_capacity, model_default)so RAID volumes always show a sensible capacity - Colour-coded thresholds — green < 60%, amber 60–79%, red ≥ 80% for instant visual triage
- PSR-4 autoloading —
GlpiPlugin\Virtualcapacity\namespace - Three-layer architecture —
Capacity.php(data) ·CapacityRenderer.php(controller) · Twig templates (view) - Twig-native rendering — all HTML lives in
templates/using GLPI 11'sTemplateRenderer; no PHPechoin the presentation layer - Tab/Profile separation —
Profile.phpowns tab registration;Capacity.phpowns data; no cross-concern coupling - GLPI 11.x compatible with Bootstrap 5, Tabler Icons, Symfony HTTP exceptions, and
Glpi\DBAL\QueryExpression
| Dependency | Minimum version |
|---|---|
| GLPI | 11.0.0 |
| PHP | 8.2 |
| GLPI Agent (for inventory data) | any |
- Go to Setup → Plugins → Marketplace
- Search for Virtual Capacity
- Click Install, then Enable
# From your GLPI plugins directory
cd /path/to/glpi/plugins
# Download the latest release archive
wget https://github.com/tahir242/virtualcapacity/releases/latest/download/virtualcapacity.zip
unzip virtualcapacity.zip
# Set correct ownership
chown -R www-data:www-data virtualcapacity/Then go to Setup → Plugins in GLPI, find Virtual Capacity, and click Install → Enable.
cd /path/to/glpi/plugins
git clone https://github.com/tahir242/virtualcapacity.git
cd virtualcapacity
composer install --no-dev --optimize-autoloaderAfter activation, open any Computer record in GLPI:
- Navigate to Assets → Computers
- Open a Computer that has been inventoried by GLPI Agent
- Click the Resource Capacity tab
The full dashboard will appear. To generate a printable report, click the Print Report button in the tab toolbar (opens in a new tab), or navigate directly to:
https://your-glpi-instance/plugins/virtualcapacity/front/report.php?computers_id=<id>
On the report page, click Print / Export PDF to open your browser's print dialog (supports Save as PDF).
plugins/virtualcapacity/
├── src/
│ ├── Capacity.php # Data layer — DB queries only, no HTML
│ ├── CapacityRenderer.php # Controller — pre-computes display values,
│ │ # calls TemplateRenderer; no echo/HTML
│ └── Profile.php # Tab registration — CommonGLPI interface
├── templates/
│ ├── capacity_tab.html.twig # Root wrapper + toolbar
│ └── partials/
│ ├── metric_cards.html.twig # ROW 1: six summary cards
│ ├── progress_bars.html.twig # ROW 2: RAM/CPU/Disk bars
│ ├── storage_tables.html.twig # ROW 3: drives + volumes tables
│ └── vm_breakdown.html.twig # ROW 4: VM breakdown table
├── front/
│ └── report.php # Standalone printable report page
└── public/
└── virtualcapacity.css # Scoped CSS (.vc-tab prefix), no inline styles
| Decision | Rationale |
|---|---|
Twig templates via TemplateRenderer |
GLPI 11 native; auto-registered under @virtualcapacity/ namespace |
| All derived values pre-computed in PHP | Avoids a Twig extension; templates stay logic-free |
Profile separate from Capacity |
Separation of concerns — tab plumbing vs. data access |
Glpi\DBAL\QueryExpression |
Replaces deprecated root-namespace \QueryExpression |
BadRequestHttpException |
Replaces deprecated Html::displayErrorAndDie() |
CSS custom properties (:root) |
Single source of truth for heading/badge colours |
The plugin reads these GLPI core tables (no writes):
| Table | Data |
|---|---|
glpi_items_devicememories |
Physical RAM per memory stick |
glpi_items_deviceprocessors |
Physical CPU sockets / cores |
glpi_itemvirtualmachines |
VM definitions with RAM and vCPU allocations |
glpi_items_deviceharddrives |
Physical hard drives with per-item capacity |
glpi_deviceharddrives |
Drive model definitions with capacity_default |
glpi_deviceharddrivetypes |
Drive type labels (SSD, HDD, NVMe, …) |
glpi_items_disks |
Logical partitions / mount points |
glpi_filesystems |
Filesystem labels (NTFS, ext4, …) |
# Install dev dependencies
composer install
# Check code quality
composer run lint # PHP parallel lint
composer run cs # PHP-CS-Fixer dry run
composer run phpstan # PHPStan static analysis
composer run qa # All checks
# Fix coding standards automatically
composer run cs-fixSee CONTRIBUTING.md for full contribution guidelines.
See CHANGELOG.md for a full list of changes between releases.
Released under the GNU General Public License v3+.
- 🐛 Bug reports: GitHub Issues
- 💡 Feature requests: GitHub Issues
- 🔒 Security vulnerabilities: see SECURITY.md
