Scope/iX Performance Graphs on the Web
Mission Possible, with Scope, Apache and Ploticus: the iX-Men Platoon
If you have Scope/iX and are trying to prepare its performance graphs on your HP e3000, you can make these graphs available on your intranet or over the Internet. This article describes how graphs out of the Scope data collection can be created out of an HTML form using the freeware Ploticus.
This article will demonstrate a pure HP e3000 way:
to prepare graphs based on Scopes performance data collection.
to view these graphs with any Internet browser like Explorer or Navigator.
If the Apache Web server is installed on your HP e3000, the advantage of such a solution is evident:
Everything happens on your HP e3000.
You can easily create 3000 performance graphs on-the-fly from a Web-based GUI.
To get graphs to the Web, there is no need for additional file manipulations or worse, printouts, as you have to do when using the obsolete (but still running on a lot of sites) HP LaserRX or NT MeasureWare.
Although this article contains some lengthy scripts, dont worry about re-keying them. All these and more can be downloaded from the Web at www.hillschmidt.de/ploticus/ Making it work is a matter of passing four hurdles, as shown below.
Hurdle One: Only MANAGER.SYS or SCOPE.SYS have access to the data the Scope collector prepares.
Its easy to pass this hurdle: Apache/iX may run under whatever user you want having the right configuration in place, and the execution of Ploticus/iX needs PH capability. Do the command :ALTUSER SCOPE.SYS;CAP=+PH to enable Ploticus in /usr/local/ploticus/bin/ for this user, and create a new group which will store the Apache part:
Now create the following subdirectories from the shell (SH.HPBIN.SYS):
> mkdir /conf
> mkdir /logs
/logs remains empty, and in /conf you need four files: access.conf, httpd.conf, mime.types, srm.conf. You may copy the files from your existing Apache/iX configuration. But you need to change at least the httpd.conf file for the Port. ServerAdmin and ServerName may stay as they are currently on your system, but the port must be different from 80, where the normal Apache server runs. Having done this, make sure that all files and directories are owned by SCOPE.SYS using the following shell commands
> cd /SYS/SCOPPLOT
> chown -R SCOPE.SYS *
As a last step to overcome this hurdle, create a new batch to start this new Web server. Such a job will look like;
!RUN HTTPD.PUB.APACHE;INFO=-f /SYS/SCOPPLOT/conf/httpd.conf
Having done this, you can run a Web Server for user SCOPE.SYS, who has access to Scopes data collection. The URL will be http://<server_name>:<port#>/ or as an example, http://alpha.hp.com:95/
Hurdle Two: How do I create performance graphs on the HPe3000?
To pass this hurdle you need to install Ploticus/iX, a freeware solution to paint graphic pictures of MPE data (see the NewsWire's September, 2000 article). Having done this, you will need for each graph two scripts: one to get the data out of Scopes data collection, and the second one to create the graph with Ploticus. An MPE command file is used to invoke EXTRACT.SCOPE.SYS using the first script. A shell script will be used to combine this MPE command with the Ploticus script as cgi used out of an HTML form.
The first script is an easy one: You need to create a report used within EXTRACT.SCOPE.SYS. Such a report could look like Figure 1, named GLOCPU:
PURGE R!HPPIN,TEMP > $NULL ECHO FORMAT ASCII > R!HPPIN ECHO HEADINGS OFF >> R!HPPIN ECHO SEPARATOR=" " >> R!HPPIN ECHO DATA TYPE GLOBAL >> R!HPPIN ECHO DATE >> R!HPPIN ECHO TIME >> R!HPPIN ECHO CPU_TOTAL >> R!HPPIN ECHO CPU_SESSION >> R!HPPIN ECHO CPU_JOB >> R!HPPIN ECHO CPU_SYSTEM >> R!HPPIN ECHO CPU_DISPATCH >> R!HPPIN ECHO CPU_ICS >> R!HPPIN ECHO CPU_MEMMGR >> R!HPPIN ECHO CPU_PAUSED >> R!HPPIN SAVE R!HPPIN
This report will create an ASCII list of the values which make the Global CPU Percentage.
The second script requires a bit of knowledge of Ploticus scripting language. To get a picture like LaserRXs Global CPU Utilization graph, your Ploticus script based on above ASCII data will look like Figure 2, named GLOCPUX.
#proc getdata command: cat /SYS/SCOPPLOT/XFERGSUM filter: ##declare SJ ##set SJ = $arith(@@4+@@5) ##declare SJS ##set SJS = $arith(@@4+@@5+@@6) ##declare SJSO ##set SJSO = $arith(@@4+@@5+@@6+@@7+@@8+@@9) ##declare SJSOP ##set SJSOP = $arith(@@4+@@5+@@6+@@7+@@8+@@9+@@10) @@1.@@2 @@3 @@4 @@SJ @@SJS @@SJSO @@SJSOP #proc areadef title: Global CPU Util (%): Average per hour rectangle: 1 1 8 5 yrange: 0 100 xscaletype: datetime mm/dd/yy.hh:mm xaxis.stubs: inc 1 day xaxis.stubformat: Www xaxis.minorticinc: 1 hours xautorange: datafield=1 nearest=hour xaxis.stubdetails size=6 #proc xaxis stubs: inc 1 day stubformat: Mmmdd stubdetails: adjust=0,-0.14 size=6 #proc xaxis stubs: inc 4 hour stubformat: hh stubdetails: adjust=0,-0.28 size=6 #proc yaxis label: Percent of CPU utilized stubs: inc 20 minortics: yes minorticinc: 5 ticincrement: 10 grid: color=green #proc lineplot xfield: 1 yfield: 7 linedetails: color=teal width=0.3 fill: teal numbers: no legendlabel: Paused #proc lineplot xfield: 1 yfield: 6 linedetails: color=lightpurple width=0.3 fill: lightpurple numbers: no legendlabel: Other #proc lineplot xfield: 1 yfield: 5 linedetails: color=brightgreen width=0.3 fill: brightgreen numbers: no legendlabel: System #proc lineplot xfield: 1 yfield: 4 linedetails: color=brightblue width=0.3 fill: brightblue numbers: no legendlabel: Job #proc lineplot xfield: 1 yfield: 3 linedetails: color=red width=0.3 fill: red numbers: no legendlabel: Session #proc annotate location: 2 6.2 box: color=red width=1.0 backcolor: gray(0.8) text: Global CPU Utilization (%) #declare SYSNAME #declare DATE #set SYSNAME = $system(uname'-n) #set DATE = $system(date''+%Y/%m/%d') #proc annotate location: 5 6 box: color=black width=1.0 backcolor: gray(0.8) textdetails: size=18 text: @SYSNAME @DATE #proc legend location: max-6.5 max+0.5 format: singleline
Ploticus scripting language is easy if you understand the logic behind it. Each component of such a graph needs to become declared. And the official Ploticus Web page ( www.sgpr.net) offers a complete downloadable Web-based handbook which helps you learn the syntax.
The MPE command file to extract the data from Scope is in Figure 3 below, named GLOCISD.
PARM REP="GLOBOT" DAYS=1 LEVEL="S" FORMAT="gif" TARGETDIR="/APACHE" CONTINUE PURGE I!HPPIN > $NULL CONTINUE PURGE R!HPPIN > $NULL CONTINUE XEQ !REP CONTINUE PURGE I!HPPIN,TEMP > $NULL ECHO LOGFILE LOGGLOB.SCOPE.SYS > I!HPPIN ECHO REPORT R!HPPIN >> I!HPPIN IF "!LEVEL" = "S" THEN ECHO GLOBAL SUMMARY >> I!HPPIN ELSE ECHO GLOBAL DETAIL >> I!HPPIN ENDIF ECHO EXPORT >> I!HPPIN ECHO EXIT >> I!HPPIN SAVE I!HPPIN SETJCW RXKEY=3 EXTRACT.SCOPE.SYS;PARM=!DAYS < I!HPPIN > $NULL IF "!LEVEL" <> "S" THEN CONTINUE PURGE XFERGSUM > $NULL RENAME XFERGLOB,XFERGSUM ENDIF
Using this command file as :GLOCISD GLOCPU 15 S will extract the data out of Scope using the report GLOCPU in SUMMARY level for 15 days.
And how to create the graph? This will be done by the shell script in Figure 4, named scopplot.sh.
This script is already prepared to use out of an HTML form. But you see that GLOCISD is used, and finally Ploticus is invoked.
Hurdle Three: How to get this graph out of a Web browser ?
The final step is the easiest one: Create an HTML form to execute the script shown above to create the graphs on-the-fly. This form should ask for
Report type (e.g. Global CPU Utilization)
Number of Days to report
Detail or Summary Level
Format of the graph (.gif or .png).
If you name this HTML form index.html, you simply invoke the URL http://alpha.hp.com:95/ to see this form. In my example I use a framed version (see the screen shot at www.hillschmidt.de/ploticus/pract008exam.htm)
You are ready: Performance graphs based on Scopes Data Collection can be requested from an HTML form and are created on-the-fly on your HP e3000. No need to start any specific task by logging on as SCOPE.SYS, no need to export data to an NT WS, no need to perform any additonal step just use a Web-based GUI.
Hurdle Four: I dont have time to learn Ploticus to create such scripts.
As I said in the beginning: www.hillschmidt.de/ploticus/ offers (for free, of course) all youll need to accomplish this setup: the programs, a lot of examples, and a complete bundle to install this example of interactive graph creation from Scope. If you have already installed Ploticus, you may want to go directly to www.hillschmidt.de/ploticus/ pract008.htm to download this archive.
Its obvious that such an approach could be used for other performance data collection tools not having a Web Interface. Its also only a matter of a little more time to create not only the Global graphs, but also the Application or Disc graphs from Scope data but I currently do not have this time.
If you have your own Ploticus solutions in place, Ill be glad to hear about them and perhaps add them to my site to demonstrate the power of this iX-Men mutant Ploticus.
Andreas Schmidt is a Computer Technology Specialist working for Computer Sciences Corporation, Bad Homburg, Germany.