These sample scripts allow an argus user to query a remote/local Oracle
database, and get some basic information back.

Have a look at the examples to see what I've done.  Essentially you are
only limited by your imagination.

Note as this doesn't use perl DBI, it maybe easier to setup for DBA's who
have not had exposure to DBI, plus allows you to connect to any release of
Oracle, using techniques that Oracle DBA's/Developers are familar with.

Requirements
- Oracle Client Software on argus server
- TNSnames file or setup to access an Oracle Names Server
- {OPTIONAL} A user account in your Oracle database, that has rights
	to the information you wish to return.  I recommend that you don't use
	the 'system' or 'sys' accounts.
- Recommend that you set the Frequency to no less than 60 seconds and
	have re-tests set to at least 1.  Reason, you need to allow some extra
	time, as you are relying on an external Oracle DB that maybe busy, and
	therefore you might have a slightly longer delay in getting a response.

Programs

runsql.sh DB_SID SQL_FILE
	A wrapper to allow you to pass in the Oracle SID and your sql query.

	Why didn't I put the username/password here?  Simply to try and keep it 
	secure from people who may be looking for more details than you are
	willing to share.
	
	You need to adjust the script to supply a username and password.
	You will need to adjust the ORACLE_HOME, and ensure that
	SQLPATH points to the location of your sql scripts.

	Make sure that the script is executable for the user that
	runs argusd, and that it can use oracle.

db_up.sh DB_SID
	Simple script to see if the database is up or down.
	Returns 1 for up and 0 for down.

	You need to adjust the script to supply a username and password.
	You will need to adjust the ORACLE_HOME, and ensure that
	SQLPATH points to the location of your sql scripts.

SQL Examples
	session_count.sql		- Returns Number of current Oracle Sessions
	shared_pool_free.sql	- Returns percentage of Shared PooL Memory that is free
	user_count.sql			- Returns the number of unique user connections

ARGUS Example

Group "Oracle"
{
	Host "somebox" {
		Service Prog {
					label: users
					uname:  user
					command: /oracle_monitor/runsql.sh DB_BEE1 user_count.sql
					graph:  yes
					title:  DB_BEE1 - User Count
					ylabel: Users
					xlabel: Time
					drawgrid:   yes
					gr_range:   0-20
					whichgraphs: 1
				}
		}
}

Who am I?

I'm Joe McKinnon, I work for an organisation where we use Oracle, Progress and Sun Solaris. 

We have just started to use Argus, and we are slowly expanding it to monitor a lot
of different items.  This little example rew from someone's query to see how
many users are on different databases to many other stats, that we would normally
make monthly reports on.  Now people can see at a glance what is happening
without having to have any special skills.

email: Joe.McKinnon@member.sage-au.org.au.

