Snow Inventory Oracle Middleware Scanner

Version 1.2

2021-09-01

Description

The Snow Inventory Oracle Middleware Scanner is a Java application and a component of Snow's Oracle Management Option. The scanner is platform-independent, which enables it to run on a variety of operating systems. As from version 1.1 the scanner collects data related to Oracle WebLogic Server version 11g and higher.

Note

The inventory data collected by the scanner reflects a snapshot of the Oracle middleware environment at the instant when the inventory scan is performed. 

The table below provides an overview of some of the Oracle concepts used in this document:

Table 8. Oracle conventions

Name 

Description

ORACLE_HOME

Contains the name of the directory where Oracle software is installed

oraInventory

A directory where information about Oracle software installed on the machine and their home locations is stored

Oracle Universal Installer

Preferred method for installing Oracle enterprise middleware applications

oraInst.loc

Contains information about the location of the oraInventory

orainstRoot.sh

Run after the installation of an Oracle application, it creates oraInst.loc and changes groupname of the oraInventory directory to oinstall group



Prerequisites

  • Dependency on other Snow products:

    The Snow Inventory Oracle Middleware Scanner component is triggered through a crontab job in Linux/Unix environments and by a PowerShell script for Windows.

    This component is dependent on Snow Inventory Agents version 6.0.0 or higher, and compatible with Snow Inventory Server 6.0.2 or higher.

  • Java runtime environment:

    Snow Inventory Oracle Middleware Scanner requires Java Runtime Environment 7 (1.7) or 8 (1.8) installed on the target computer. For improved performance, Snow recommends using Java Runtime Environment 8.

    Supported versions of Java Runtime Environments are Oracle Java SE and Oracle OpenJDK (versions 6, 7 and 8).

    Note

    The Java Runtime Environment (JRE) 1.7.0_07 contains a defect that causes Oracle inventory to fail. Any server running JRE 1.7.0_07 must be upgraded to a later version for the Snow Inventory Oracle scanner to function correctly.

  • Permissions and environment variables:

    The operating system user running the Snow Inventory Oracle Middleware Scanner needs the following permissions and environment variables, depending on the platform:

    Platform

    Permissions and environment variables

    Linux

    Must be a member of the operating system oinstall group.

    Must have write permissions to: /var/run/SnowSoftware/Inventory/Agent/script-output

    Must have sudo rights to the following operating system command, in order to automatically discover all running WebLogic instances on the current server: ps ewww [0-9]*

    The NOPASSWD option needs to be set in the sudoers file.

    Example 62.

    In the sudoers file for Linux, user snow has the rights to execute the command with sudo and no password:

    ##

    ## User privilege specification

    ##

    root ALL=(ALL) ALL

    snow ALL=NOPASSWD: /usr/bin/ps ewww [0-9]*



    Unix

    Must be a member of the operating system oinstall group.

    Must have write permissions to: /var/tmp/SnowSoftware/Inventory/Agent/script-output

    Must have sudo rights to the following operating system command, in order to automatically discover all running WebLogic instances on the current server:

    • Solaris: pargs -e [0-9]*

    • AIX: ps ewww [0-9]*

    The NOPASSWD option needs to be set in the sudoers file.

    Example 63.

    In the sudoers file for Solaris, user snow has the rights to execute the command with sudo and no password:

    ##

    ## User privilege specification

    ##

    root ALL=(ALL) ALL

    snow ALL=NOPASSWD: /usr/bin/pargs -e [0-9]*



    Example 64.

    In the sudoers file for AIX, user snow has the rights to execute the command with sudo and no password:

    ##

    ## User privilege specification

    ##

    root ALL=(ALL) ALL

    snow ALL=NOPASSWD: /usr/bin/ps ewww [0-9]*



    Windows

    Should run the component with an admin user account (Local Admin on the server).

Deployment

The Snow Inventory Oracle Middleware Scanner can be packaged and deployed separately, or together with Inventory Agents. Snow recommends you deploy this component using a Snow Inventory Agent installation package.

Files and locations scanned

The scanner requires read access to the following files:

  • oraInst.loc – where inventory_loc is stored. This file is stored where the WebLogic Server has been installed, i.e. the Oracle Home directory.

  • {inventory_loc}/ContentsXML/inventory.xml – where oracle_home(s) is(are) stored.

  • {oracle_home}/inventory/registry.xml – where component and featureset names and versions are stored.

  • {oracle_home}/inventory/Components/{component_name}/{component_version}/compDef.xml

  • {oracle_home}/inventory/featuresets/{featureset_name}_{featureset_version}.xml

  • {oracle_home}/inventory/ContentsXML/comps.xml

  • {oracle_home}/domain-registry.xml – where domain_loc is stored.

  • {domain_loc}/config/config.xml

