3.20 Listener

Use this Knowledge Script to monitor Oracle listeners running on the host. This script can attempt to connect to each Oracle database using the service name. If the local connection attempt fails, or the service name connection attempt fails, or if an error occurs while running the job, an event is generated.

If you enable the Restart listeners that are not running? parameter, you have three options to specify the listeners that should be restarted. If the databases where you plan to drop the script share a single listener, you can specify the Oracle Home where the listener resides and, optionally, the name of the listener in the script itself. If the name is not specified, the job will start the default listener in that Oracle Home.

NOTE:If you choose to have this script restart an Oracle listener that is not running, the UNIX account running the NetIQ UNIX agent must have write permissions on the $ORACLE_HOME/network/log folder if listener logging is enabled.

If the databases where you plan to drop the script use multiple listeners, you should specify this information in either a file that is created to identify the listeners that each $ORACLE_SID uses or in the default oratab file. If a file is created for this purpose, the path should be specified in the script, and it should have the following format:

$ORACLE_SID:LISTENER HOME:[LISTENER NAME]

where $ORACLE_SID is the name of the database instance, LISTENER HOME is the $ORACLE_HOME of the listener that should be restarted for this instance when no listener that can be used to connect to that instance is running, and LISTENER NAME is the name of this listener. It is not required to specify the name of the listener, as the default listener in the Oracle Home of the listener specified can be started, but if any text is presented in this column, it will be interpreted as a listener name.

Example: A Linux host has two $ORACLE_HOME directories, one of version 8.1.7 and one of version 9.2.0. This environment requires that each database use a listener of its own version. Thus, the following file is created for restarting the listeners:

Orasid817:/oracle/product/8.1.7
Orasid920:/oracle/product/9.2.0:lsnr_new

In this case, the default listener in $ORACLE_HOME/oracle/product/8.1.7 will be restarted when a listener is not running that knows about the Orasid817 database. For the Orasid920 database, the lsnr_new listener will be started from the version 9.2.0 Oracle Home.

If the path to a file containing listener information is not specified yet you have selected for listeners to be restarted, the script will use the default oratab file on the host to locate listener information. When this is the case, an entry in the $ORACLE_SID column labeled LSNR must exist, and the $ORACLE_HOME value for this identifier will be used to restart the default listener.

Example:

  • /etc/oratab file
  • #
  • # ORACLE_SID:$ORACLE_HOME:<N:Y>
  • #
  • Orasid817:/oracle/product/8.1.7:Y
  • LSNR:/oracle/product/9.2.0:N

In this example, the format of the oratab is maintained, and the third column does not specify a listener name. This is because when the oratab file is read for listener information, there will be no use of listener names. The default listener in the Oracle Home specified for the LSNR entry will always be restarted.

NOTE:This is an easy but restrictive way to specify the listener information. You should only use this option if you are running a single listener per host, yet are dropping a single job on multiple hosts where you can specify this type of information uniformly.

The account you use to run this script must have SELECT permissions for the following table:

V_$VERSION

3.20.1 Resource Objects

Oracle Database folders. When you drop a script on an Oracle Database folder, a job executes on that database and monitors only that database.

3.20.2 Default Schedule

The default interval for this script is Every 10 minutes.

3.20.3 Setting Parameter Values

Set the following parameters as needed:

Description

How to Set It

Oracle Username

Enter the username that this script needs to access the target databases. If you run this script on more than one database, configure each database with the same username. To use SYSDBA authentication, leave this parameter blank. The default is blank.

Collect data for success or failure of listener monitoring?

Select Yes to collect data for charts and reports, in percent. If data collection is enabled, returns the current status of the listener process based on number of connection to database. The default is unselected.

Location of tnsnames.ora (TNS_ADMIN)

Specify the directory that can be used to set the $TNS_ADMIN environment variable so that the tnsnames.ora file can be found during the connection attempt using the service name. This value can be a specific folder, or it can be relative to the $ORACLE_HOME for the respective database. If $ORACLE_HOME is specified as part of the path, the script substitutes the appropriate folder path for this variable at the time the job is executed. The default is: $ORACLE_HOME/network/admin.

Use password to execute lsnrctl utility

Select Yes to use a password to run the lsnrctl utility. If you choose to use a password, AppManager uses the PASSWORDS value from the listener.ora file in the $ORACLE_HOME/network/admin folder. The default is unselected.

Monitor Oracle background processes?

Select Yes to monitor Oracle background processes. The default is Yes.

Background processes to monitor (comma-separated, no spaces)

Enter the names of Oracle RDBMS background processes you want to monitor, separated by commas and no spaces. The default is PMON,LGWR,SMON,RECO.

Attempt a connection using service name?

Select Yes to attempt a connection using a service name (tnsnames alias). The default is unselected.

Service Name

Specify the service name you want to use for the connection attempt. By default, this name is usually the $ORACLE_SID value for the database. If $ORACLE_SID is specified as part of the name, the script substitutes the appropriate value for the respective database at the time the job is executed. In addition, domain names may be appended to $ORACLE_SID or the value specified (for example, $ORACLE_SID.netiq.eng). The default is $ORACLE_SID.

Number of databases per host to attempt a service connection

Select the number of databases per host for which a service connection should be attempted. Options include 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 50, or ALL. The default is ALL.

Restart listeners that are not running?

Select Yes to restart listeners or specified background process(es) that are not running. The default is unselected.

Number of attempts to restart a given listener

If you enabled the Restart listeners that are not running? parameter, enter the number of times the job should attempt to restart a listener that is not running before the job raises a failure event (see the Raise event if unable to restart a listener? parameter below). The default is 1.

Options for specifying listener(s) to restart

Enter values below for the following parameters if you enabled the Restart listeners that are not running? parameter. These parameters let you select listeners to restart if they are detected as not running.

Oracle Home of listener to restart

Enter the Oracle Home where the listener to be restarted resides. The default is blank.

Name of listener to restart

Enter the name of the listener to restart. If you do not enter a name here, the job attempts to restart the default listener. The default is blank.

Path to file with information on listener(s) to restart (leave blank to use oratab file)

Enter a full path and filename for a file containing the names and Oracle Homes of listeners that should be restarted if they are detected down. Use this parameter to restart multiple listeners.

If you do not enter a path and filename, the job uses the default oratab file for the Oracle Home listed above for the Oracle Home of listener parameter.

Raise event if listener or background process(es) not running?

Select Yes to raise an event when the listener or specified background processes are not running. The default is Yes.

Severity

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 5 (red event indicator).

Raise event with status of any restart attempt?

Select Yes to raise an event giving the status of any attempts to restart listeners that are not running. The default is Yes.

Severity

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 30 (magenta event indicator).

Raise event if connection attempts fail?

Select Yes to raise an event if the connection attempts fail. The default is Yes.

Severity

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 10 (red event indicator).

Raise event with status if listener running and connection(s) successful?

Select Yes to raise an event with uptime information when listener is running and the connection is successful. The default is unselected.

Severity

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 40 (magenta event indicator).

Event severity for internal failure

Set the event severity level, from 1 to 40, to indicate the importance of the event. The default is 5 (red event indicator).