- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to generate graph with the sar reports
Operating System - HP-UX
1820390
Members
3628
Online
109623
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2008 12:12 AM
тАО11-06-2008 12:12 AM
How to generate graph with the sar reports
Hi,
Could anyone help in generating the performance graphs using the sar data file.
regards,
sanwin
Could anyone help in generating the performance graphs using the sar data file.
regards,
sanwin
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-06-2008 01:16 AM
тАО11-06-2008 01:16 AM
Re: How to generate graph with the sar reports
Hello,
There are many, many ways. Some commercial, some open-source.
I wonder why can't you use Glance + MeasureWare? Possibly licensing issue?
Anyway, here are some of many possibilities
(listed here in random order):
a) Commercial SarCheck:
http://www.sarcheck.com/
b) Open-source Ksar sar grapher:
http://ksar.atomique.net/download.html
c) Perl scripts based on modules like GIFgraph::bars.
One example for Linux (relativey easy to port to HP-UX):
http://linuxshellaccount.blogspot.com/2008/01/linux-perl-script-to-graph-out-paging.html
d) Download the data into an Excel or other type of
spreadsheet and graph it within it.
Here is a simple CSV file creation for CPU utilisation in 10 iterations (just to give
you an idea how simple it is):
sar -u 10 10 | tr -s ' ' ',' > cpu.csv
e) Use Gnuplot. Some examples:
http://www.itworld.com/nls_unixsar021024
http://in2nix.com/examples/index.html
f) Open-source Sargraph (inputs data into gnuplot):
http://www.mayoxide.com/sargraph/
g) Open-source RRDtool:
http://oss.oetiker.ch/rrdtool/
http://haroon.sis.utoronto.ca/rrd/scripts/
h) Open-source Cacti( front-end to RRDtool):
http://www.cacti.net/
And so on.
Cheers,
VK2COT
PS. Many years ago (I think somewhere around 1999) , I wrote the following Perl script that generated three CSV files
for Solaris servers. They were then imported into Excel...
#!/usr/bin/perl
# 00:00:00 device %busy avque r+w/s blks/s avwait avserv
#use strict;
use Getopt::Std;
use File::Basename;
use vars qw(@Header $z %Disk %RW @Keyspaces @Onetime $Time
$FF $SAFile $Disk @WholeComplex $RW %WholeComplex @Servdata
$Realmonth $Month $Sec $Min $Hour $DayOfMonth $Month $Year
$Result $FR $DayOfWeek $DayofYear $IsDST);
($Sec, $Min, $Hour, $DayOfMonth, $Month, $Year, $DayOfWeek, $DayofYear, $IsDST) = localtime ;
# localtime returns January..December as 0..11.
$Realmonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)[$Month];
$Month++;
$Year = 1900 + $Year;
$Realmonth = "Jan";
($::opt_f) = (); #avoid warning message
getopts('f:');
$::SAFile = $::opt_f;
if (! "$SAFile" ) {
$FF = "";
} else {
$FF = "-f $SAFile";
}
$FR = basename($SAFile);
print "Processing SAR file $SAFile ($FR)\n";
$Result1 = "/sardata/${FR}${Realmonth}${Year}-DSK_RWS.txt";
$Result2 = "/sardata/${FR}${Realmonth}${Year}-DSK_BUSY.txt";
$Result3 = "/sardata/${FR}${Realmonth}${Year}-DSK_AVSERV.txt";
open(To1, ">$Result1") or die "ERROR: Can't open $Result: $!";
open(To2, ">$Result2") or die "ERROR: Can't open $Result: $!";
open(To3, ">$Result3") or die "ERROR: Can't open $Result: $!";
open(FROM,"sar -d $FF | awk '! /%/ && ! /,/ {print}'|") || die "Cannot open sar data";
while () {
chomp;
if (/:/ .. /^$/) {
@Keyspaces = split(/\s+/, $_);
if (grep(/:/, $_)) {
$Time = $Keyspaces[0];
printf To1 "\n$Time ";
printf To2 "\n$Time ";
printf To3 "\n$Time ";
if (! grep(/\bTimeStamp/, @Header)) {
push @Header, "\nTimeStamp ";
}
}
$Disk{$Time} = $Keyspaces[1];
$Busy{$Time} = $Keyspaces[2];
$Avserv{$Time} = $Keyspaces[$#{Keyspaces}];
$RW{$Time} = $Keyspaces[4];
printf To1 "$RW{$Time} ";
printf To2 "$Busy{$Time} ";
printf To3 "$Avserv{$Time};
if (! grep(/\b$Disk{$Time}/, @Header)) {
push @Header, "$Disk{$Time} ";
}
}
}
printf To1 "@Header\n";
printf To2 "@Header\n";
printf To3 "@Header\n";
close(To1);
close(To2);
close(To3);
close(FROM);
exit;
foreach $z (sort keys %WholeComplex) {
print "$z $WholeComplex{$z}\n";
}
exit(0);
There are many, many ways. Some commercial, some open-source.
I wonder why can't you use Glance + MeasureWare? Possibly licensing issue?
Anyway, here are some of many possibilities
(listed here in random order):
a) Commercial SarCheck:
http://www.sarcheck.com/
b) Open-source Ksar sar grapher:
http://ksar.atomique.net/download.html
c) Perl scripts based on modules like GIFgraph::bars.
One example for Linux (relativey easy to port to HP-UX):
http://linuxshellaccount.blogspot.com/2008/01/linux-perl-script-to-graph-out-paging.html
d) Download the data into an Excel or other type of
spreadsheet and graph it within it.
Here is a simple CSV file creation for CPU utilisation in 10 iterations (just to give
you an idea how simple it is):
sar -u 10 10 | tr -s ' ' ',' > cpu.csv
e) Use Gnuplot. Some examples:
http://www.itworld.com/nls_unixsar021024
http://in2nix.com/examples/index.html
f) Open-source Sargraph (inputs data into gnuplot):
http://www.mayoxide.com/sargraph/
g) Open-source RRDtool:
http://oss.oetiker.ch/rrdtool/
http://haroon.sis.utoronto.ca/rrd/scripts/
h) Open-source Cacti( front-end to RRDtool):
http://www.cacti.net/
And so on.
Cheers,
VK2COT
PS. Many years ago (I think somewhere around 1999) , I wrote the following Perl script that generated three CSV files
for Solaris servers. They were then imported into Excel...
#!/usr/bin/perl
# 00:00:00 device %busy avque r+w/s blks/s avwait avserv
#use strict;
use Getopt::Std;
use File::Basename;
use vars qw(@Header $z %Disk %RW @Keyspaces @Onetime $Time
$FF $SAFile $Disk @WholeComplex $RW %WholeComplex @Servdata
$Realmonth $Month $Sec $Min $Hour $DayOfMonth $Month $Year
$Result $FR $DayOfWeek $DayofYear $IsDST);
($Sec, $Min, $Hour, $DayOfMonth, $Month, $Year, $DayOfWeek, $DayofYear, $IsDST) = localtime ;
# localtime returns January..December as 0..11.
$Realmonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)[$Month];
$Month++;
$Year = 1900 + $Year;
$Realmonth = "Jan";
($::opt_f) = (); #avoid warning message
getopts('f:');
$::SAFile = $::opt_f;
if (! "$SAFile" ) {
$FF = "";
} else {
$FF = "-f $SAFile";
}
$FR = basename($SAFile);
print "Processing SAR file $SAFile ($FR)\n";
$Result1 = "/sardata/${FR}${Realmonth}${Year}-DSK_RWS.txt";
$Result2 = "/sardata/${FR}${Realmonth}${Year}-DSK_BUSY.txt";
$Result3 = "/sardata/${FR}${Realmonth}${Year}-DSK_AVSERV.txt";
open(To1, ">$Result1") or die "ERROR: Can't open $Result: $!";
open(To2, ">$Result2") or die "ERROR: Can't open $Result: $!";
open(To3, ">$Result3") or die "ERROR: Can't open $Result: $!";
open(FROM,"sar -d $FF | awk '! /%/ && ! /,/ {print}'|") || die "Cannot open sar data";
while (
chomp;
if (/:/ .. /^$/) {
@Keyspaces = split(/\s+/, $_);
if (grep(/:/, $_)) {
$Time = $Keyspaces[0];
printf To1 "\n$Time ";
printf To2 "\n$Time ";
printf To3 "\n$Time ";
if (! grep(/\bTimeStamp/, @Header)) {
push @Header, "\nTimeStamp ";
}
}
$Disk{$Time} = $Keyspaces[1];
$Busy{$Time} = $Keyspaces[2];
$Avserv{$Time} = $Keyspaces[$#{Keyspaces}];
$RW{$Time} = $Keyspaces[4];
printf To1 "$RW{$Time} ";
printf To2 "$Busy{$Time} ";
printf To3 "$Avserv{$Time};
if (! grep(/\b$Disk{$Time}/, @Header)) {
push @Header, "$Disk{$Time} ";
}
}
}
printf To1 "@Header\n";
printf To2 "@Header\n";
printf To3 "@Header\n";
close(To1);
close(To2);
close(To3);
close(FROM);
exit;
foreach $z (sort keys %WholeComplex) {
print "$z $WholeComplex{$z}\n";
}
exit(0);
VK2COT - Dusan Baljevic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2019 03:05 AM
тАО01-07-2019 03:05 AM
Re: How to generate graph with the sar reports
After sar report is collected, next step is to visualize the report. For that https://github.com/sumitbiswasgit/sarbox can be used which will help to display numbers into graphs for different categories.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP