Operating System - HP-UX
1751933 Members
4674 Online
108783 Solutions
New Discussion юеВ

Need help with Glance Scripting

 
SOLVED
Go to solution
Dave Jadischke
Occasional Advisor

Need help with Glance Scripting

I need help stopping this glance command:

glance -advisor_only -syntax gpm_advisor -j2 >> glance.out

it works great but I need it to stop its self after 20 or so cycles, any suggestions?
9 REPLIES 9
Mladen Despic
Honored Contributor
Solution

Re: Need help with Glance Scripting

Dave,

Try this:

glance -advisor_only -syntax gpm_advisor -j2 >> glance.out &
sleep 40
kill %%

NOTE: if you run this from a script, you will likely get error messages - like "GlancePlus Non-Fatal Error" and "Unable to perform functions on devices" - but HP says this is ok.

HTH

Mladen
Juan Gonz├бlez
Trusted Contributor

Re: Need help with Glance Scripting

Hi Dave,
try this
glance -advisor_only -syntax gpm_advisor
-j2 -iterations 20>> glance.out

Best regards
Juan Gonzalez
Dave Jadischke
Occasional Advisor

Re: Need help with Glance Scripting

Thanks for the pointers both ways work well. BUT... I'm pulling 3 different metrics, if I run it for 2 interations I get 434 lines of data in 3 columns. Where does 434 come from? I'm trying to strike an average for each metric but I?m not sure if I should add them up then divide by 434 or if there is something weird with that set of numbers. Any help would be appreciated. Thanks.


Juan Gonz├бlez
Trusted Contributor

Re: Need help with Glance Scripting

Hi,
are you using a LOOP command? If you do this you get the metrics for all . If you attach your script I will be more specific?

Best regards
Dave Jadischke
Occasional Advisor

Re: Need help with Glance Scripting

Yes, I am using a loop in the syntax file. Here is my glance command followed by the syntax file (gpm_adviser). I'm not sure what to use in place of PROCESS LOOP, is this why i'm getting so much data?

glance -adviser_only -syntax gpm_adviser -j 5 -iterations 2 > glance.out

gpm_adviser:

PROCESS LOOP PRINT proc_cpu_total_util, proc_mem_res, proc_io_byte_rate

Thanks again.
Dave Jadischke
Occasional Advisor

Re: Need help with Glance Scripting

Here is the output file.
Mladen Despic
Honored Contributor

Re: Need help with Glance Scripting

Dave,

Because you are using "process loop", glance will loop through all current processes on your system and output the metrics that you specify for each individual process. That would be one "iteration." You probably had 217 processes running on your system when glance was executed (217+217=434 lines of output after 2 iterations)

What are you trying to accomplish?
Can you just use metrics like GBL_CPU_TOTAL_UTIL and GBL_MEM_UTIL ?
Dave Jadischke
Occasional Advisor

Re: Need help with Glance Scripting

What can I use instead of PROCESS LOOP?
Mladen Despic
Honored Contributor

Re: Need help with Glance Scripting

Dave,

What do you want your script to do?

If your goal is simple, e.g., display total cpu utilization on your system every minute, you will probably find GBL_xxx_xxx metrics sufficient. But if, for example, you would like to log cpu utilization by top two processes every 30 seconds, then you can modify your process loop to display just what you want.

Mladen