File: gr_monitor.1

package info (click to toggle)
grmonitor 0.81-4.2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,556 kB
  • ctags: 1,767
  • sloc: ansic: 12,657; python: 186; makefile: 175
file content (424 lines) | stat: -rw-r--r-- 11,151 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
.TH gr_monitor 1 "Gr_Monitor" "MH" \" -*- nroff -*-
.SH NAME
gr_monitor \- 3D Process or Data Monitor V0.53
.SH SYNOPSIS
.B gr_monitor
[-t proc|free|rup|CMD]
[-host h]  
[-sleep n] 
[-noskip]
[-stdin]   
[-perrow n]
[-gap x]   
[-witdh n] 
[-height n]
[-geometry]
[-angle n] 
[-dolly n] 
[-zoom x]
[-zhorz x]
[-zvert x]
[-color]   
[-nolight] 
[-fog]     
[-onebuf]  
[-rotate]  
[-verbose]
[-v]

.br
.SH DESCRIPTION
.B Gr_Monitor 
displays a series of datasets as animated 3D bar charts.

By default gr_monitor displays information about processes resident on
a UNIX system.   For each process it displays a 3D bar graph of CPU
consumed, memory consumed, resident set size, and elapsed time. The
processes are grouped by username.   Each username grouping sits on its
own little plinth.

There are controls for translating, rotating, scaling, lighting and
fog effects.

Gr_monitor receives info via an input stream
and displays it in a X11 Mesa or X11 OpenGL window.  
The input is expected to be an XML document with a DTD that defines the
data to be plotted.

.BR Gr_gather (1)
is an implementation of a data gatherer.  It obtains data from the
Linux process file system and reformats it as a suitable XML document.  You can
run it stand alone and redirect its output to a file if you wish to record data
for later playback.

.BR Gr_free (1)
and 
.BR Gr_rup (1)
are implementations of data gatherers for disk/memory statistics
and local-host load averages.

The gr_monitor XML input requirements are easily understood and could be used
to display new kinds of data without any modification.

.SS OPTIONS
.TP
.I "-t proc|free|rup|CMD"
Gr_monitor will start up one of three possible data gathering sub processes.
Proc does process monitoring.  Free does disk and memory monitoring.
Rup monitors the load average on local hosts.
.TP
.I "-host hostname"
Gr_monitor will use rsh to fire up the gather process on another host.
Data will be piped back to the local host for display.
.TP
.I "-sleep seconds"
Time to sleep between updates.  The default is 5 seconds.
A sleep of 0 (zero) will cause gr_monitor to start up halted
(the space bar will single step the display).
By default gr_monitor will start a gather process and pass
it the same -sleep value.
.TP
.I "-noskip"
Normally data will be skipped if the renderer can't keep up
with it.  When playing back pre-recorded data via the -stdin option, 
you should switch off skipping.
.TP
.I "-stdin"
Take data in gather format from standard input.  Use this option if
you've writen your own gatherer, or if you want to play back a previously
recorded set of gather data.
.TP
.I "-perrow n"
If a row exceeds this many processes, a new row will be started.
.TP
.I "-gap x"
Space between plinths (a real number).
.TP
.I "-width n"
Display width in pixels.
.TP
.I "-height"
Display height in pixels.
.TP
.I "-geometry "
Normal X11 geometry spec.
.TP
.I "-angle n"
Tilt on X axis in degrees.
.TP
.I "-dolly n"
Distant to translate in the z axis (dolly the camera).
.TP
.I "-zoom x"
Projection zoom factor.
.TP
.I "-zhorz x"
Horizontal zoom factor.
.TP
.I "-zvert n"
Vertical zoom factor.
.TP
.I "-color"
Use own color map.  Colors will look better.  Worth a look.
.TP
.I "-nolight"
Turn off lighting effects.
.TP
.I "-fog"
Turn on fog effects.
.TP
.I "-onebuf"
Use single buffering of the display image.
.TP
.I "-rotate"
Start up rotating.
.TP
.I "-verbose"
or
.I "-v"
Provides some feedback to stderr.  Maximum output is generated
by -verbose.  Alternatively the -v option will only
report skipped data sets due to the monitor 
not being able to keep up with the gatherer, which is
useful when trying to select a good -sleep value.

.SH GR_MONITOR WINDOW

The following controls are available in the gr_monitor
window.  The middle mouse button will bring a keyboard quick reference.
The right mouse button will bring up another small menu duplicating
some of the keyboard functions.  When pressing keys beware of
excessive type-a-head (count your key presses).

Here is a summary of the keys and what they do:

.TP
.I "ESC"
Exits gr_monitor.

.TP
.I "?"
Dump a key summary on stdout.

.TP
.I "p/P"
Increase or decrease the items per row guideline by one (default 12).
Handy if you don't like the layout.

.TP
.I "a/A"
Zoom in or out.

.TP
.I "x/X y/Y z/Z"
Rotation about the specified axis.  
Lowercase +ve rotation.  Uppercase -ve rotation.

.TP
.I "i/I j/J k/K"
Translation along the specified axis (i,j,k implies x,y,z).

.TP
.I "r"
Toggles rotation. 

.TP
.I "0 1 2 3 4 5 6 7 8 9"
Selects a bar type.  Can only select from the first 10 bar types.

.TP
.I "s/S"
Scale selected bar type up or down.  Lowercase = up. Uppercase = down.

.TP
.I "n or N"
Scale selected bar type by 1.0 (i.e. reset scale).

.TP
.I "o or O"
Turn off selected bar type.

.TP
.I "l or L"
Toggle lighting. 

.TP
.I "f or F"
Toggle fog effects.

.TP
.I "h or H"
Halt the display.

.TP
.I "SPACE"
Step one frame through a halted display.

.SH ENVIRONMENT