Note

If more than one Oracle Home directory exists on a computer, and the default home directory does not contain an installation of WebLogic Server, the client needs to manually set the Oracle Home directory by using the -inv parameter when starting the scanner.

Automatic WebLogic inventory under Windows, Linux, and Unix

The Snow Inventory Middleware Scanner is designed to perform automatic WebLogic inventory under Windows, Linux, and Unix operating systems. The scanner automatically discovers all running WebLogic instances and identifies additional WebLogic home locations.

Output

The data retrieved by the Snow Inventory Oracle Middleware Scanner is stored in a snowpack file and placed in a designated location, depending on the platform: 

Platform

Output path

Linux

/var/run/SnowSoftware/Inventory/Agent/script-output/<script name>

Unix

/var/tmp/SnowSoftware/Inventory/Agent/script-output/<script name>

Windows

%ProgramData%/SnowSoftware/Inventory/Agent/script-output/<script name>

Snow Inventory Agents version 6 or higher search these designated locations for output from other Snow Inventory components such as Snow Inventory Oracle Scanner, or other scripts.

Install and configure Snow Inventory Oracle Middleware Scanner

Installation

The Snow Inventory Oracle Middleware Scanner is a component of Snow's Oracle Management Option. When requesting a Snow Inventory Agent deployment package, specify that the Oracle Middleware Option needs to be included.

If no options are provided when Oracle software is installed, the default location of oraInst.loc is:

  • Linux, AIX: /etc/oraInst.loc

  • Solaris: /var/opt/oracle/oraInst.loc

  • Windows: In registry HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/INST_LOC

Configuration

The Snow Inventory Oracle Middleware Scanner does not require a configuration file. Some configuration parameters can be executed at the command line level, which are outlined below.

Scheduling Linux/Unix

To schedule this component in a Linux or Unix environment, run the following crontab:

# run five minutes after midnight, every day

5 0 * * * $JAVA_HOME/bin/java -jar /opt/snow/SnowMiddlewareScanner.jar -loc <path to oraInst.loc>

# to output to middlewareoutput.json with verbose logging written to stderr and captured in snowmiddlewarescanner.log, run the following command:

$JAVA_HOME/bin/java -jar SnowMiddlewareScanner.jar -json -v 1>middlewareoutput.json 2>snowmiddlewarescanner.log

version

Print current version to stdout

Options:

-w

Set working directory

-v

Verbose logging

-loc

Path to oraInst.loc to override default location

-json

Output to console, as JSON

-inv

Path to Oracle inventory directory

-oraclehome

Path to Oracle/Middleware home directory

Note

The commands -loc and -inv are mutually exclusive (which means that they cannot be used together).

The -oraclehome command should be used for Weblogic 11g, because in that version, the inventory directory and the oralnst.loc file do not exist.

Scheduling Windows

To schedule this component in a Windows environment, run the  following command with any option to show what options are available

$java -jar snowmiddlewarescanner.jar help

Unknown arguments on the command line [help]

Help for SnowMiddleWareScanner

Usage: java -jar snowmiddlewarescanner.jar [options]

Commands:

version

Print current version to stdout

Options:

-w

Set working directory

-v

Verbose logging

-json

Output to console, as JSON

-inv

Path to Oracle inventory directory

-oraclehome

Path to Oracle/Middleware home directory

Example 65.

From the command line, run the following script to specify the location of oraInst.loc and the output file shall be saved in the default location:

$JAVA_HOME/bin/java -jar snowmiddlewarescanner.jar -inv  <path to Oracle inventory directory>



Note

The parameter -inv is optional. If more than one directory contain Oracle Product Installations and the default directory does not contain a WebLogic Server installation, the -inv parameter is used to point to the correct installation location of WebLogic Server.

The -oraclehome command should be used for Weblogic 11g, because in that version, the inventory directory and the oralnst.loc file do not exist.

Troubleshooting

If orainstRoot.sh fails when installing Oracle Inventory in a Unix/Linux environment, the file oraInst.loc will not be created. To resolve this issue, run the orainstRoot.sh executable as root, or run MiddlewareScanner.jar with the command line option -inv pointing to inventory location.