Deploying Oracle Management Cloud for Infrastructure monitoring Oracle Management Cloud database

Deploying Oracle Management Cloud for Infrastructure monitoring

It’s a bit hard to choose the right heading for this article. How do you call setting up Oracle Management Cloud (OMC) – a trial environment – to explore the possibilities for monitoring the infrastructure such as hosts, databases, middleware. You don’t have to install OMC – it’s already there –, nor to deploy OMC core-software in the on-premise environment. In fact the only thing that is to be done is installing a cloud agent on the on-premise environment, setting things up and you’re done. Or are you?  This post is about these steps to be taken to take advantage of the very promising Oracle Management Cloud as infrastructure monitoring tool.

My colleague Lucas Jellema already described the basic steps for application monitoring here, the initial steps for infrastructure monitoring works pretty much the same.

There are just 2 major prerequisites to start with Oracle Management Cloud: an account, ánd access to the OMC in the Oracle Cloud from the enttity to monitor– by proxy or directly.

What will this post cover is pretty much in line with the setup, described in the documentation :

image

 

1. Plan where the agents will be installed.

 

In my case I’ve got an Oracle Linux 7 host with Enterprise Manager 13c on it, and with a repository database 12c. I used this before to deploy Enterprise Manager agents in the cloud, so there is connectivity with Oracle Cloud. For a starter: I want to monitor this host, and the database on it.

 

2. Download the Oracle Management Cloud Master Installer.

 

From the dashboard from OMC / Infrastructure, you can  click directly to ‘Launch Infrastructure Monitoring Service’

image

 

When choosing setup the next page :

image

The next page is just informational / awareness. Gateway or Cloud Agent, there’s one zip file to download in the end:

image

And then download the zip-file – master installer.

Save the registration key for later use !

image

 

And then the last and the most challenging step.

3. Install the agent and setting it up.

The file is just a tiny file with no OMC software in it. Two ways to install: directly downloading and install, or in two steps: download-only and then install. Chose to go for the latter:

Beware: install the software by user Oracle!

First download: ./AgentInstall.sh AGENT_TYPE=cloud_agent AGENT_REGISTRATION_KEY=’RMxMm7chywi-J-VZ7_UfxY5XUU’ STAGE_LOCATION=/clagent -download_only

Install from this directory: ./AgentInstall.sh AGENT_TYPE=cloud_agent AGENT_REGISTRATION_KEY=’RMxMm7chywi-J-VZ7_UfxY5XUU’ AGENT_BASE_DIR=/omc_agent EM_AGENT_HOME=/u01/app/oracle/agent13c/agent_13.2.0.0.0 –staged

The parameter EM_AGENT_HOME is not mandatory, but I’d like to use it in a later experiment.

But while installing an error occurred:

Invalid EMSTATE valueError: The computed hostname :Host is not in the Fully Qualified Domain Name format

It appeared that the command ‘host <hostname>’ didn’t work at my host. In other words: DNS wasn’t well configured.

Solution: installed a local DNS with  dnsmasq:

yum -y install dnsmasq

systemctl enable dnsmasq

systemctl start dnsmasq

First line of /etc/resolv.conf: nameserver 127.0.0.1

Allright, next attempt, another error:

ERROR: The entity name: ovamisux159.amis.local:1830 is already registered with saas. Pass AGENT_PORT parameter with different agent port and retry the install.

Ahhh, port-conflict, because there’s an Enterprise Manager Agent on this host.

Emptying the directory /omc_agent and try again with another port:

./AgentInstall.sh AGENT_TYPE=cloud_agent AGENT_REGISTRATION_KEY=’RMxMm7chywi-J-VZ7_UfxY5XUU’ AGENT_BASE_DIR=/omc_agent EM_AGENT_HOME=/u01/app/oracle/agent13c/agent_13.2.0.0.0 AGENT_PORT=1832 –staged

Generating emaas.properties …

Extracting Agent Software …

Installing the Agent …

Registering the Agent …

Downloading Certificates …

Configuring the Agent …

Cleanup temporary files …

The following configuration scripts need to be executed as the root user