.B GR_GATHER_COMMAND 
can contain an alternative command to run instead
of the default which is gr_gather.

.SH DATA FORMAT

The input data format is a XML document.  The DTD for the
XML document should contain a hierarchy of elements that conforms to
the following guidelines.  

The DTD should contain a 
.B datastream
element that contains a list of 
.B dataset 
elements that represent snapshots to be plotted.

Each dataset should contain a list of
.B group
elements that group the data by some major key, for example
userid.

Each group element should contain a list of
.B item
elements that group the data by some minor key, for example
process ID.

Datasets, groups and items must have
.B id
attributes.

In a given datastream, each item element must contain a number
of uniquely named data elements.  For example, an item might 
contain data elements called
.B cpu, 
.B rss,
and 
.B memory.  
And each of these data elements should have a 
.B data 
attribute that specifies a value to be plotted.
The date values should be a percentage value, i.e 1.0 to 100.00.
Items may have differing numbers of data elements.

Here is a sample document produced by gr_gather.  It uses an embedded
DTD (between the square brackets).

  <?xml version="1.0"?>
  <!DOCTYPE datastream [
  		<!ELEMENT datastream (dataset)*>
  		<!ELEMENT dataset (group)*>
  		<!ATTLIST dataset
  			id	CDATA	#REQUIRED>
  		<!ELEMENT group (item)*>
  		<!ATTLIST group
  			id	CDATA	#REQUIRED>
  		<!ELEMENT item (cpu, rss, mem)>
  		<!ATTLIST item
  			id	CDATA	#REQUIRED>
  		<!ELEMENT cpu EMPTY>
  		<!ATTLIST cpu
  			data	CDATA	#REQUIRED>
  		<!ELEMENT rss EMPTY>
  		<!ATTLIST rss
  			data	CDATA	#REQUIRED>
  		<!ELEMENT mem EMPTY>
  		<!ATTLIST mem
  			data	CDATA	#REQUIRED>
  ]>
  <datastream>
  
   <dataset id="viking1 Tue Nov  9 11:07:13 1999">
    <group id="bin">
     <item id="801">
      <cpu  data="0.0001"/>
      <rss  data="3.2584"/>
      <mem  data="3.2584"/>
     </item>
    </group>
    <group id="daemon">
     <item id="840">
      <cpu  data="0.0000"/>
      <rss  data="6.7496"/>
      <mem  data="6.7496"/>
     </item>
     <item id="866">
      <cpu  data="0.0000"/>
      <rss  data="4.4554"/>
      <mem  data="4.4554"/>
     </item>
    </group>
   </dataset>
  
   <dataset id="viking1 Tue Nov  9 11:07:18 1999">
    <group id="bin">
     <item id="801">
      <cpu  data="0.001"/>
      <rss  data="3.3584"/>
      <mem  data="3.5384"/>
     </item>
    </group>
   </dataset>
  
  <datastream>

Further examples can be obtained by viewing the stardard output from any of the
gather implementations.


.SH SEE ALSO

.BR top (1), 
.BR ps (1),
.BR gr_free (1),
.BR gr_gather (1),
.BR gr_rup (1)

.SH BUGS AND LIMITATIONS

Please send any bug reports to michael@actrix.gen.nz.

Gr_Monitor is very slow on a 
486 with a non-accelerated graphics card but OK on more modern systems.
It is fun to watch, especially on a
machine where processes or users are coming and going. It is very
useful for spotting hogs and uninhibited growth.

Gr_monitor is something I hacked together to learn more about OpenGL,
SGI's open standard for 2D/3D graphics. The whole thing was developed
under Linux using the Mesa OpenGL look-a-like library.

.SH AUTHOR
Michael Hamilton (michael@actrix.gen.nz)

.SH ACKNOWLEDGEMENTS

Brian Paul (brianp@ssec.wisc.edu) is the author of the The Mesa 3-D
graphics library.

XML parsing is handled by James Clark's (jjc@jclark.com) expat library.

Linux gr_gather is based on 
.B procps top 
by Branko Lankester, Roger Binns, and
Michael K. Johnson.

Gr_monitor is based on a cut up of the GLUT example/scube.c which
rotates a cube above a checker board with shadows, lighting etc.
Thanks to GLUT author Mark J. Kilgard (mjk@sgi.com), scube author
David G Yu.

.SH LICENCE

(c) Copyright 1999, Michael Hamilton, Gentoo South Pacific Limited.

Rights to this work are defined by the copyrights on the work on which it is
based.  Portions coded by myself are covered by the GNU GENERAL PUBLIC LICENCE.

Gr_gather is covered by the same licence as 
.B procps:
the GNU GENERAL PUBLIC LICENCE.

The expat library is covered by the Mozilla Public License Version 1.1
or the GNU GENERAL PUBLIC LICENSE.

For potions of gr_monitor you have the same rights as stated in the
original SGI copyright:

(c) Copyright 1993, 1994, Silicon Graphics, Inc.

ALL RIGHTS RESERVED 

Permission to use, copy, modify, and distribute this software for 
any purpose and without fee is hereby granted, provided that the above
copyright notice appear in all copies and that both the copyright notice
and this permission notice appear in supporting documentation, and that 
the name of Silicon Graphics, Inc. not be used in advertising
or publicity pertaining to distribution of the software without specific,
written prior permission. 

THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
 
US Government Users Restricted Rights 
Use, duplication, or disclosure by the Government is subject to
restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer Software
clause at DFARS 252.227-7013 and/or in similar or successor
clauses in the FAR or the DOD or NASA FAR Supplement.
Unpublished-- rights reserved under the copyright laws of the
United States.  Contractor/manufacturer is Silicon Graphics,
Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.

OpenGL(TM) is a trademark of Silicon Graphics, Inc.