Sysstat::Sar - Sysstat sar file parser
version 0.003
This module parse sar file output to perl data structure for easy manipulation. To turn on diagnostics, set SMART_COMMENTS=1 to environment variable. Some additional value is added like cpu min and max idle value for each day / all records in a day. 'hostname' => { '08/28/16' => { 'totalcpu' => '(4CPU)', 'kernel' => '2.6.32-431.29.2.el6.x86_64', 'cpu' => { '1' => [ [ '00:10:01', '0.14', '0.00', '0.13', '0.00', '0.00', '0.00', '0.00', '0.00', '99.73' ], [ '00:20:01', '0.15', '0.00', '0.12', '0.00', '0.00', '0.00', '0.00', '0.00', '99.73' ], ........ output shorten ................
parameter (current line from file handle, hash reference ) This method return a hash reference passed from parse method. it will set current position hostname, date, os, kernel version, cpu arch and totalcpu. hash structure that being setup are : {hostname}{date}{os} {hostname}{date}{kernel} {hostname}{date}{arch} {hostname}{date}{totalcpu}
return parse output in hash structure : hostname->date->memory ->detail = array ->average = array ->used->min = scalar ->used->max = scalar hostname->date->cpu ->'all/cpu number' = array ->idle->'all/cpu number'->min = scalar ->idle->'all/cpu number'->max = scalar ->average->'all/cpu number' = array
Sysstat::Sar::CPU
Heince Kurniawan <heince@cpan.org>
This software is copyright (c) 2016 by Heince Kurniawan <heince@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Sysstat::Sar, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sysstat::Sar
CPAN shell
perl -MCPAN -e shell install Sysstat::Sar
For more information on module installation, please visit the detailed CPAN module installation guide.