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 22.1 to 22.2

VMware ESX

getHostInfo

The following code:

    $1 ~ /product:/ && !found_product { sub(".*product: *", ""); gsub("\"", ""); printf("candidate_model[]: %s\n", $0); found_product=1; }
    $1 ~ /serial:/ && !found_serial { sub(".*serial: *", ""); gsub("\"", ""); printf("candidate_serial[]: %s\n", $0); found_serial=1; } '
fi
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`

is replaced with:

    $1 ~ /product:/ && !found_product { sub(".*product: *", ""); gsub("\"", ""); printf("candidate_model[]: %s\n", $0); found_product=1; }
    $1 ~ /serial:/ && !found_serial { sub(".*serial: *", ""); gsub("\"", ""); printf("candidate_serial[]: %s\n", $0); found_serial=1; } '
fi

# model and serial information for Avamar Datastore physical nodes (after 19.3 it needs sudo)
AVSYSREPORT_CMD="/usr/local/avamar/bin/avsysreport"
if [ -x "$AVSYSREPORT_CMD" ]; then
    echo "model: "`PRIV_RUNCMD $AVSYSREPORT_CMD chassis-info | grep "Chassis" 2>/dev/null | cut -d " " -f4-`
    echo "serial: "`PRIV_RUNCMD $AVSYSREPORT_CMD chassis-info | grep "Serial" 2>/dev/null | cut -d " " -f4-`
fi

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`

Linux

getHostInfo

The following code:

 
    $1 ~ /product:/ && !found_product { sub(".*product: *", ""); gsub("\"", ""); printf("candidate_model[]: %s\n", $0); found_product=1; }
    $1 ~ /serial:/ && !found_serial { sub(".*serial: *", ""); gsub("\"", ""); printf("candidate_serial[]: %s\n", $0); found_serial=1; } '
fi
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`

is replaced with:

    $1 ~ /product:/ && !found_product { sub(".*product: *", ""); gsub("\"", ""); printf("candidate_model[]: %s\n", $0); found_product=1; }
    $1 ~ /serial:/ && !found_serial { sub(".*serial: *", ""); gsub("\"", ""); printf("candidate_serial[]: %s\n", $0); found_serial=1; } '
fi

# model and serial information for Avamar Datastore physical nodes (after 19.3 it needs sudo)
AVSYSREPORT_CMD="/usr/local/avamar/bin/avsysreport"
if [ -x "$AVSYSREPORT_CMD" ]; then
    echo "model: "`PRIV_RUNCMD $AVSYSREPORT_CMD chassis-info | grep "Chassis" 2>/dev/null | cut -d " " -f4-`
    echo "serial: "`PRIV_RUNCMD $AVSYSREPORT_CMD chassis-info | grep "Serial" 2>/dev/null | cut -d " " -f4-`
fi

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`

Solaris

getDeviceInfo

 
check_hostname=`check-hostname 2>/dev/null`
if [ $? -eq 0 ]; then
    fqdn=`echo $check_hostname | awk '{print $NF}'`
    echo 'fqdn:' $fqdn
    dns_domain=`echo $fqdn | cut -d. -f2-`
fi
if [ "$dns_domain" = "" -a -r /etc/resolv.conf ]; then
    dns_domain=`awk '/^(search|domain)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`

is replaced with:

check_hostname=`check-hostname 2>/dev/null`
if [ $? -eq 0 ]; then
    dns_domain=`echo $fqdn | cut -d. -f2-`
    if [ "$fqdn" != "loghost" -a "$fqdn" != "localhost" ]; then
        echo 'fqdn:' $fqdn
        dns_domain=`echo $fqdn | cut -d. -f2-`
    fi
fi
if [ "$dns_domain" = "" -a -r /etc/resolv.conf ]; then
    dns_domain=`awk '/^(search|domain)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*