Database Reference
In-Depth Information
This limitation of cumulative counters exists no matter what adapter you are using for your metric extensions.
So far we've focused on the SQL adapter, but let's look at other options.
OS Command Adapters
There are three OS Command adapters, and you may use them even more frequently than the SQL adapter. OS
Command adapters differ from one another only in whether they can collect multiple columns and multiple rows:
OS Command—Multiple Columns
OS Command—Single Column
OS Command—Multiple Values
All three OS Command adapters have three basic properties: Command , Script , and Arguments . The agent
basically executes the command line, concatenating these three properties. In fact, you can specify them all in a single
command property, so we're not sure why there are three properties, other than making properties more readable.
You can upload the script (or even multiple scripts, programs, and other required files) and then reference the
location of the uploaded files by using the %scriptsDir% substitution variable in any of the attributes—for example,
%scriptsDir%/myscript.sh for the Script property.
I strongly recommend using Perl scripts to ensure that your metric extensions are platform independent. Each
Oracle Management Agent comes with the same version of Perl, so you won't depend on what Perl version, if any, is
installed on the server. Just use %perlBin%/Perl in the command property, and it will be automatically substituted with
the location of the Perl binary installed with the Oracle Management Agent (usually <AGENT_HOME>Perl/bin/Perl ).
There are a couple of other ways to pass parameters other than on the command line. This is useful when you
want to avoid a long command line or avoid handling different escaping rules that are platform dependent as well
as to pass sensitive information such as credentials (because command-line arguments are easily visible to any user
on many platforms). One way to pass arguments is by using environment variables. An agent sets the environment
variable before calling the OS command, and the program or script can read that variable during executions. An
even better way of passing parameters is by using standard input that is then parsed by the program. Oracle refers to
that mechanism as input properties . The latter is the most secure way to pass credentials to the script, because even
environment variables for a process can be retrieved easily on some platforms.
For more details on environment variables and input properties, refer to the Oracle Enterprise Manager Cloud
Control 12c Administrator's Guide (Chapter 8, “Metric extensions,” section 8.4).
Note
OS Command adapters have two sets of credentials: host credentials and input credentials. Host credentials are
used to log in to the server running an agent for the target type. By default, an OS Command adapter uses default
monitoring credentials—the credential used to collect the pre-defined metrics of a target. However, you can choose
to create your own host credential sets and then set credentials for the targets where you plan to deploy your metric
extensions. For example, you might need to run your collection scripts as a special OS user (for example, ROOT
or another application user other than the one running the agent itself ). Note that the SQL adapter has the same
capability, so you can define a custom database credential set to run as a different database user than the default
monitoring user (for example, DBSNMP ).
Input credentials are the second type of credentials that can be defined. These credentials are totally
independent of host credentials and are passed to the program or script being executed using standard input just like
input properties. The advantage of input credentials is that you can set them independent of the metric extension
definition. If different targets require different credentials, users of the metric extension can easily define credentials
without the need to create a unique metric extension with various passwords hard-coded, which is what you would
need to do if using input properties for passing credentials.
 
 
Search WWH ::




Custom Search