#!/usr/bin/perl -w use strict; use Sysadm::Install qw(:all); use CGI qw(:all); use Regexp::Common; use Sysadm::Install qw(:all); my($stdout, $stderr, $rc) = tap "iostat", 1, 2; $stdout =~ /avg-cpu.*?avg-cpu/gs; print header(); for my $key (qw(user nice sys iowait idle)) { if($stdout =~ /\G.*?($RE{num}{real})/gs) { printf "%s %s ", $key, $1; } }