GTop - Perl interface to libgtop
use GTop (); my $gtop = GTop->new;
Perl interface to libgtop:
http://ftp.gnome.org/pub/gnome/sources/libgtop/
my $cpu = $gtop->cpu;
my $flags = $cpu->flags;
my $total = $cpu->total;
my $user = $cpu->user;
my $nice = $cpu->nice;
my $sys = $cpu->sys;
my $idle = $cpu->idle;
my $frequency = $cpu->frequency;
my $fsusage = $gtop->fsusage($disk);
my $flags = $fsusage->flags;
my $blocks = $fsusage->blocks;
my $bfree = $fsusage->bfree;
my $bavail = $fsusage->bavail;
my $files = $fsusage->files;
my $ffree = $fsusage->ffree;
my $loadavg = $gtop->loadavg;
my $flags = $loadavg->flags;
my $nr_running = $loadavg->nr_running;
my $nr_tasks = $loadavg->nr_tasks;
my $last_pid = $loadavg->last_pid;
my $mem = $gtop->mem;
my $flags = $mem->flags;
my $total = $mem->total;
my $used = $mem->used;
my $free = $mem->free;
my $shared = $mem->shared;
my $buffer = $mem->buffer;
my $cached = $mem->cached;
my $user = $mem->user;
my $locked = $mem->locked;
my $mountlist = $gtop->mountlist($all_fs);
my $flags = $mountlist->flags;
my $number = $mountlist->number;
my $total = $mountlist->total;
my $size = $mountlist->size;
my $netload = $gtop->netload($interface);
my $flags = $netload->flags;
my $if_flags = $netload->if_flags;
my $mtu = $netload->mtu;
my $subnet = $netload->subnet;
my $address = $netload->address;
my $packets_in = $netload->packets_in;
my $packets_out = $netload->packets_out;
my $packets_total = $netload->packets_total;
my $bytes_in = $netload->bytes_in;
my $bytes_out = $netload->bytes_out;
my $bytes_total = $netload->bytes_total;
my $errors_in = $netload->errors_in;
my $errors_out = $netload->errors_out;
my $errors_total = $netload->errors_total;
my $collisions = $netload->collisions;
my $proc_args = $gtop->proc_args($pid);
my $flags = $proc_args->flags;
my $size = $proc_args->size;
my $proc_map = $gtop->proc_map($pid);
my $flags = $proc_map->flags;
my $number = $proc_map->number;
my $total = $proc_map->total;
my $size = $proc_map->size;
my $proc_mem = $gtop->proc_mem($pid);
my $flags = $proc_mem->flags;
my $size = $proc_mem->size;
my $vsize = $proc_mem->vsize;
my $resident = $proc_mem->resident;
my $share = $proc_mem->share;
my $rss = $proc_mem->rss;
my $rss_rlim = $proc_mem->rss_rlim;
my $proc_segment = $gtop->proc_segment($pid);
my $flags = $proc_segment->flags;
my $text_rss = $proc_segment->text_rss;
my $shlib_rss = $proc_segment->shlib_rss;
my $data_rss = $proc_segment->data_rss;
my $stack_rss = $proc_segment->stack_rss;
my $dirty_size = $proc_segment->dirty_size;
my $start_code = $proc_segment->start_code;
my $end_code = $proc_segment->end_code;
my $start_stack = $proc_segment->start_stack;
my $proc_state = $gtop->proc_state($pid);
my $flags = $proc_state->flags;
my $proc_time = $gtop->proc_time($pid);
my $flags = $proc_time->flags;
my $start_time = $proc_time->start_time;
my $rtime = $proc_time->rtime;
my $utime = $proc_time->utime;
my $stime = $proc_time->stime;
my $cutime = $proc_time->cutime;
my $cstime = $proc_time->cstime;
my $timeout = $proc_time->timeout;
my $it_real_value = $proc_time->it_real_value;
my $frequency = $proc_time->frequency;
my $proc_uid = $gtop->proc_uid($pid);
my $flags = $proc_uid->flags;
my $uid = $proc_uid->uid;
my $euid = $proc_uid->euid;
my $gid = $proc_uid->gid;
my $egid = $proc_uid->egid;
my $pid = $proc_uid->pid;
my $ppid = $proc_uid->ppid;
my $pgrp = $proc_uid->pgrp;
my $session = $proc_uid->session;
my $tty = $proc_uid->tty;
my $tpgid = $proc_uid->tpgid;
my $priority = $proc_uid->priority;
my $nice = $proc_uid->nice;
my $proclist = $gtop->proclist;
my $flags = $proclist->flags;
my $number = $proclist->number;
my $total = $proclist->total;
my $size = $proclist->size;
my $swap = $gtop->swap;
my $flags = $swap->flags;
my $total = $swap->total;
my $used = $swap->used;
my $free = $swap->free;
my $pagein = $swap->pagein;
my $pageout = $swap->pageout;
my $uptime = $gtop->uptime;
my $flags = $uptime->flags;
Doug MacEachern wrote the original version.
Currently it's maintained by Stas Bekman <stas@stason.org>.
To install GTop, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GTop
CPAN shell
perl -MCPAN -e shell install GTop
For more information on module installation, please visit the detailed CPAN module installation guide.