124 |
|
my($top) = join(" ", @top); |
125 |
|
$top =~ s/\n//g; |
126 |
|
|
127 |
– |
&print_pair(0, "packet.load.load1", $top =~ /load averages:\s*([^\s]+?),/); |
128 |
– |
&print_pair(0, "packet.load.load5", $top =~ /load averages:\s*.+?,\s*([^\s]+?),/); |
129 |
– |
&print_pair(0, "packet.load.load15", $top =~ /load averages:\s*.+?,\s*.+?,\s*([^\s]+?)\s/); |
127 |
|
&print_pair(0, "packet.processes.total", $top =~ /([^\s]+?) processes:/); |
128 |
|
&print_pair(0, "packet.processes.sleeping", $top =~ / ([^\s]+?) sleeping/); |
129 |
|
&print_pair(0, "packet.processes.zombie", $top =~ / ([^\s]+?) zombie/); |
204 |
|
|
205 |
|
# grab the uptime |
206 |
|
my($uptime) = `$uptimebin`; |
207 |
+ |
|
208 |
+ |
&print_pair(0, "packet.load.load1", $uptime =~ /load average.?:\s*([^\s]+?),/); |
209 |
+ |
&print_pair(0, "packet.load.load5", $uptime =~ /load average.?:\s*.+?,\s*([^\s]+?),/); |
210 |
+ |
&print_pair(0, "packet.load.load15", $uptime =~ /load average.?:\s*.+?,\s*.+?,\s*([^\s]+)/); |
211 |
|
|
212 |
|
# work out the days, hours, and minutes |
213 |
|
|