Operating System - HP-UX
1752767 Members
5046 Online
108789 Solutions
New Discussion юеВ

Re: what commands I should use polling data and graph CPU and MEM util.

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

what commands I should use polling data and graph CPU and MEM util.

I dont have Peformance Mananagement tools ( only glance), but I need to draw graphs on CPU and MEMORY utilizatoins. But, could you please share with me what exactly commands I should use for CPU and MEM utilizations, respectively? I need to take data down every 15 mins, and for as long as a week.

Currently we are running sar command once a day.

Please help me out. Thanks,
none
13 REPLIES 13
OldSchool
Honored Contributor

Re: what commands I should use polling data and graph CPU and MEM util.

take another look at sar. it can route to file, and you can snapshot at intervals...

from that, you should be able to generate a report to a text file that can go into excel so you can create your graphs...
Suraj K Sankari
Honored Contributor

Re: what commands I should use polling data and graph CPU and MEM util.

HI,
Write a script (for cpu and memory data capture) and put in crontab run the script in every 15 minuts and take the output into a file.

take the data into Excel file and make a graph

Suraj
Vishu
Trusted Contributor

Re: what commands I should use polling data and graph CPU and MEM util.

the way you are running sar command once a day to grab that data. Just put that sar or script (you are currently using to get that data) in crontab file to run every 15 min and redirect its output to a file.

After that, you can draw graph based on that output file.
Olivier Masse
Honored Contributor

Re: what commands I should use polling data and graph CPU and MEM util.

I wrote a sar to gnuplot interface 10 years ago, it is still available here: http://www.mayoxide.com/sargraph/

It used to do the job but I have not used this since 2003 and I don't know if it still works correctly.

I now use Openview Performance Manager which by iself isn't free. However, the HP-UX agents are free if you have the VSOE and up and they can be used to extract high-quality data. You can then make graphs in Excel with some elbow grease.

Good luck
Arturo Galbiati
Esteemed Contributor
Solution

Re: what commands I should use polling data and graph CPU and MEM util.

Hello,
this script uses glance to collect data every 60 seconds in a fiel for further use.
When you want trasfer file on your PC import in Excell and produce all chart you need.

#!/usr/bin/ksh
GlnCmd=/opt/perf/bin/glance
WrkDir=~gpsactv/CHECK/scripts
GlnSyn=$WrkDir/gln_syntax_file
GlnOpt="-j60 -adviser_only -nosort -iterations 2 -bootup -syntax $GlnSyn"
ResLog=$(date +%Y%m)-res-cop.log
#
cat<$GlnSyn
print "-- ",
gbl_statdate,
" ",
gbl_stattime,
" ",
gbl_cpu_total_util|3|0,
" ",
gbl_disk_util_peak|3|0,
" ",
gbl_mem_util|3|0,
" ",
gbl_swap_space_util|3|0
EOD
#
#echo -- MM/DD/YY HH:MM:SS CPU DSK MEM SWA
$GlnCmd $GlnOpt 2>/dev/null |tail +2 >>$WrkDir/../dat/$ResLog
#eof

N.B. Take care to change the directory definitions to use your directories.

HTH,
Art
Hanry Zhou
Super Advisor

Re: what commands I should use polling data and graph CPU and MEM util.

Hi Arturo,

Thanks so much for sharing.

I tried your script on my server, and have 2 questions.

1. how would you make it run every 60seconds?
It seems the script itself won't get run every 60seconds, it only poll data everytime you execuate it. or do I have to put it in a cron job, then I will have to create a line "1,2,3,...60 * ..."

2. the format of the output file looks like this:
-- 11/12/2009 11:36:26 22 19 97 18
So, I just need to simply trasfer the file to PC, and import it in Excel?

none
Michael Steele_2
Honored Contributor

Re: what commands I should use polling data and graph CPU and MEM util.

Hi

a) HP Performance Agent which is found in the GlancePlus Pak is the tool you want. Once called Measureware and perfiew this application creates graphs and spreadsheets.

https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-15-28^9637_4000_100__

b) 60 seconds run

I know of no way other then cron using the wildcard character '*' in every column, min, hour, days, week days, month days. What a performance drain though.

c) file into excel

You will have fun doing this trying to import a text file incolumar format into either excel or word. Its time consuming so I recommend adding a comma delimeter in between every row or column.

Better to use Performance manager. This is what it was built for.

Good luck.
Support Fatherhood - Stop Family Law
Hanry Zhou
Super Advisor

Re: what commands I should use polling data and graph CPU and MEM util.

I am sorry, this may sounds a Excel question.

Based on Art's script, on axis line, I want to show the date only, not show the paticular in what mins, for instance, I don't want to show 12:10. What I should do in Excel?

Also, why we would want to put "-- " at the beginning of each row, based on Art's script?

I spent quite some time on the spreadsheet, but just could not figure it out. Appreciate your help.

none
Michael Steele_2
Honored Contributor

Re: what commands I should use polling data and graph CPU and MEM util.

Hi, and Dude,

...you are travelling down a well travelled road of frustation, and the reason I posted the Glance Plus download above. Else, you either have to find another HP-UX application that creates an ascii file in spreadsheet format or spend hours trimming away the bad data the way you are doing it, as you try to make your data readable and presentable to managers.
Support Fatherhood - Stop Family Law