MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

SystemProbe

MMO\admin\monitoring\probes · 1 symbole · générée le 27 Oct 2026

class

SystemProbe

SystemProbe.php:23

A server's health: load, cpu, memory, swap, disks and inodes, network, processes, services, uptime -- one script reading /proc, df, ps and systemctl, run once per server whatever number of sites it hosts.

class MMO\admin\monitoring\probes\SystemProbe extends MMO\admin\monitoring\aProbe
Espace de noms
MMO\admin\monitoring\probes
Étend
aProbe
The cpu and the network are measured over [`$sample`](https://mmoframework.fr/fr/documentation/mmo.admin/php/monitoring/probes/SystemProbe.md#systemprobe-sample) seconds (two reads of `/proc/stat` and `/proc/net/dev`): a cumulative counter since boot says nothing about now. On a webspace ([`Server::isManaged`](https://mmoframework.fr/fr/documentation/mmo.admin/php/entities/Server.md#server-ismanaged)) most of it is the provider's: `ps` shows our processes only, `systemctl` is not there, `df` shows the quota or nothing. What it cannot read it leaves out -- no metric, rather than a wrong 0. Metrics: `load.1|5|15`, `load.perCpu`, `cpu.count`, `cpu.usedPercent`, `cpu.iowaitPercent`, `memory.totalMb`, `memory.usedPercent`, `swap.usedPercent`, `disk.{mount}.usedPercent|freeGb|inodesPercent` (`/` is `root`, `/var/www` is `var-www`), `disk.maxUsedPercent`, `net.rxKbps`, `net.txKbps`, `processes`, `uptime.days`, `reboot.required`, `services.failed`. Facts: `os`, `kernel`, `php`, `hostname`.

Constantes3

DESCRIPTION

const DESCRIPTION = 'load, cpu, memory, disks, network, processes, services'

KIND

const KIND = 'server'

NAME

const NAME = 'system'

Propriétés3

ignoredFilesystems

array $ignoredFilesystems = ['tmpfs', 'devtmpfs', 'squashfs', 'overlay', 'efivarfs']
Type
array

sample

float $sample = 0.5
Type
float

services

array $services = […8 items]
Type
array

Méthodes12

dfRows($df)

SystemProbe.php:181
protected function dfRows(string $df): array
$dfstring
retournearrayarray{0: string, 1: float, 2: float, 3: float}> mount => [device, total, used, available] (df -P's)

interfaces($dev)

SystemProbe.php:135
protected function interfaces(string $dev): array
$devstring
retournearrayarray{0: float, 1: float}> interface => [bytes received, bytes sent], the loopback left out

MountName($mount)

staticSystemProbe.php:195
static function MountName(string $mount): string
$mountstring
retournestringa mount point as a metric name: / is root, /var/www is var-www

parseMemory($meminfo, $reading)

SystemProbe.php:145
protected function parseMemory(string $meminfo, MMO\admin\monitoring\Reading $reading): void
$meminfostring
$readingReading
retournevoid

parseNetwork($first, $second, $reading)

SystemProbe.php:119
protected function parseNetwork(string $first, string $second, MMO\admin\monitoring\Reading $reading): void
$firststring
$secondstring
$readingReading
retournevoid

parseServices($services, $reading)

SystemProbe.php:210
protected function parseServices(string $services, MMO\admin\monitoring\Reading $reading): void
$servicesstring
$readingReading
retournevoid

probe($subject, $reading, $previous)

SystemProbe.php:37
protected function probe( MMO\admin\entities\Server|MMO\admin\entities\Target $subject, MMO\admin\monitoring\Reading $reading, ?MMO\admin\monitoring\Reading $previous ): void
$subjectServer | Target
$readingReading
$previousnull | Reading
retournevoid
Membres hérités (16)
ConstantesDéclaré parDescription
SERVERaProbea probe of servers
TARGETaProbea probe of targets: the sites of the project, one per client
PropriétésDéclaré parDescription
enabledaProbe
hubaProbe
timeoutaProbe
MéthodesDéclaré parDescription
appliesTo($subject)aProbe
collect($subject, $previous, $time)aProbeLook at a subject, never throwing: whatever goes wrong is in the reading.
debugName()aProbe
failure($e)aProbe
needsShell()aProbe
Number($value)aProbe
Percent($part, $whole)aProbe
run($subject, $script)aProbeRun a script on the subject, stopped after $timeout seconds where timeout exists (a webspace may lack it).
Sections($output)aProbe
shell($subject)aProbe
__construct($options, $hub)aProbe