Files
cacti/scripts/loadavg_multi.pl
T
Tony Roman 6c0cca5942 bug#0000656: Perl scripts using back ticks is not portable
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/branches/BRANCH_0_8_6/cacti@3439 860744bd-22fc-0310-8c96-e9fe5004b5ca
2005-12-21 02:56:49 +00:00

13 lines
280 B
Perl

#!/usr/bin/perl
#get load avg for 1;5;10 min
open(PROCESS, "uptime |");
$avg = <PROCESS>;
close(PROCESS);
# 9:36pm up 15 days, 11:37, 2 users, load average: 0.14, 0.13, 0.10
$avg =~ s/^.*:\s(\d+\.\d{2}),\s(\d+\.\d{2}),\s(\d+\.\d{2})$//;
print "1min:$1 5min:$2 10min:$3";