This documentation supports the 11.2 version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.

Changes to Discovery commands

The following sections show the discovery command changes between BMC Discovery versions.

The following changes are not shown:

  • Entirely new discovery platforms
  • Changes to comments only
  • Commands which have been removed and not replaced
  • Changes to echo only statements

Discovery command changes from 11.1 to 11.2

 Click here to show the discovery command changes from 11.1 to 11.2

Solaris

getHostInfo

The following code:

if [ $os_ver -ge 11 ]; then
     pkg list -H --no-refresh system/kernel | awk '{print "kernel:", $2; exit}'
else
    showrev 2>/dev/null | nawk -F: '/^Kernel version/ {gsub("^ *", "", $2); print "kernel:", $2; exit}'
fi
echo 'model:' `uname -i 2>/dev/null`
/usr/sbin/prtconf 2>/dev/null | nawk '/^Memory size:/ {print "ram: " $3 "MB"}'

is replaced with:

if [ $os_ver -ge 11 ]; then
     pkg list -H --no-refresh system/kernel | awk '{print "kernel:", $(NF-1); exit}'
else
    showrev 2>/dev/null | nawk -F: '/^Kernel version/ {gsub("^ *", "", $2); print "kernel:", $2; exit}'
fi
echo 'model:' `uname -i 2>/dev/null`

echo 'begin prtconf:'
/usr/sbin/prtconf 2>/dev/null | egrep "System Configuration:|Memory size:"
echo 'end prtconf'

getProcessList: ps: cmd changed:

The following code:

if [ $os_ver -ge 10 -a  -x /usr/bin/zonename ]; then
    zone=`/usr/bin/zonename 2>/dev/null`
    ps -eo pid,ppid,uid,user,zone,args 2>/dev/null | nawk "\$5~/^($zone|ZONE)$/ {print}"
else
    ps -eo pid,ppid,uid,user,args 2>/dev/null
fi
if [ $os_ver -ge 11 ]; then
    PRIV_PS /usr/bin/ps axww 2>/dev/null

is replaced with:

if [ $os_ver -ge 10 -a  -x /usr/bin/zonename ]; then
    zone=`/usr/bin/zonename 2>/dev/null`
    /usr/bin/ps -eo pid,ppid,uid,user,zone,args 2>/dev/null | nawk "\$5~/^($zone|ZONE)$/ {print}"
else
    /usr/bin/ps -eo pid,ppid,uid,user,args 2>/dev/null
fi
if [ $os_ver -ge 11 ]; then
    PRIV_PS /usr/bin/ps axww 2>/dev/null

getFileSystems

The following code:

    cat /etc/xtab
fi
echo end xtab:
echo begin smbclient:
smbclient -N -L localhost
echo end smbclient:

is replaced with:

    cat /etc/xtab
fi
echo end xtab:
echo begin sharetab:
if [ -r /etc/dfs/sharetab ]; then
    cat /etc/dfs/sharetab
fi
echo end sharetab:
echo begin smbclient:
smbclient -N -L localhost
echo end smbclient:

getNetworkConnectionList

The following code:

netstat -an -f inet 2>/dev/null | grep -v '^ *\*\.\*'
netstat -an -f inet6 2>/dev/null | grep -v '^ *\*\.\*'

is replaced with:

os_ver=`uname -r | cut -d. -f2`
if [ $os_ver -gt 11 -o \( $os_ver -eq 11 -a `uname -v | cut -d. -f2` -ge 2 \) ]; then
    netstat -anu -f inet 2>/dev/null | grep -v '^ *\*\.\*'
    netstat -anu -f inet6 2>/dev/null | grep -v '^ *\*\.\*'
else
    netstat -an -f inet 2>/dev/null | grep -v '^ *\*\.\*'
    netstat -an -f inet6 2>/dev/null | grep -v '^ *\*\.\*'
fi

Tru64

getProcessList

The following code:

ps -eo pid,ppid,uid,user,args 2>/dev/null

is replaced with:

ps -eo pid,ppid,uid,user,args 2>/dev/null | cat

VMware ESXi

initialise

The following code:

# replace the following PRIV_XXX functions with one that has the path to a
# program to run the commands as super user, e.g. sudo. For example
# PRIV_LSOF() {
#   /usr/bin/sudo "$@"
# }

# lsof requires superuser privileges to display information on processes
# other than those running as the current user
PRIV_LSOF() {
  "$@"
}

