11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

vmstat<br />

netstat<br />

uptime<br />

bash$ stat file_inesistente<br />

file_inesistente: No such file or <strong>di</strong>rectory<br />

Visualizza statistiche riguardanti la memoria virtuale.<br />

Capitolo 13. Coman<strong>di</strong> <strong>di</strong> sistema e d’amministrazione<br />

bash$ vmstat<br />

procs memory swap io system cpu<br />

r b w swpd free buff cache si so bi bo in cs us sy id<br />

0 0 0 0 11040 2636 38952 0 0 33 7 271 88 8 3 89<br />

Mostra informazioni e statistiche sulla rete corrente, come le tabelle <strong>di</strong> routing e le connessioni<br />

attive. Questa utility accede alle informazioni presenti in /proc/net (Capitolo 27). Ve<strong>di</strong> Esempio<br />

27-3.<br />

netstat -r equivale a route.<br />

bash$ netstat<br />

Active Internet connections (w/o servers)<br />

Proto Recv-Q Send-Q Local Address Foreign Address State<br />

Active UNIX domain sockets (w/o servers)<br />

Proto RefCnt Flags Type State I-Node Path<br />

unix 11 [ ] DGRAM 906 /dev/log<br />

unix 3 [ ] STREAM CONNECTED 4514 /tmp/.X11-unix/X0<br />

unix 3 [ ] STREAM CONNECTED 4513<br />

. . .<br />

Mostra da quanto tempo il sistema è attivo, con le relative statistiche.<br />

bash$ uptime<br />

10:28pm up 1:57, 3 users, load average: 0.17, 0.34, 0.27<br />

Nota: Un valore <strong>di</strong> load average <strong>di</strong> 1 o minore in<strong>di</strong>ca che il sistema gestisce i processi<br />

imme<strong>di</strong>atamente. Un load average maggiore <strong>di</strong> 1 significa che i processi vengono accodati.<br />

Quando load average oltrepassa il 3 vuol <strong>di</strong>re che le prestazioni del sistema sono degradate in<br />

maniera significativa.<br />

359

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!