Operating System - HP-UX
1838648 Members
2678 Online
110128 Solutions
New Discussion

Re: Parsing glance outpout

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Parsing glance outpout

Hello everyone,

since it will take some time till I've got accustomed with the abundance of MWA alarm generation and configuration possibilties I for now need a quick and dirty way to retrieve system metrics.

As I have regular disk I/O bottlenecks on some of our servers/disk subsystems, I am interested in the a screen dump of the glance 'u' screen.

So far I've been parsing output from various sar invocations (e.g. -d), but think the midaemon's datalogs will be more suitable in the HP-UX world.

I tried this from a script, to dump disk I/O metrics:

/opt/perf/bin/glance -u -iterations 2 -adviser_off -f /tmp/glance_disk.txt >/dev/null 2>&1

But this isn't really satisfactory.
First it only dumps the 1st disk screen (we have too many disks to go on one screen).
Second the device names (i.e. HW paths) are chopped off because the EMC HW addresses are too long to fit the column width, which makes filesystem or LV distinction more cumbersome (ok I could well dump the 'i' screen, but this meant two invocations of glance)
Third the dumping to a file via the -f switch isn't really what I desire, since I need to further parse this dump.
Thus I would rather like to pipe it in a another command but this doesn't work although I tried "-f $(tty)" or even "-p $(tty)", or "-f -" etc. the usual Unix way.

Although parsing this dump wouldn't mean much, instead all I really need are the metrics

GBL_DISK_UTIL_PEAK
BYDISK_UTIL
GBL_DISK_SUBSYSTEM_QUEUE
BYDISK_REQUEST_QUEUE

But I'm not sure if you can put these in a file that you pass to glance through the -syntax option.
All I've seen in the global /var/opt/perf/adviser.syntax file were definitions of symptoms and alarms, but not a choice of metrics as in /var/opt/perf/reptall
I don't want to restart mwa with a new report file to this end.

Can anyone tell me how to extract what I need from a script in intervalls shorter than the 5 min. of /var/opt/perf/datafiles/log* that can be extracted by extract?

Regards
Ralph
Madness, thy name is system administration
6 REPLIES 6
David Totsch
Valued Contributor
Solution

Re: Parsing glance outpout

You are on the right track by putting glance into daemon mode. Go ahead and use adviser syntax to print out the metrics you want:

In a file (e.g. mysyntax) place the following adviser syntax:

DISK LOOP
{
PRINT GBL_STATDATE," ",GBL_STATTIME,BYDSK_DEVNAME,BYDSK_UTIL
}

Note that I have left out all of the separators to conserve space. Now run glance in daemon mode:

glance -adviser_only -syntax mysyntax > mysyntax.data

You may want to adjust the interval to your specifications (and available disk space).

You can make one syntax file, but you will wind up parsing the data out. Multiple instances of glance will impact your performance, but will allow you to place different data types into separate files.

-dlt-


hari jayaram_1
Frequent Advisor

Re: Parsing glance outpout

could you try using utility and extract commands they will give you information on metrics but am not sure if that is the kind of info you are looking for. You can execute these commands from command line and it was most helpful when I was meassuring system app performance.
Sridhar Bhaskarla
Honored Contributor

Re: Parsing glance outpout

Ralph,

Use "extract" command. It's real easy and it has got the Guide feature that will help you extract the metrics step by step.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: Parsing glance outpout

HI Ralph,

Try this way for short intervals.

Create any file ex /. metrics.def with the following contents

PRINT "DiskLogical", gbl_disk_logl_io
PRINT "DiskSystem", gbl_disk_system_io

(add as many you want)

Now run the command glance with syntax option

glance -j 1 -iterations 1 -adviser_only -syntax metric.def > glance.out

Now you can grep for only DiskLogical or DiskSystem from it.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
MANOJ SRIVASTAVA
Honored Contributor

Re: Parsing glance outpout

Hi Ralph,

Do u have perfview , if so then these o/p can be obtanied using pv easily.


Manoj Srivastava
Ralph Grothe
Honored Contributor

Re: Parsing glance outpout

Thanks to all,

David,
your hint was exactly what I was looking for.
Actually I didn't know the LOOP command of the adviser syntax, but found it after your hint by looking through the glance help screens of the adviser's submenus.
Now I can iterate over every device or even every process that i have defined in a parmfile.
The icing on the cake would only be a Perl interface to the MWA stuff, but I fear I will have to write one myself.

Many thanks...
Madness, thy name is system administration