W-ASH : Web Enabled ASH
I’m excited about the ease of creating rich user applications that are web enabled given the state of technology now. JavaScript and JQuery have gone from being disdained as “not a very serious” language to moving towards the limelight of front and center.
Here is a small example.
Download the following file: W-ASH (web enabled ASH, file is wash.tar.gz )
Source is also on github at https://github.com/khailey/wash
Go to your apache web server root, in my case on redhat Linux is
# cd /usr/local/apache2 # gzip -d wash.tar.gz # tar xvf wash.tar -rwxr-xr-x 21956 14:08:21 cash.sh -rw-r--r-- 30881 11:52:10 htdocs/ash.html drwxr-xr-x 0 15:40:52 htdocs/js/ -rwxr-xr-x 10958 14:04:42 cgi-bin/json_ash.sh
(the directory htdocs/js has a number of files put into it from Highcharts. I edited them out to make the output cleaner)
There are 3 basic files
- cash.sh – collect ASH like data from Oracle into a flat file, it runs in a continual loop
- ash.html – basic web page using Highcharts
- json_ash.sh – cgi to read ASH like data and give it to the web page via JSON
Now you are almost ready to go. You just need to start the data collection with “cash.sh” (collect ASH)
./cash.sh Usage: usage <username> <password> <host> [sid] [port]
The script “cash.sh” requires “sqlplus” be in the path and that is all. It’s probably easiest to
- move/copy cash.sh to an ORACLE_HOME/bin
- su oracle
- kick it off as in:
nohup cash.sh system change_on_install 172.16.100.250 orcl &
The script “cash.sh” will create a directory in /tmp/MONITOR/day_of_the_week for each day of the week, clearing out any old files, so there are only maximum 7 days of data. (to stop the collection run “rm /tmp/MONITOR/clean/*end” )
To view the data go to your web server address and add “ash.html?q=machine:sid”
For example my web server is on 172.16.100.250
The database I am monitoring is on host 172.16.100.250 with Oracle SID “orcl”
http://172.16.100.250/ash.html?q=172.16.100.250:orcl
See video at : http://screencast.com/t/sZrFxZkTrmn
Trackbacks
Comments
I have tried your script,
But it not display data on web browser, its just display ash.html page.
Even though I got data in
[oracle@localhost:fwlive]$ cat 192.168.56.101\:fwlive\:ash.dat
201141,1320523901,1,152_254,SYS,,,USER,log_file_sync,Commit
201141,1320523901,1,166_1,LGWR,,0,BACKGROUND,log_file_parallel_write,System_I/O
203845,1320525525,1,152_310,SYS,,,USER,log_file_sync,Commit
203845,1320525525,1,166_1,LGWR,,0,BACKGROUND,log_file_parallel_write,System_I/O
Are you able to help me in this case.
Thanks
Hemesh.
@Hemesh
You can look at the raw data with the cgi script.
For example, my ash page is
http://172.16.100.250/ash.html?q=172.16.100.250:orcl
if I replace “ash.html” with “cgi-bin/json_ash.sh” as in
http://172.16.100.250/cgi-bin/json_ash.sh?q=172.16.100.250:orcl
I will get the browser page full of json data as in:
can you try this out an send me the output?
Hello,
I try W-ASH and I have empty page too.
Is not W-ASH only for Enterprise edition with Diagnostic Pack ?
I have Standart edition only.
json_ash : {“Administrative”:[0,0,0][4999,0],,”Application”:[0,0,0][4999,0],,”Cluster”:[0,0,0][4999,0],,”Commit”:[0,0,0][4999,0],,”Concurrency”:[0,0,0][4999,0],,”Configuration”:[0,0,0][4999,0],,”Network”:[0,0,0][4999,0],,”Other”:[0,0,0][4999,0],,”Queueing”:[0,0,0][4999,0],,”Scheduler”:[0,0,0][4999,0],,”System_I/O”:[0,0,0][4999,0],,”User_I/O”:[0,0,0][4999,0],,”CPU”:[0,0,0][4999,0],,”evtnames”:[],”evt_adm”:[],”evt_app”:[],”evt_clu”:[],”evt_com”:[],”evt_cnc”:[],”evt_cnf”:[],”evt_net”:[],”evt_oth”:[],”evt_que”:[],”evt_sch”:[],”evt_sio”:[],”evt_uio”:[],”evt_cpu”:[],”sqlnames”:[],”sql_adm”:[],”sql_app”:[],”sql_clu”:[],”sql_com”:[],”sql_cnc”:[],”sql_cnf”:[],”sql_net”:[],”sql_oth”:[],”sql_que”:[],”sql_sch”:[],”sql_sio”:[],”sql_uio”:[],”sql_cpu”:[],”sesnames”:[],”ses_adm”:[],”ses_app”:[],”ses_clu”:[],”ses_com”:[],”ses_cnc”:[],”ses_cnf”:[],”ses_net”:[],”ses_oth”:[],”ses_que”:[],”ses_sch”:[],”ses_sio”:[],”ses_uio”:[],”ses_cpu”:[]}
Thanks
Libor
@Hemesh, @Libor
To look at the CGI output, I left out a parameter. The syntax is
?points=60&vdb=host:SID
for example, original URL is
http://172.16.101.234:81/ash.html?q=172.16.101.236:Vkyl2FE
and to see the CGI output is
http://172.16.101.234:81/cgi-bin/ash.sh?points=60&vdb=172.16.101.236:Vkyl2FE
you can also run the cgi at the command prompt as in
ash.sh 60 host:SID
in my case this would be
ash.sh 60 172.16.101.236:Vkyl2FE
Very cool, great looking and useful output and the footprint is minimal. I have been trying to build some tools for myself that are as close to cross platform as possible, right now I am using Java/Play Framework in dev mode as a lightweight app server but will have to check out these techniques at least for my *nix setups.