Enterprise Manager Generic (MOSC)

MOSC Banner

Metric Extension - Host command with an if statement

edited Sep 20, 2013 6:13AM in Enterprise Manager Generic (MOSC) 6 commentsAnswered ✓
 I'm trying to create a Metric Extension to test for the installation of a product on each host target. 
There are five input lines on the Adapter page:
  Command
  Script
  Arguments
  Delimiter
  Starts With

Syntax when run in a shell script looks like this:

if [ -d /etc/something ]; then 
  echo "Yes" 
else 
  echo "No" 
fi

Host metric extension wizard allows one line in the required Command field and 'if' statements like this don't work on one line.

Syntax like this works on one line on the command line:

[ /etc/something ] && echo "Yes"; [ ! /etc/something ] && echo "No";

But OEM complains that

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center