The Management Gateway is configured to accept traffic on a specific
port which is specified by using the GatewayPort property from the
gateway.properties file.
On Linux platforms, the gateway.properties
file is located under:
/opt/oracle/mgmt_agent/plugins/GatewayProxy/stateDir/config.
On Windows platforms, the gateway.properties file is located under: C:\Oracle\mgmt_agent\plugins\GatewayProxy\stateDir\config.
To change the Management Gateway port value, edit the
gateway.properties file and replace the current value of the
GatewayPort property with the desired port number.
After changing the gateway.properties file, the
Management Gateway service must be restarted.
For Oracle Linux 6, use: /sbin/initctl restart
mgmt_gateway
For Oracle Linux 7, use: systemctl restart
mgmt_gateway
For example, you can save the text file as cred.properties.
Add credentials using a text file.
For Linux, use:
gateway_credentials.sh -o upsertCredentials
For example, you can run the following on Linux using the cred.properties file:
cat cred.properties | sudo -u mgmt_agent sh /opt/oracle/mgmt_agent/plugins/GatewayProxy/stateDir/bin/gateway_credentials.sh -o upsertCredentials
For Windows, use:
gateway_credentials.bat -o upsertCredentials
For example, you can run the following on Windows using the cred.properties file::
type cred.properties | C:\Oracle\mgmt_agent\plugins\GatewayProxy\stateDir\bin\gateway_credentials.bat -o upsertCredentials
Delete the text file created in step 1.
The text file contains sensitive information. Customers are responsible for deleting
the credentials text file after completing the add or update credentials
operation.
Delete Credentials π
To delete credentials, use the gateway_credentials script with the deleteCredentials operation.
Linux:
The gateway_credentials.sh script is located in the /opt/oracle/mgmt_agent/plugins/GatewayProxy/stateDir/bin directory.
Syntax:
gateway_credentials.sh -o deleteCredentials
Example:
sudo -u mgmt_agent sh /opt/oracle/mgmt_agent/plugins/GatewayProxy/stateDir/bin/gateway_credentials.sh -o deleteCredentials
Windows:
The gateway_credentials.bat script is located in the C:\Oracle\mgmt_agent\plugins\GatewayProxy\stateDir\bin directory.
Deleting credentials does not delete the wallet that contained the
credentials.
Update Management Agents after
Changes to Management Gateway Configuration π
If the Management Gateway configuration changes, the Management Agent may
also have to be changed.
Gateway host: If the Gateway is moved to another host, or
if the Gateway host is renamed, then any Agents using the Gateway must be
changed to use the new hostname.
In this case, the Management Agent parameter
GatewayServerHost must be updated to use the new
Gateway.
Gateway port: If the Gateway port value changes, then any
Agents using the Gateway must be changed to use the new port value.
In this case, the Management Agent parameter
GatewayServerPort must be updated to use the new
Gateway port.
Gateway credentials: If the credentials required to
connect to the Management Gateway (such as username and password) are
changed, then any Agents using the Gateway must be changed to use the new
credentials. For information, see Credential Type for Management Gateways and Proxies and Add or Update Credentials.
Update Proxy Credentials for
Management Gateway π
You can update existing external proxy credentials for the Management
Gateway.
Prerequisites:
The Management Gateway should be configured with a proxy using the following
two properties:
ProxyHost
ProxyPort
For example:
ProxyHost=myproxy.example.com
ProxyPort=80
Step 1: Create request body for updating the proxy credentials
Provide the new username and password in credentials file using the
following properties:
ProxyUser: User name for authentication with the
proxy.
ProxyPassword: Password of the user for the
authentication with the proxy.
Note
The above credentials properties are case-sensitive.
See below sample-proxycreds.json sample credentials
file:
type sample-proxycreds.json | C:\oracle\mgmt_agent\agent_inst\bin\credential_mgmt.bat -o upsertCredentials -s Agent
Step 3 : Restart Management Gateway
For Linux:
sudo systemctl restart mgmt_gateway
For Windows:
net stop mgmt_gateway
net start mgmt_gateway
Note
The credentials are used by the
Management Gateway to communicate with Oracle Cloud Infrastructure services. Changing
its format or removing the credentials can have an adverse effect on the Management
Gateway's ability to communicate back to Oracle Cloud Infrastructure services.
Enable Batching for Management Gateway π
After installing Management Gateway, you can enable batching to provide better and quicker management of the logging uploads to the Logging Analytics service.
To enable batching, add the following property in the gateway.properties file:
BatchingEnabled=true
After updating the gateway.properties file, the Management Gateway service must be restarted. To restart it, run the following:
For Oracle Linux 6, use: /sbin/initctl restart mgmt_gateway
For Oracle Linux 7, use: systemctl restart mgmt_gateway
To upgrade the gateway, run the rpm command
with the upgrade option: rpm
-U.
sudo rpm -U <rpm_file_name.rpm>
Upgrade Management
Gateway on Linux using a Zip file
To upgrade an gateway on Linux using a Zip file, do the
following:
Download the latest version of the ZIP file
containing the gateway software download file, For details,
see Download Management Gateway Software
Navigate to the directory where you have downloaded the
management gateway software ZIP file and unzip it to any
preferred location.
To upgrade the gateway, run the installer.sh
script with the option:-u
installer.sh -u
The output looks similar to the
following:
sudo ./installer.sh -u
Checking pre-requisites
Checking available disk space for gateway upgrade
Checking agent version
Executing install
Unpacking software zip
Copying files to destination dir (/opt/oracle/mgmt_agent)
Updating communication wallet
Creating 'mgmt_gateway' daemon
Starting mgmt_gateway
Gateway Install Logs: /opt/oracle/mgmt_agent/installer-logs/installer.log
Gateway upgrade successful
Upgrade Management Gateway on Windows
To upgrade a gateway on Windows, do the following:
Log in as an Administrator user and open a command prompt window.
Navigate to the directory where you have downloaded the management agent software ZIP file and unzip it to any preferred location.
To upgrade the gateway, run the installer.bat script with the -u option:
installer.bat -u
For example: C:\Users\test_agent>installer.bat -u
The output looks similar to the following:
JAVA_HOME found at: C:\Program Files\Java\jdk1.8.0_321
Executing upgrade
Unpacking software zip
Copying files to destination dir (C:\Oracle\mgmt_agent)
Updating communication wallet
Creating mgmt_gateway service
Management Gateway upgrade successful
The Oracle Management Gateway service is starting....
The Oracle Management Gateway service was started successfully.
Remove Management Gateway π
When removing a Management Gateway from a host, the Management Gateway
is unregistered from the Management Agents Cloud Service before itβs removed from
the host.
To remove or uninstall Management Gateway from the following operating
systems, you can follow these steps:
Remove Management Gateway on Linux using
the RPM command
Execute the following rpm command with the -e
option:
sudo rpm -e <rpm_name>
Remove Management Gateway on
Linux using an uninstaller script
Execute the uninstaller.sh script if you installed the
Management Gateway using the ZIP files.
The output looks similar to the following:
$ sudo bash /opt/oracle/mgmt_agent/agent_inst/bin/uninstaller.sh
Executing pre-remove step from uninstall
Attempting to remove the Gateway from Management Agent Cloud service, please do not interrupt...
Attempting to remove the Gateway from Management Agent Cloud service,please do not interrupt...
Gateway was removed from Management Agent Cloud service successfully.
Detected Oracle Linux Server (Red Hat family):
Stopping mgmt_gateway...
Removing mgmt_gateway daemon from systemd...
Removed symlink /etc/systemd/system/multi-user.target.wants/mgmt_gateway.service.
Gateway was removed from the host successfully.
Executing post-remove step from uninstall
Gateway state directory was removed from the host successfully.
Note
If you installed the Management Gateway using an external volume on Linux, the Management
Gateway uninstaller script removes all the data under the
/opt/oracle/mgmt_agent directory, and on some operating
systems, also removes the target directory the symlink points to.
Remove Management Gateway on
Windows
Open a Command Prompt window, navigate to the Management Gateway install
base directory and execute the uninstaller.bat script.
The output looks similar to the following:
C:\Oracle>mgmt_agent\uninstaller.bat
Removing Management Gateway from the OCI service console.
Attempting to remove the agent from Management Agent Cloud service, do not interrupt...
Gateway was removed from the Management Agent Cloud service successfully.
Removing Management Gateway service from the host
Management Gateway service was removed from the host successfully
Removing Management Gateway directories
Ensure that all other command prompt windows are closed or that they are
not pointing to the Management Gateway home directory before running the
uninstaller.bat script.
Configure Management Gateway using Custom
Certificates π
To configure Management Gateway you can import custom certificates to
the OCI Certificate Service in the Oracle Cloud console. For more information, see Importing a Certificate.
In the Oracle Cloud console, open the Navigation menu and
select Identity & Security.
Go to Certificates, and select Certificates.
Click Create Certificate.
Select the Compartment, where you want to import the
certificate, it must be the same compartment where the Management Gateway is
installed.
To import a certificate that you plan to manage using a certificate
authority (CA), click Imported as the Certificate Type.
Enter a unique display name for the certificate. Avoid
entering confidential information.
Optionally, you can enter a description for the certificate.
You must enter a private key and the chain
certificate.
The certificate is ready to use when the
certificate status is Active in the Oracle Cloud console.
Next, you must copy the certificate OCID and then enter the OCID as
a parameter in Management Gateway response file during the Management Gateway
installation using the following format see, Configure a Response File for Management
Gateway.
Use a Non-default OS User to Install
Management Gateway π
Oracle recommends to perform the Management Gateway installation using the
default OS user: mgmt_agent, but depending on your requirements, you may
need to perform the installation using a different OS user.
This section describes how to install the Management Gateway using a different user
from mgmt_agent, the default OS user.
Prerequisites
Note
When choosing an OS user other than mgmt_agent to perform the
Management Gateway installation on Linux or Unix systems, the following
considerations need to be taken:
Select an OS user with limited privileges.
The default mgmt_agent OS user is a least privilege OS user with no login shell. If you decide to select another OS user instead, ensure the chosen user has limited privileges.
Management Gateway is a multi-threaded application and each thread (LWP) counts
towards the OS user limit. Ensure that the user limit
(ulimit) for max user processes is set
accordingly by checking:
ulimit -u
Choosing an inadequate limit can result in instability of
the Management Gateway and applications running as the OS user selected.
Identify a valid OS user to perform the Management Gateway installation and use it
as value for the RUN_AGENT_AS_USER variable.
Oracle recommends that the selected OS user should have least privileges
and no login
shell.
id -un <username>
Example 1:
id -un myexistinguser
The
myexistinguser OS user exists. The output returns the
value of the selected user and looks similar to the
following:
myexistinguser
Example 2:
id -un mytestuser2
The
mytestuser2 OS user doesn't exist and it's not a valid
user. The output returns no user value and looks similar to the
following:.
id: mytestuser2: no such user
Identify the user's primary group to use as value for the AGENT_USER_GROUP variable.
Ensure the value for AGENT_USER_GROUP is the primary user
group of the selected OS user.
Note
Using a secondary group
is not supported and it can result in a corruption of the Management
Gateway.
id -gn <username>
Example:
id -gn myexistinguser
The output looks similar to the following:
staff
Set Environment Variables and Install
Management Gateway
The above ensures the RUN_AGENT_AS_USER and AGENT_USER_GROUP environment variables are preserved and accessible by the root user.
After updating the /etc/sudoers file, set the environment variables again and verify root can access the environment variables.
Once the verification is complete, you can start the Management Gateway
installation: Log in as root, set the environment
variables, and then start the Management Gateway installation.
For example, follow the instructions from Install Management Gateway on Linux RPM file. In this case, skip step 1 since you are already
root and there's no need of sudo
privileges. Start at step 2: rpm -ivh
<rpm_file_name.rpm>