home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / ptdem3.zip / DATADICT.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  4KB  |  181 lines

  1. /***************************************/
  2. /* Pegasus Log Rexx Extension          */
  3. /* Version 1.0                         */
  4. /* (c) 1993,1994 C.O.L. Systems Inc.   */
  5. /* All Rights Reserved                 */
  6. /* Data Dictionary Proc Proc           */
  7. /*                                     */
  8. /* This proc shows how to build a      */
  9. /* reference of group metric counts,   */
  10. /* items to use in data reference and  */
  11. /* a small description of each item.   */
  12. /***************************************/
  13.  
  14. Parse Arg  SpecificGroup;
  15.  
  16. /************************/
  17. /* Load the extension   */
  18. /************************/
  19.  
  20. if RxFuncQuery('PegLoadFunctions') <> 0 then do
  21.    rcy = RxFuncAdd('PegLoadFunctions','PEGREXX','PegLoadFunctions')
  22.    if rcy = 0 then do
  23.       rcy = PegLoadFunctions()
  24.       if rcy > 0 then
  25.          signal BadLoad;
  26.       end;
  27.    else do
  28.       signal BadAdd;
  29.       end;
  30.    end;
  31.  
  32. /************************/
  33. /* Display title info   */
  34. /************************/
  35.  
  36. say;
  37. do count = 1 to 12
  38.    say   sourceline(count);
  39.    end;
  40.  
  41. /************************/
  42. /* If the user has input*/
  43. /* a particular metric  */
  44. /* group to display     */
  45. /************************/
  46.  
  47. if SpecificGroup <> '' then do
  48.    count = PegMetric(SpecificGroup);
  49.  
  50.    if count == 'UNKNOWN' then 
  51.       signal BadMetric;
  52.  
  53.    say ;
  54.    say 'Metrics for the 'SpecificGroup' group. Number of metrics = 'count;
  55.    say;
  56.  
  57.    do items = 1 to count
  58.       say   left(PegMetric(SpecificGroup,items),14)' ',
  59.             PegMetric(SpecificGroup,items,'D');
  60.       end;
  61.  
  62.    rcx = PegDropFunctions();
  63.    call RXFUNCDROP 'PEGLOADFUNCTIONS';
  64.    exit;
  65.    end  /* Do */
  66.  
  67. /* Here is the CPU group   */
  68.  
  69. count = PegMetric('CPU');
  70. say;
  71. say   'CPU metrics and descriptions. Number of metrics = 'count;
  72. say;
  73.  
  74. do items = 1 to count
  75.    say   left(PegMetric('CPU',items),14)' 'PegMetric('CPU',items,'D');
  76.    end;
  77.  
  78. /* Here is the Memory and Paging group   */
  79.  
  80. count = PegMetric('MEM');
  81. say;
  82. say   'Memory metrics and descriptions. Number of metrics = 'count;
  83. say;
  84.  
  85. do items = 1 to count
  86.    say   left(PegMetric('MEM',items),14)' 'PegMetric('MEM',items,'D');
  87.    end;
  88.  
  89. /* Here is the FAT Cache group   */
  90.  
  91. count = PegMetric('FC');
  92. say;
  93. say   'FAT Cache metrics and descriptions. Number of metrics = 'count;
  94. say;
  95.  
  96. do items = 1 to count
  97.    say   left(PegMetric('FC',items),14)' 'PegMetric('FC',items,'D');
  98.    end;
  99.  
  100. /* Here is the HPFS Cache group   */
  101.  
  102. count = PegMetric('HC');
  103. say;
  104. say   'HPFS Cache metrics and descriptions. Number of metrics = 'count;
  105. say;
  106.  
  107. do items = 1 to count
  108.    say   left(PegMetric('HC',items),14)' 'PegMetric('HC',items,'D');
  109.    end;
  110.  
  111. /* Here is the Physical Disk group   */
  112.  
  113. count = PegMetric('DSK');
  114. say;
  115. say   'Physical Disk metrics and descriptions. Number of metrics = 'count;
  116. say;
  117.  
  118. do items = 1 to count
  119.    say   left(PegMetric('DSK',items),14)' 'PegMetric('DSK',items,'D');
  120.    end;
  121.  
  122. /* Here is the Logical File group   */
  123.  
  124. count = PegMetric('FIL');
  125. say;
  126. say   'Logical File metrics and descriptions. Number of metrics = 'count;
  127. say;
  128.  
  129. do items = 1 to count
  130.    say   left(PegMetric('FIL',items),14)' 'PegMetric('FIL',items,'D');
  131.    end;
  132.  
  133. /* Here is the Thread group   */
  134.  
  135. count = PegMetric('THD');
  136. say;
  137. say   'Thread metrics and descriptions. Number of metrics = 'count;
  138. say;
  139.  
  140. do items = 1 to count
  141.    say   left(PegMetric('THD',items),14)' 'PegMetric('THD',items,'D');
  142.    end;
  143.  
  144. /* Release the extension   */
  145.  
  146. rcx = PegDropFunctions();
  147. call RXFUNCDROP 'PEGLOADFUNCTIONS';
  148.  
  149. exit;
  150.  
  151. /****************************************************/
  152. /*  Error in syntax occured somewhere here          */
  153. /****************************************************/
  154.  
  155. BadAdd:
  156.  
  157.    say   'Error Adding Pegasus Rexx Function Loader';
  158.  
  159. exit;
  160.  
  161. BadLoad:
  162.  
  163.    say   'Error Loading Pegasus Rexx Functions';
  164.  
  165. exit;
  166.  
  167. BadMetric:
  168.  
  169.    say;
  170.    say   'Invalid metric entered as argument';
  171.    say   'Valid metrics include:';
  172.    say   ;
  173.    say   '  cpu   dsk   thd   mem   fil   ';
  174.    say   '  fc    hc ';
  175.    say;
  176.  
  177.    rcx = PegDropFunctions();
  178.    call RXFUNCDROP 'PEGLOADFUNCTIONS';
  179.  
  180. exit;
  181.