#!/bin/sh

#Root script to run

/omc_agent/core/1.12.0/root.sh

And … installed.

According to the the documentation you must be able to see this agent in the Oracle Management Cloud Agents – page. Yeah, took a bit time to find out where it is (but I’m a newby in this Cloud):

Through this button you will be directed to the ‘Set up Infrastructure Monitoring’ page.

image

In this page, in the upper right corner you will see this button.

image

And then you can choose ‘Agents’ .

image

Simple, right?

And the agent is shown at the agents page.

image

 

But now setting up the agent and monitor the database and host. What you need are a bunch of sample json-files which you can edit and apply it to OMC.

downloading the json files:

http://docs.oracle.com/en/cloud/paas/management-cloud/gfadg/downloading-and-customizing-infrastructure-monitoring-json-files.html

What shall we monitor, and what files do we need:

http://docs.oracle.com/en/cloud/paas/management-cloud/gfadg/adding-entities-infrastructure-monitoring.html

An extract:

image

Keep in mind: for monitoring, you need two types of JSON files that contain information about the entities to be monitored:

  1. An entity definition JSON file for each entity type you’re adding.
  2. A corresponding credentials JSON file for each entity you’re adding, if credentials are required to monitor this entity.

For now, I want to monitor the Linux node and the Oracle Database (named Cloudcontrol) on it, so I need for the database:

– omc_oracle_db_sample.json

– omc_oracle_db_sample_creds.json

And for the node:

… Hey, there’s no omc_host_linux file !

But this is included in ‘omc_add_multi_entities.json.

And in the ‘omc_add_multi_entities_creds.json is no example for omc_host_linux creds. Just have to guess how it should look like.

But while I’ve got no experience at all with json-files, it’s quite straightforward – even for me – to create and edit this files.

Adding database entity to my service through these json-files:

[oracle@ovamisux159 bin]$ /omc_agent/agent_inst/bin/omcli add_entity agent /omc_agent/omc_oracle_db_cloudcontrol.json -credential_file /omc_agent/omc_oracle_db_cloudcontrol_creds.json

Oracle Management Cloud Agent

Copyright (c) 1996, 2016 Oracle Corporation. All rights reserved.

Operation Succeeded: Accepted 1 of 1 entities for processing.

And is it succesful:

[oracle@ovamisux159 omc_agent]$ /omc_agent/agent_inst/bin/omcli status_entity agent /omc_agent/omc_oracle_db_cloudcontrol.json

Oracle Management Cloud Agent

Copyright (c) 1996, 2016 Oracle Corporation. All rights reserved.

omc_oracle_db.cloudcontrol : AGENT:entity fully monitored

Adding a linux host :

./omc_agent/agent_inst/bin/omcli add_entity agent /omc_agent/omc_host_ovamisux159_linux.json -credential_file /omc_agent/omc_host_ovamisux159_linux_creds.json

And we’re done.

And to show it’s really in OMC two pictures as proof. You can drill down a lot, but that’s for later.

image

image

There’s one last thing to do: enable the host monitoring. Monitoring of the hosts are default disabled apparently.

Following the note “Enabling Host Monitoring for the Infrastructure Monitoring Cloud Service (Doc ID 2195074.1)” changed the file /omc_agent/plugins/oracle.em.sgfm.zip/1.12.0/configs/discovery.properties. Deleted the # sign at the line with ‘omc_host_linux’.

Activate the changes by stopping and starting the agent:

./omcli stop agent

./omcli start agent

Sources:

OMC documenatation: http://docs.oracle.com/en/cloud/paas/management-cloud/emcad/setting-infrastructure-monitoring.html

First steps of Lucas: https://technology.amis.nl/2016/12/11/first-step-with-oracle-management-cloud-application-performance-monitoring-mandatory-for-devops/

JSON-files : http://docs.oracle.com/en/cloud/paas/management-cloud/gfadg/downloading-and-customizing-infrastructure-monitoring-json-files.html

What shall we monitor, and what files do we need: http://docs.oracle.com/en/cloud/paas/management-cloud/gfadg/adding-entities-infrastructure-monitoring.html