# This function supports running privileged commands from patterns
PRIV_RUNCMD() {

is replaced with:

# replace the following PRIV_XXX functions with one that has the path to a
# program to run the commands as super user, e.g. sudo. For example
# PRIV_CAT() {
#   /usr/bin/sudo cat "$@"
# }

# This function supports running privileged commands from patterns
PRIV_RUNCMD() {

Linux

getHostInfo

The following code:

if [ -d /sys/class/dmi/id ]; then
    echo "candidate_model[]: " `cat /sys/class/dmi/id/product_name 2>/dev/null`
    echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null`
    echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null`
    echo "candidate_vendor[]: " `cat /sys/class/dmi/id/sys_vendor 2>/dev/null`
fi

is replaced with:

if [ -d /sys/class/dmi/id ]; then
    model=`cat /sys/class/dmi/id/product_name 2>/dev/null`
    vendor=`cat /sys/class/dmi/id/sys_vendor 2>/dev/null`
    if [ -r /etc/system-release ]; then
        grep Amazon /etc/system-release >/dev/null 2>&1
        if [ $? -eq 0 ]; then
            model="Amazon Virtual Machine"
            vendor="Amazon"
        fi
    fi
    echo "candidate_model[]: " "$model"
    echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null`
    echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null`
    echo "candidate_vendor[]: " "$vendor"
fi

# Trying to get the Amazon EC2 instance ID, if any.
aws_instance_id=""
if [ -x /opt/aws/bin/ec2-metadata ]; then
    aws_instance_id=`/opt/aws/bin/ec2-metadata -i 2>/dev/null | awk '{print $2; }'`
fi
if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then
    # This web request is not chargeable.
# See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
    aws_instance_id=`curl http://instance-data/latest/meta-data/instance-id 2>/dev/null`
fi
if [ "$aws_instance_id" != "" ]; then
    echo "aws_instance_id: " "$aws_instance_id"
fi

getDeviceInfo

The following code:

    if [ "$os" = "(none)" ]; then
        os=""
    elif [ "$os" != "" ]; then
        # Check to see if its a variant of Red Hat
        rpm -q oracle-logos > /dev/null 2>&1
        if [ $? -eq 0 ]; then
            # Oracle variant
            os="Oracle $os"
        fi
    fi
fi

is replaced with:

    if [ "$os" = "(none)" ]; then
        os=""
    elif [ "$os" != "" ]; then
        if [ -f /etc/redhat-release ]; then
            # Check to see if its a variant of Red Hat
            # Early 4/5 version have /etc/enterprise-release without mentioning
            # Oracle in the name.
            if [ -f /etc/enterprise-release ]; then
                os="Oracle $os"
            elif [ -f /etc/oracle-release ]; then
                os=`cat /etc/oracle-release`
            fi
        fi
    fi
fi

The following code:

    # Check to see if its a variant of Red Hat
    rpm -q oracle-logos > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        # Oracle variant
    fi
fi

is replaced with:

    # Check to see if its a variant of Red Hat
    # Early 4/5 version have /etc/enterprise-release rather then
    # /etc/oracle-release without mentioning Oracle.
    if [ -f /etc/enterprise-release ]; then
        os="Oracle $os"
    elif [ -f /etc/oracle-release ]; then
        os=`cat /etc/oracle-release`
    fi
fi

The following code:

if [ "$os" = "" -a -r /etc/os-release ]; then
    # Use os-release for SuSE (if SuSE-release wasn't present, above)
    os_id=`grep ID= /etc/os-release | cut -f2 '-d"'`
    if [ "$os_id" = "" ]; then
        os_id=`grep ID= /etc/os-release | cut -f2 -d=`
    fi
    if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then
        os=`grep PRETTY_NAME /etc/os-release | cut -f2 '-d"'`
    fi
fi

is replaced with:

if [ "$os" = "" -a -r /etc/os-release ]; then
    # Use os-release for SuSE (if SuSE-release wasn't present, above)
    os_id=`egrep ^ID= /etc/os-release | cut -f2 '-d"'`
    if [ "$os_id" = "" ]; then
        os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=`
    fi
    if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then
        os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'`
    fi
fi
if [ "$os" = "" -a -r /etc/system-release ]; then
    os=`cat /etc/system-release`
fi

HPUX

getFileSystems

The following code:

fi
echo end xtab:
echo begin smbclient:
smbclient -N -L localhost
echo end smbclient:

is replaced with:

fi
echo end xtab:
echo begin sharetab:
if [ -r /etc/dfs/sharetab ]; then
    cat /etc/dfs/sharetab
fi
echo end sharetab:
echo begin smbclient:
smbclient -N -L localhost
echo end smbclient:

VMware ESX

getHostInfo

The following code:

if [ -d /sys/class/dmi/id ]; then
    echo "candidate_model[]: " `cat /sys/class/dmi/id/product_name 2>/dev/null`
    echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null`
    echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null`
    echo "candidate_vendor[]: " `cat /sys/class/dmi/id/sys_vendor 2>/dev/null`
fi

is replaced with:

if [ -d /sys/class/dmi/id ]; then
    model=`cat /sys/class/dmi/id/product_name 2>/dev/null`
    vendor=`cat /sys/class/dmi/id/sys_vendor 2>/dev/null`
    if [ -r /etc/system-release ]; then
        grep Amazon /etc/system-release >/dev/null 2>&1
        if [ $? -eq 0 ]; then
            model="Amazon Virtual Machine"
            vendor="Amazon"
        fi
    fi
    echo "candidate_model[]: " "$model"
    echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null`
    echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null`
    echo "candidate_vendor[]: " "$vendor"
fi

# Trying to get the Amazon EC2 instance ID, if any.
aws_instance_id=""
if [ -x /opt/aws/bin/ec2-metadata ]; then
    aws_instance_id=`/opt/aws/bin/ec2-metadata -i 2>/dev/null | awk '{print $2; }'`
fi
if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then
    # This web request is not chargeable.
# See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
    aws_instance_id=`curl http://instance-data/latest/meta-data/instance-id 2>/dev/null`
fi
if [ "$aws_instance_id" != "" ]; then
    echo "aws_instance_id: " "$aws_instance_id"
fi

getDeviceInfo

The following code:

    if [ "$os" = "(none)" ]; then
        os=""
    elif [ "$os" != "" ]; then
        # Check to see if its a variant of Red Hat
        rpm -q oracle-logos > /dev/null 2>&1
        if [ $? -eq 0 ]; then
            # Oracle variant
            os="Oracle $os"
        fi
    fi
fi

is replaced with:

    if [ "$os" = "(none)" ]; then
        os=""
    elif [ "$os" != "" ]; then
        if [ -f /etc/redhat-release ]; then
            # Check to see if its a variant of Red Hat
            # Early 4/5 version have /etc/enterprise-release without mentioning
            # Oracle in the name.
            if [ -f /etc/enterprise-release ]; then
                os="Oracle $os"
            elif [ -f /etc/oracle-release ]; then
                os=`cat /etc/oracle-release`
            fi
        fi
    fi
fi

The following code:

 
    # Check to see if its a variant of Red Hat
    rpm -q oracle-logos > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        # Oracle variant
    fi
fi

is replaced with:

    # Check to see if its a variant of Red Hat
    # Early 4/5 version have /etc/enterprise-release rather then
    # /etc/oracle-release without mentioning Oracle.
    if [ -f /etc/enterprise-release ]; then
        os="Oracle $os"
    elif [ -f /etc/oracle-release ]; then
        os=`cat /etc/oracle-release`
    fi
fi

The following code:

if [ "$os" = "" -a -r /etc/os-release ]; then
    # Use os-release for SuSE (if SuSE-release wasn't present, above)
    os_id=`grep ID= /etc/os-release | cut -f2 '-d"'`
    if [ "$os_id" = "" ]; then
        os_id=`grep ID= /etc/os-release | cut -f2 -d=`
    fi
    if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then
        os=`grep PRETTY_NAME /etc/os-release | cut -f2 '-d"'`
    fi
fi
if [ "$os" = "" ]; then
    os=`uname -sr 2>/dev/null`

is replaced with:

if [ "$os" = "" -a -r /etc/os-release ]; then
    # Use os-release for SuSE (if SuSE-release wasn't present, above)
    os_id=`egrep ^ID= /etc/os-release | cut -f2 '-d"'`
    if [ "$os_id" = "" ]; then
        os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=`
    fi
    if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then
        os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'`
    fi
fi
if [ "$os" = "" -a -r /etc/system-release ]; then
    os=`cat /etc/system-release`
fi
if [ "$os" = "" ]; then
    os=`uname -sr 2>/dev/null`

Discovery command changes from 11.0 to 11.1

 Click here to show the discovery command changes from 11.0 to 11.1



Solaris

getProcessList

The following code:

os_ver=`uname -r | cut -d. -f2`
if [ $os_ver -ge 10 -a  -x /usr/bin/zonename ]; then
    zone=`/usr/bin/zonename 2>/dev/null`
    ps -eo pid,ppid,uid,user,zone,args 2>/dev/null | awk "\$5~/^($zone|ZONE)$/ {print}"
else
    ps -eo pid,ppid,uid,user,args 2>/dev/null
fi

is replaced with:

os_ver=`uname -r | cut -d. -f2`
if [ $os_ver -ge 10 -a  -x /usr/bin/zonename ]; then
    zone=`/usr/bin/zonename 2>/dev/null`
    ps -eo pid,ppid,uid,user,zone,args 2>/dev/null | nawk "\$5~/^($zone|ZONE)$/ {print}"
else
    ps -eo pid,ppid,uid,user,args 2>/dev/null
fi

getDeviceInfo

The following code:

fi
echo 'domain:' `domainname 2>/dev/null`
if [ -r /etc/release ]; then
    if grep Update /etc/release; then
        echo 'os:' `head -1 /etc/release 2>/dev/null`',' `grep Update /etc/release 2>/dev/null`
    else
        echo 'os:' `head -1 /etc/release 2>/dev/null`
    fi
else
    echo 'os:' `uname -sr 2>/dev/null`
fi
echo 'os_arch:' `isainfo -k 2>/dev/null`

is replaced with:

fi
echo 'domain:' `domainname 2>/dev/null`
os=""
os_ver=`uname -r | cut -d. -f2`
if [ $os_ver -ge 11 ]; then
    os=`pkg info entire 2>/dev/null | grep "Version:" | awk 'NR > 1 {print $1}' RS='(' FS=')'`
    if [ "$os" = "" ]; then
        os=`pkg info entire | awk '/Branch:/ {print $2}' | nawk -F. '{printf "Oracle Solaris 11.%s.%s.%s.%s", $3, $4, $6, $7;}'`
    fi
fi
if [ "$os" = "" -a -r /etc/release ]; then
    os=`head -1 /etc/release 2>/dev/null`
    update=`grep Update /etc/release 2>/dev/null`
    if [ ! -z "$update" ]; then
        os="$os, $update"
    fi
fi
if [ "$os" = "" ]; then
    os=`uname -sr 2>/dev/null`
fi
echo 'os:' $os
echo 'os_arch:' `isainfo -k 2>/dev/null`

AIX

The PATH environment variable is changed from:

  • /bin:/usr/bin:/usr/sbin

to:

  • /etc:/bin:/usr/bin:/usr/sbin

getMACAddresses

The following code:

  if [ $status = "Available" ]; then
    echo Begin-interface: $adapter
    lscfg -vl $adapter 2>/dev/null
    echo $? > /dev/null # Prevent terminal issues
    echo End-interface: $adapter
  fi

is replaced with:

  if [ $status = "Available" ]; then
    echo Begin-interface: $adapter
    PRIV_LSCFG lscfg -vl $adapter 2>/dev/null
    echo $? > /dev/null # Prevent terminal issues
    echo End-interface: $adapter
  fi

getHostInfo

The following code:

# Get candidate serial using lscfg -vp in case the above commands do not return any serial value
lscfg -vp 2>/dev/null | grep -p "System VPD:" | grep "Cabinet Serial No" | sed -e 's/.*Serial No\.*\(.*\)/candidate_serial[]: \1/'
lsattr -E -l sys0 -a realmem 2>/dev/null | awk '{print "ram: " $2 "KB";}'
if [ -x /usr/sbin/hostid ]; then

is replaced with:

# Get candidate serial using lscfg -vp in case the above commands do not return any serial value
PRIV_LSCFG lscfg -vp 2>/dev/null | grep -p "System VPD:" | grep "Cabinet Serial No" | sed -e 's/.*Serial No\.*\(.*\)/candidate_serial[]: \1/'
lsattr -E -l sys0 -a realmem 2>/dev/null | awk '{print "ram: " $2 "KB";}'
if [ -x /usr/sbin/hostid ]; then

getNetworkInterfaces

The following code:

  if [ $status = "Available" ]; then
    echo Begin-interface: $adapter
    lscfg -vl $adapter 2>/dev/null
    echo $? > /dev/null # Prevent terminal issues
    echo End-interface: $adapter
  fi

is replaced with:

  if [ $status = "Available" ]; then
    echo Begin-interface: $adapter
    PRIV_LSCFG lscfg -vl $adapter 2>/dev/null
    echo $? > /dev/null # Prevent terminal issues
    echo End-interface: $adapter
  fi

initialise

The following code is added:

# VIO 2.x requires superuser privileges to run lscfg
PRIV_LSCFG() {
    vio_level=0
    if [ -r /usr/ios/cli/ios.level ]; then
        vio_level=`cat /usr/ios/cli/ios.level | cut -f1 -d.`
    fi

    if [ $vio_level -ge 2 ]; then
        # Need privilege elevation
        "$@"
    else
        "$@"
    fi
}

getHBAList

The following code:

    adapter_type=`echo $i | cut -f3 -d: | sed -e 's/,/./'`
    if [ $adapter_status = "Available" ]; then
        echo begin lscfg-vl-$adapter_name:
        lscfg -vl $adapter_name
        echo $? > /dev/null # Prevent terminal issues
        echo end lscfg-vl-$adapter_name:
        echo begin lslpp-$adapter_name:

is replaced with:

    adapter_type=`echo $i | cut -f3 -d: | sed -e 's/,/./'`
    if [ $adapter_status = "Available" ]; then
        echo begin lscfg-vl-$adapter_name:
        PRIV_LSCFG lscfg -vl $adapter_name
        echo $? > /dev/null # Prevent terminal issues
        echo end lscfg-vl-$adapter_name:
        echo begin lslpp-$adapter_name:

Mac OS X

getFileSystems

The following code is added:

echo begin diskutil-list-plist:
diskutil list -plist
echo end diskutil-list-plist:

POWER HMC

getHostInfo

The following code:

echo 'model:' `lshmc -v | grep '^\*TM' | cut -f2- -d' '`
echo 'serial:' `lshmc -v | grep '^\*SE' | cut -f2 -d' '`
echo bios_level: `lshmc -b | grep bios= | cut -f2 -d=`
monhmc -r mem -n 0 | cut -f1 -d, | sed -e 's/Mem/logical_ram/' -e 's/total//'

is replaced with:

echo 'model:' `lshmc -v | grep '^\*TM' | cut -f2- -d' '`
echo 'serial:' `lshmc -v | grep '^\*SE' | cut -f2 -d' '`
echo 'vendor:' `lshmc -v | grep '^\*MN' | cut -f2 -d' '`
echo bios_level: `lshmc -b | grep bios= | cut -f2 -d=`
monhmc -r mem -n 0 | cut -f1 -d, | sed -e 's/Mem/logical_ram/' -e 's/total//'

Linux

getDeviceInfo

The following code:

os=""
# SuSE lsb_release does not provide service pack so prefer SuSE-release file.
if [ "$os" = "" -a -r /etc/SuSE-release ]; then
    os=`cat /etc/SuSE-release`
fi
if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then

is replaced with:

os=""
# SuSE lsb_release does not provide service pack so prefer SuSE-release file
# However, this file is being deprecated so we will fallback to os-release
# (see below)
if [ "$os" = "" -a -r /etc/SuSE-release ]; then
    os=`cat /etc/SuSE-release | egrep -v '^#'`
fi
if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then

The following code is added:

if [ "$os" = "" -a -r /etc/os-release ]; then
    # Use os-release for SuSE (if SuSE-release wasn't present, above)
    os_id=`grep ID= /etc/os-release | cut -f2 '-d"'`
    if [ "$os_id" = "" ]; then
        os_id=`grep ID= /etc/os-release | cut -f2 -d=`
    fi
    if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then
        os=`grep PRETTY_NAME /etc/os-release | cut -f2 '-d"'`
    fi
fi

VMware ESX

getDeviceInfo

The following code:

os=""
# SuSE lsb_release does not provide service pack so prefer SuSE-release file.
if [ "$os" = "" -a -r /etc/SuSE-release ]; then
    os=`cat /etc/SuSE-release`
fi
if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then

is replaced with:

os=""
# SuSE lsb_release does not provide service pack so prefer SuSE-release file
# However, this file is being deprecated so we will fallback to os-release
# (see below)
if [ "$os" = "" -a -r /etc/SuSE-release ]; then
    os=`cat /etc/SuSE-release | egrep -v '^#'`
fi
if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then

The following code is added:

if [ "$os" = "" -a -r /etc/os-release ]; then
    # Use os-release for SuSE (if SuSE-release wasn't present, above)
    os_id=`grep ID= /etc/os-release | cut -f2 '-d"'`
    if [ "$os_id" = "" ]; then
        os_id=`grep ID= /etc/os-release | cut -f2 -d=`
    fi
    if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then
        os=`grep PRETTY_NAME /etc/os-release | cut -f2 '-d"'`
    fi
fi

  

Was this page helpful? Yes No Submitting... Thank you

Comments