Monitorización de sistemas: métricas dinámicas vs parámetros estáticos en Linux, macOS y Windows
📊 1. MÉTRICAS DINÁMICAS
| Métrica | Linux (bash) | macOS (bash/zsh) | PowerShell (Windows) |
|---|---|---|---|
| Uso CPU % | top -bn1 |
grep "Cpu" | top -l 1 |
| Uso CPU por núcleo | mpstat -P ALL 1 1 |
top -l 1 | grep CPU |
| Load average | uptime |
uptime |
Get-Counter '\System\Processor Queue Length' |
| Procesos activos | ps aux | wc -l |
ps aux |
| Procesos por CPU | ps aux --sort=-%cpu |
head | ps aux -r |
| Uso RAM | free -h |
vm_stat |
Get-CimInstance Win32_OperatingSystem |
| Uso swap | free -h |
sysctl vm.swapusage |
Get-Counter '\Paging File(_Total)\% Usage' |
| Uso disco | df -h |
df -h |
Get-PSDrive |
| I/O disco | iostat -x 1 1 |
iostat 1 1 |
Get-Counter '\PhysicalDisk(_Total)\Disk Reads/sec' |
| Tráfico red | ifstat o ip -s link |
netstat -ib |
Get-Counter '\Network Interface(*)\Bytes Total/sec' |
| Conexiones activas | ss -tunap |
netstat -an |
Get-NetTCPConnection |
| Puertos abiertos | ss -tuln |
lsof -i |
Get-NetTCPConnection -State Listen |
| Temperatura CPU | sensors |
powermetrics --samplers smc |
(limitado) Get-WmiObject MSAcpi_ThermalZoneTemperature |
| Uptime | uptime |
uptime |
(Get-Uptime) |
🧱 2. PARÁMETROS ESTÁTICOS
| Parámetro | Linux (bash) | macOS (bash/zsh) | PowerShell (Windows) |
|---|---|---|---|
| Modelo CPU | lscpu |
sysctl -n machdep.cpu.brand_string |
Get-CimInstance Win32_Processor |
| Núcleos CPU | nproc |
sysctl -n hw.ncpu |
(Get-CimInstance Win32_Processor).NumberOfCores |
| Frecuencia CPU | lscpu | grep MHz |
sysctl hw.cpufrequency |
| Arquitectura | uname -m |
uname -m |
$env:PROCESSOR_ARCHITECTURE |
| RAM total | free -h |
sysctl hw.memsize |
Get-CimInstance Win32_ComputerSystem |
| Tipo RAM | dmidecode -t memory |
(limitado) | Get-CimInstance Win32_PhysicalMemory |
| Disco total | lsblk o df -h |
diskutil list |
Get-PhysicalDisk |
| Tipo disco | lsblk -d -o name,rota |
system_profiler SPStorageDataType |
Get-PhysicalDisk |
| Sistema archivos | df -T |
mount |
Get-Volume |
| Interfaces red | ip a |
ifconfig |
Get-NetAdapter |
| Velocidad red | ethtool eth0 |
networksetup -getinfo |
Get-NetAdapter |
| Dirección MAC | ip link |
ifconfig |
Get-NetAdapter |
| Versión SO | cat /etc/os-release |
sw_vers |
Get-ComputerInfo |
| Kernel | uname -r |
uname -r |
(Get-CimInstance Win32_OperatingSystem).Version |
| GPU | lspci |
grep VGA | system_profiler SPDisplaysDataType |