script primera version
parent
653c1c8957
commit
0ffdee153b
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
export LC_ALL=C bash
|
||||||
|
|
||||||
|
tHost="$(hostname)"
|
||||||
|
tTime="$(date +"%d/%m/%Y a las %H:%M:%S")"
|
||||||
|
tMemTotal="$(free -h | grep "Mem:" | awk '{print $2}')"
|
||||||
|
tMemUsed="$(free -h | grep "Mem:" | awk '{print $3}')"
|
||||||
|
tMemFree="$(free -h | grep "Mem:" | awk '{print $4}')"
|
||||||
|
tUptime="$(uptime -p)"
|
||||||
|
tLoadAverage="$(uptime | awk '{print $8,$9,$10}')"
|
||||||
|
|
||||||
|
echo -e "\n$tHost - $tTime - Uptime: $tUptime"
|
||||||
|
echo -e "RAM: $tMemUsed usados de $tMemTotal totales ($tMemFree libres)\nCPU Load Average: $tLoadAverage\n\n[+] Listado de Procesos top10 consumo de RAM:\n"
|
||||||
|
ps -A --sort=-rss --format pid,user,pmem,rss,comm | head -10
|
||||||
|
echo -e "\nPor tanto el proceso en el top1 consumo RAM es:\n"
|
||||||
|
ps -A --sort=-rss --format pid,user,pmem,rss,command | head -2
|
||||||
|
echo -e "\n[+] Listado de Procesos top10 consumo CPU:\n"
|
||||||
|
ps -A --sort=-pcpu --format pid,user,pcpu,rss,comm | head -10
|
||||||
|
echo -e "\nPor tanto el proceso en el top1 consumo CPU es:\n"
|
||||||
|
ps -A --sort=-pcpu --format pid,user,pcpu,rss,command | head -2
|
||||||
|
echo -e "\n"
|
Loading…
Reference in New Issue