Oracle Monitoring Subagent

From NetXMS Wiki
Jump to navigation Jump to search

Summary

NetXMS subagent for Oracle DBMS monitoring (further referred to as Oracle subagent) monitors one or more instances of Oracle databases and reports various database-related parameters.

All parameters available from Oracle subagent gathered or calculated once per minute thus its recommended to set DCI poll interval for these items to 60 seconds or more. All parameters are obtained or derived from the data available in Oracle's data dictionary tables and views through regular select queries. Oracle subagent does not monitor any of the metrics related to lower level database layers, such as database processes. Monitoring of such parameters can be achieved through the standard NetXMS functionality.

Configuration

Subagent can be configured using XML configuration file (usually created as separate file in configuration include directory), or in simplified INI format, usually in main agent configuration file.

XML configuration

There is a sample Oracle subagent configuration file in XML format:

<config>
	<agent>
		<subagent>oracle.nsm</subagent>
	</agent>
	<oracle>
		<databases>
			<database id="1">
				<id>DB1</id>
				<tnsname>TEST</tnsname>
				<username>NXMONITOR</username>
				<password>NXMONITOR</password>
			</database>
			<database id="2">
				<id>DB2</id>
				<tnsname>PROD</tnsname>
				<username>NETXMS</username>
				<password>PASSWORD</password>
			</database>
		</databases>
	</oracle>
</config>

You can specify multiple databases in the oracle section. Each database description must be surrounded by database tags with the id attribute. id can be any unique integer, it instructs the Oracle subagent about the order in which database sections will be processed.

Each database definition supports the following parameters:

Parameter Description Default value
Id Database identifier. It will be used to address this database in parameters. empty
TnsName Database TNS name. This is a name for Oracle connect string as described in tnsnames.ora. It can also be instant client connection string. empty
UserName User name for connecting to database. empty
Password Database user password. empty
EncryptedPassword Database user password encrypted with nxencpasswd. empty

INI configuration

There is a sample Oracle subagent configuration file in INI format:

SubAgent = oracle.nsm

*ORACLE
ID = DB1
TNSName = TEST
Username = NXMONITOR
Password = NXMONITOR

You can specify only one database when using INI configuration format. If you need to monitor multiple databases from same agent, you should use configuration file in XML format.

ORACLE section can contain the following parameters:

Parameter Description Default value
ID Database identifier. It will be used to address this database in parameters. empty
TNSName Database TNS name. This is a name for Oracle connect string as described in tnsnames.ora. It can also be instant client connection string. empty
Username User name for connecting to database. empty
Password Database user password. empty
EncryptedPassword Database user password encrypted with nxencpasswd. empty

Provided Parameters

The Oracle subagent declares and supports a number of Oracle.* DCI parameters. Almost all of them accept a database id (the one specified in “Id” tag in the subagent configuration file) as the only input parameter (with the exception of Oracle.TableSpaces.* which also take a tablespace name). The all supported DCIs are described below.

Parameter Argument(s) Data Type Description
Oracle.CriticalStats.AutoArchivingOff(*) Database ID Integer Archive logs enabled but auto archiving is off
Oracle.CriticalStats.DatafilesNeedMediaRecovery(*) Database ID Integer Number of data files that need media recovery
Oracle.CriticalStats.DFOffCount(*) Database ID Integer Number of offline data files
Oracle.CriticalStats.FailedJobs(*) Database ID Integer Number of failed jobs
Oracle.CriticalStats.FullSegmentsCount(*) Database ID Integer Number of segments that cannot extend
Oracle.CriticalStats.RBSegsNotOnlineCount(*) Database ID Integer Number of rollback segments not online
Oracle.CriticalStats.TSOffCount(*) Database ID Integer Number of offline tablespaces
Oracle.Cursors.Count(*) Database ID Integer Number of opened cursors (system-wide)
Oracle.DBInfo.IsReachable(*) Database ID String YES if the database is reachable, NO otherwise
Oracle.DBInfo.Name(*) Database ID String Database name
Oracle.DBInfo.CreateDate(*) Database ID String Database creation date
Oracle.DBInfo.LogMode(*) Database ID String Database log mode (e.g. noarchive)
Oracle.DBInfo.OpenMode(*) Database ID String Database open mode (e.g. read-only)
Oracle.Instance.ArchiverStatus(*) Database ID String Archiver status (e.g. stopped)
Oracle.Instance.ShutdownPending(*) Database ID String Indicates whether a shutdown action is pending at the moment
Oracle.Instance.Status(*) Database ID String Instance status (e.g. open, mounted)
Oracle.Instance.Version(*) Database ID String Version of Oracle DBMS
Oracle.Sessions.Count(*) Database ID Integer Number of sessions opened
Oracle.TableSpaces.Status(*) Database ID, Tablespace Name String Status for specific tablespace (e.g. offline)
Oracle.TableSpaces.Type(*) Database ID, Tablespace Name String Type for specific tablespace (e.g. temporary)
Oracle.TableSpaces.UsedPct(*) Database ID, Tablespace Name Integer Percentage of space used for specific tablespace


Oracle.Dual.ExcessRows(*)
Input Database id
Return type DCI_DT_INT64
Description Excessive rows in DUAL. The parameter returns 1 if there are more than 1 record in DUAL, 0 otherwise.
Oracle.Performance.PhysReads(*)
Input Database id
Return type DCI_DT_INT64
Description Number of physical reads
Oracle.Performance.LogicReads(*)
Input Database id
Return type DCI_DT_INT64
Description Number of logical reads
Oracle.Performance.CacheHitRatio(*)
Input Database id
Return type DCI_DT_STRING
Description Data buffer cache hit ratio
Oracle.Performance.LibCacheHitRatio(*)
Input Database id
Return type DCI_DT_STRING
Description Library cache hit ratio
Oracle.Performance.DictCacheHitRatio(*)
Input Database id
Return type DCI_DT_STRING
Description Dictionary cache hit ratio
Oracle.Performance.RollbackWaitRatio(*)
Input Database id
Return type DCI_DT_STRING
Description Rollback wait ratio. A percentage of delays during the access to rollback segments.
Oracle.Performance.MemorySortRatio(*)
Input Database id
Return type DCI_DT_STRING
Description PGA memory sort ratio. A percentage of sort operations performed in memory.
Oracle.Performance.DispatcherWorkload(*)
Input Database id
Return type DCI_DT_STRING
Description Dispatcher workload. A percentage of time dispatchers are busy.
Oracle.Performance.FreeSharedPool(*)
Input Database id
Return type DCI_DT_INT64
Description Free space in shared pool in bytes.
Oracle.Objects.InvalidCount(*)
Input Database id
Return type DCI_DT_INT64
Description Number of invalid objects in the database.

Oracle configuration

An Oracle user must have the role select_catalog_role assigned.

Required rights can be assigned to user with the following query:

grant select_catalog_role to user;

Where user is the user configured in Oracle subagent for database access.