Nagios plugin to check Oracle tablespace usage
----------------------------------------------
Hannu Kivimki / CSC - Scientific Computing Ltd.

Description:

    This Nagios plugin checks Oracle tablespace usage. It uses
    Oracle's sqlplus command to execute some SQL which calculates
    tablespace usage percentages for given Oracle SID and databases.
    
Installation:

    1. Copy check_oracle_tablespace.sh to NAGIOS_HOME/libexec
       and set file permissions (execute for Nagios user).

    2. Edit the script and fill in proper values for ORACLE_ORATAB,
       ORACLE_USER and ORACLE_PASS.

    3. Test plugin:

       # NAGIOS_HOME/libexec/check_oracle_tablespace.sh -h
       # NAGIOS_HOME/libexec/check_oracle_tablespace.sh -s <SID> -w 90 -c 95

    4. Configure Oracle tablespace checks in Nagios (and NRPE) settings.

Known bugs:
    
    Regular expressions for tablespace/database name (-d) are checked
    against a line consisting of database name, usage percentage and
    autoextensible status (YES/NO) with some whitespace between columns.
    To avoid mixing up autoextensible status with database names ending
    with letters 'YES' or 'NO' you would have to use something like
    -d 'YES\ *[0-9]' instead of -d 'YES$'. The former would select
    all databases ending with 'YES' (like 'GOODBYES' or 'VAN_NYES') and
    the latter all databases which have autoextension turned on.

Changes:

    Revision: 1.3
        - first revision published on Nagios Exchange (http://www.nagiosexchange.org)
        
    Revision: 1.4
        - added parameter '-a' for checking tablespace autoextension. If '-a'
          is used, autoextensible tablespaces will return only a warning
          even if critical threshold is exceeded.
    
    Revision: 1.5
        - slight modifications to '-a': 'AUTOEXT' is appended after each
          tablespace name in status text if they are autoextensible.

    Revision: 1.6
        - fixed a bug in one of the if conditions
        
    Revision 1.7
        - fixed tablespace percentage column width in SQL (was
          unable to show 100% full tablespace)
