Verifying an Instance Can Connect to OS Management Hub
Verify an instance can reach the OS Management Hub service to help troubleshoot connectivity and registration issues.
OCI instance
Oracle Linux
- Connect to the instance by using SSH.
-
Run the following:
curl -s -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/regionInfo > /tmp/curl.out REGION=`cat /tmp/curl.out | jq -r ".regionIdentifier"` ; export REGION DOMAIN=`cat /tmp/curl.out | jq -r ".realmDomainComponent"` ; export DOMAIN curl -s https://osmh.$REGION.oci.$DOMAIN &>/dev/null ; [ $? == 0 ] && echo "Success" || echo "Failure"
-
If the test reports 'Failure':
- Verify the VCN subnet used by your instances has an OCI service gateway.
- Review the Networking Requirements
Windows
- Connect to the instance.
-
Run the following command in PowerShell as an administrator.
Invoke-WebRequest -Headers @{'Authorization'='Bearer Oracle'} http://169.254.169.254/opc/v2/instance/regionInfo
-
Identify the domain and region from the response.
For example:
{ "realmDomainComponent": "oraclecloud.com", "realmKey": "oc1", "regionIdentifier": "us-ashburn-1", "regionKey": "IAD" }
-
The domain is
oraclecloud.com
-
The region is
us-ashburn-1
.
-
-
Construct the OS Management Hub endpoint.
https://osmh.<region>.oci.<domain>/
For example:
https://osmh.us-ashburn-1.oci.oraclecloud.com/
-
Test the connection to the endpoint
Invoke-WebRequest -TimeoutSec 3 <endpoint>
For example:
Invoke-WebRequest -TimeoutSec 3 https://osmh.us-ashburn-1.oci.oraclecloud.com/
-
Determine if the instance can reach OS Management Hub based on the response.
- Success
-
{"code" : "NotAuthorizedOrNotFound", "message" : "Authorization failed or requested resource not found."}
- Failure
-
Connection timed out after 3001 milliseconds
or
The remote name could not be resolved
-
If the test fails:
- Verify the VCN subnet used by your instances has an OCI service gateway.
- Review the Networking Requirements
On-premises or third-party cloud instance
Test the OCI endpoint connection
-
Determine your region. See Regions and Availability Domains.
For example:
us-ashburn-1
- Connect to the instance by using SSH.
-
Run the following:
curl -s https://osmh.<region>.oci.oraclecloud.com &>/dev/null ; [ $? == 0 ] && echo "Success" || echo "Failure"
For example:
curl -s https://osmh.us-ashburn-1.oci.oraclecloud.com &>/dev/null ; [ $? == 0 ] && echo "Success" || echo "Failure"
-
If the test reports 'Failure', it could mean:
- Management station used by the instance doesn't have connectivity to the internet or OCI (see Communication to OCI)
- Your network or firewall isn't allowing traffic to the OCI endpoint (see Communication to OCI)
Test the mirror and proxy ports
- Connect to the instance by using SSH.
-
Run the following:
STATION=`sudo grep GatewayServerHost /opt/oracle/mgmt_agent/agent_inst/config/emd.properties | awk -F"=" '{print $2}'` ; export STATION STATION_PROXY_PORT=`sudo grep GatewayServerPort /opt/oracle/mgmt_agent/agent_inst/config/emd.properties | awk -F"=" '{print $2}'` ; export STATION_PROXY_PORT STATION_MIRROR_PORT=`sudo grep baseurl /etc/yum.repos.d/osmh.repo | awk -F"/" '{print $3}' | awk -F":" '{print $2}' | uniq` ; export STATION_MIRROR_PORT echo -n "Probing $STATION proxy port $STATION_PROXY_PORT : " nc -zv $STATION $STATION_PROXY_PORT &>/dev/null ; [ $? == 0 ] && echo "Success" || echo "Failure" echo -n "Probing $STATION mirror port $STATION_MIRROR_PORT : " nc -zv $STATION $STATION_MIRROR_PORT &>/dev/null ; [ $? == 0 ] && echo "Success" || echo "Failure"
-
If the test reports 'Failure', it could mean:
- Ports aren't open on your network (see Internal Network Communication)
- Station isn't running Apache (check status with
systemctl status httpd
) - Station is offline (see Viewing Management Station Details)