Intro
-----
The periodic checker installer script installs an entry in the "cron"
subsystem (periodic scheduler subsystem) for the monitor script.

The periodic checker script will be ran through the "cron" subsystem (periodic
scheduler subsystem). The script calls a series of sub-scripts that will monitor different aspects of a
running system. 
The monitor script is not meant to be ran through the command line,
even though that is possible. Test results are sent to the syslog subsystem
and are logged in the file /var/log/messages

Syntax
------
setup-monitor.sh -a [install|uninstall] -i [30m|1h|12h|24h]
        un/install monitor script cron jobs
	-a: action (install/uninstall)
	-i: check interval

monitor.sh -a -v -d [TEST NAME] ...
	[TEST NAME]: one or more names of tests, taken from the "tests"
	subdirectory. A test name is the tests file name, without the leading number and
	trailing .sh. Example: "01db_space.sh" will be called "db_space".
	-a: run all tests
	-v: verbose results. log successful test.
	-d: print results to screen. By default results are sent to syslog.

Example
-------
setup-monitor.sh examples:
	$ ./setup-monitor.sh -a install -i 30m
	cron installed successfully

	$ ./setup-monitor.sh -a uninstall
	cron uninstalled successfully

monitor.sh example:

	Running all tests:
	$ ./monitor.sh -d -a
	Test: 01db_space.sh. Status: PASS. Message: db apricot has 1532 free
	blocks
	Test: 02cm_is_up.sh. Status: FAIL. Message: cm process is not running

	Running a single test:
	$ ./monitor.sh -d db_space
	Test: 01db_space.sh. Status: PASS. Message: db apricot has 1532 free
	blocks

Overview
--------
The setup-monitor script uses the cron periodic scheduler to install a job that
will be ran every 30 minutes, 1 hour, 12 hours or 24 hours (Configurable by
user).

The monitor script will be ran every set period of time, as determined while
running the setup-monitor script.

The scripts main function is to verify that the tests selected exist and run
them.

Test names are expected to exist as files in the "tests" sub-directory. When
calling a test called "db_space" the script expects to find a file called
"NNdb_space.sh", where NN is a number which denotes the scripts overall
priority. Example: the test "db_space" will be mapped to the file
01db_space.sh

Any sub-script or test that is run is expected to return a result in the
following format:
	STATUS: Message
Where:
	STATUS = [PASS|FAIL]
	Message = Test status message. Should be short and informative
	Example:
	FAIL: db "apricot" has only 1523 free blocks

Current Tests
-------------
1. db_up - Checks that Sybase us running.
2. cm_up - Check the CM Application is running.
3. free_db - Check that the database has 10% or more free space.
4. free_log - Check that the database log has 70% or more free space.
5. cm_persistent_buffers - Check the CM Adapters persistent buffers are not too full (>500 files)
