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
Comments