Description :
Renvoie le load average sur 1 mn, 5 mn et 15 mn, et le nb de process en cours.
Portion de code
1 2 3 4 5 6 7 8 9 10 11
|
# Extrait du script sysalive.pl # http://lhebergeur.net/perl/script.cgi?script=./sys_alive.pl
sub GetInfosCPU { open (F,"/proc/loadavg"); my $loadavg=<F>; close(F); my($temp1, $temp2); my ($cpu_1, $cpu_5, $cpu_15, $temp1, $temp2) = split(/\s+/, $loadavg); my ($temp1, $nb_process) = split(/\//, $temp1);
return ($cpu_1, $cpu_5, $cpu_15, $nb_process); } |
|