Changes to Discovery Commands

The following sections show the discovery command changes between BMC Atrium 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 9.0 SP2 to 10.0

 Click this link to show the discovery command changes from 9.0 SP2 to 10.0
 

Solaris

getHostInfo

The following code:

    if [ $run_prtdiag -eq 1 ]; then
        if [ -x /usr/platform/`uname -m`/sbin/prtdiag ]; then
            platdir=/usr/platform/`uname -m`/sbin
        else
            platdir=/usr/platform/`uname -i`/sbin
        fi

is replaced with:

    if [ $run_prtdiag -eq 1 ]; then
        if [ -x /usr/platform/`uname -m`/sbin/prtdiag ]; then
            platdir=/usr/platform/`uname -m`/sbin
        elif [ -x /usr/platform/`uname -m`/sbin/sparcv9/prtdiag ]; then                        
            platdir=/usr/platform/`uname -m`/sbin/sparcv9
        else
            platdir=/usr/platform/`uname -i`/sbin
        fi
getNetworkInterfaces

The following code:

            case $NIC_TYPE in
                dmfe | bge | nxge)
                    echo 'NDD :' $NAME ':adv_autoneg_cap:' `PRIV_NDD $NDD -get /dev/$NAME adv_autoneg_cap 2>/dev/null`

is replaced with:

            case $NIC_TYPE in
                dmfe | bge | nxge | igb)
                    echo 'NDD :' $NAME ':adv_autoneg_cap:' `PRIV_NDD $NDD -get /dev/$NAME adv_autoneg_cap 2>/dev/null`

The following code:

        vars_fjqe="link_mode link_speed adv_autoneg_cap"
        vars_fjgi="link_mode link_speed adv_autoneg_cap"
        LISTOFTYPES=`echo "$LINKNAMES" | sed 's/[0-9]*$//g' | sort -u`
        LISTOFSETTYPES=`echo $LISTOFTYPES | sed -e 's/bge//' -e 's/dmfe//'`
        for iface in $LISTOFSETTYPES; do
            eval initial_$iface=`PRIV_NDD $NDD -get /dev/$iface instance 2>/dev/null`
        done

is replaced with:

        vars_fjqe="link_mode link_speed adv_autoneg_cap"
        vars_fjgi="link_mode link_speed adv_autoneg_cap"
        vars_igb="link_duplex link_speed adv_autoneg_cap"
        LISTOFTYPES=`echo "$LINKNAMES" | sed 's/[0-9]*$//g' | sort -u`
        LISTOFSETTYPES=`echo $LISTOFTYPES | sed -e 's/bge//' -e 's/dmfe//' -e 's/igb//' -e s'/vsw//'`
        for iface in $LISTOFSETTYPES; do
            eval initial_$iface=`PRIV_NDD $NDD -get /dev/$iface instance 2>/dev/null`
        done

The following code:

                bge | dmfe ) #interfaces that do not need -set:
                    for var in $vars
                    do
                      echo 'NDD :' $NAME ':' $var ':' `PRIV_NDD $NDD -get /dev/$NAME $var 2>/dev/null`
                    done
                ;;

is replaced with:

                bge | dmfe | igb) #interfaces that do not need -set:
                    for var in $vars
                    do
                      echo 'NDD :' $NAME ':' $var ':' `PRIV_NDD $NDD -get /dev/$NAME $var 2>/dev/null`
                    done
                ;;
getDirectoryListing

The following code:

P=%(path)s
PRIV_TEST -d "${P}" -a -r "${P}" > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd "${P}"; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

P=%(path)s
PRIV_TEST -d "${P}" > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x "${P}" -a -r "${P}" > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd "${P}" 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -al
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi
getDeviceInfo

The following code:

if [ -r /etc/release ]; then
    echo 'os:' `head -1 /etc/release 2>/dev/null`
else
    echo 'os:' `uname -sr 2>/dev/null`
fi

is replaced with:

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

AIX

getHostInfo

The following code:

if [ `uname -v` -ge 6 ]; then
    # AIX 6 WPAR support
    wparid=`uname -W 2>/dev/null`
    echo "wparid: $wparid" 
    if [ $wparid -eq 0 -a -x /usr/sbin/lswpar ]; then
        echo 'begin lswpar:'
        /usr/sbin/lswpar -cqa name,state,type,hostname,directory,key,owner,application 2>/dev/null
        echo 'end lswpar'
    fi
fi

is replaced with:

if [ `uname -v` -ge 6 ]; then
    # AIX 6 WPAR support
    wparid=`uname -W 2>/dev/null`
    echo "wparid: $wparid"
    if [ $wparid -eq 0 ]; then
        echo 'begin lswpar:'
        PRIV_LSWPAR /usr/sbin/lswpar -cqa name,state,type,hostname,directory,key,owner,application 2>/dev/null
        echo 'end lswpar'
    fi
fi

The following code:

        # Don't output serial number if it isn't available. Also work around
        # bug in prtconf on AIX 5.3 where there's no newline after the serial
        # number output if it isn't available.
        if [ "$serial" != " Not Available" -a "$serial" != " Not AvailableProcessor Type" ]; then
          echo 'serial:' $serial
        fi

is replaced with:

        # Don't output serial number if it isn't available. Also work around
        # bug in prtconf on AIX 5.3 where there's no newline after the serial
        # number output if it isn't available.
        if [ "$serial" != "" -a  "$serial" != " Not Available" -a "$serial" != " Not AvailableProcessor Type" ]; then
          echo 'candidate_serial[]:' $serial
        else
          lsattr -E -l sys0 -a systemid 2>/dev/null | awk '{print "candidate_serial[]: " substr($2,7);}'
        fi

The following code:

else
    lsattr -E -l sys0 -a modelname 2>/dev/null | awk '{print "model: " $2;}'
    lsattr -E -l sys0 -a systemid 2>/dev/null | awk '{print "serial: " $2;}'
    # Use this processor value if lparstat failed

is replaced with:

else
    lsattr -E -l sys0 -a modelname 2>/dev/null | awk '{print "model: " $2;}'
    lsattr -E -l sys0 -a systemid 2>/dev/null | awk '{print "candidate_serial[]: " substr($2,7);}'
    # Use this processor value if lparstat failed

The following code is added:

# 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/'
getIPAddresses

The following code:

    if [ `uname -v` -ge 6 ]; then
        wparaddrs=`lswpar -Nqa address 2>/dev/null | xargs echo | sed -e 's/\./\./g
    fi

is replaced with:

    if [ `uname -v` -ge 6 ]; then
        wparaddrs=`PRIV_LSWPAR /usr/sbin/lswpar -Nqa address 2>/dev/null | xargs echo | sed -e 's/\./\./g
' -e 's/ /|/g'`
    fi
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -al
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi
initialise

The following code is added:

# lswpar requires superuser privileges to get wpar information.
PRIV_LSWPAR() {
    "$@"
}

Mac OS X

getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -alT
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

IRIX

getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -al
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

POWER HMC

getProcessList

The following code:

echo 'kernel:' `uname -r`
echo bios_level: `lshmc -b | grep bios= | cut -f2 -d=`
monhmc -r mem -n 0 | cut -f1 -d, | sed -e 's/Mem/ram/' -e 's/total//'

is replaced with:

echo 'kernel:' `uname -r`
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//'
getHostInfo

The following code:

echo 'kernel:' `uname -r`
echo bios_level: `lshmc -b | grep bios= | cut -f2 -d=`
monhmc -r mem -n 0 | cut -f1 -d, | sed -e 's/Mem/ram/' -e 's/total//'

is replaced with:

echo 'kernel:' `uname -r`
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//'

Tru64

getProcessList

The following code:

echo 'kernel:' `uname -v 2>/dev/null`
echo 'model:' `PRIV_HWMGR hwmgr get attr -cat platform -a name 2>/dev/null | grep name | sed 's/name =//'`
vmstat -P 2>/dev/null | grep "^Total Physical Memory" | sed -e 's/Total Physical Memory *= */ram: /'
/sbin/consvar -g sys_serial_num  2>/dev/null  | sed -e 's/sys_serial_num *= */serial: /'
echo 'begin tru64_psrinfo:'
psrinfo -v
echo 'end tru64_psrinfo'

is replaced with:

echo 'kernel:' `uname -v 2>/dev/null`
echo 'model:' `PRIV_HWMGR hwmgr get attr -cat platform -a name 2>/dev/null | grep name | cut -f2- -d='`
echo 'ram:' `vmstat -P 2>/dev/null | grep "^Total Physical Memory" | cut -f2 -d=`
echo "serial:" `/sbin/consvar -g sys_serial_num 2>/dev/null | cut -f2- -d=`
echo 'begin tru64_psrinfo:'
psrinfo -v
echo 'end tru64_psrinfo'
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -al
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

OpenVMS

getHostInfo

The following code:

WRITE SYS$OUTPUT "arch: ", F$GETSYI("ARCH_NAME")
WRITE SYS$OUTPUT "model: ", F$GETSYI("HW_NAME")
WRITE SYS$OUTPUT "ram: ", F$GETSYI("MEMSIZE")/(1048576/F$GETSYI("PAGE_SIZE")), "MB"
WRITE SYS$OUTPUT "begin show-cpu:"
PIPE SHOW CPU /FULL | SEARCH SYS$INPUT /NOHIGHLIGHT "COThd:","Type","Speed"
WRITE SYS$OUTPUT "end show-cpu:"

is replaced with:

WRITE SYS$OUTPUT "arch: ", F$GETSYI("ARCH_NAME")
WRITE SYS$OUTPUT "model: ", F$GETSYI("HW_NAME")
WRITE SYS$OUTPUT "logical_ram: ", F$GETSYI("MEMSIZE")/(1048576/F$GETSYI("PAGE_SIZE")), "MB"
WRITE SYS$OUTPUT "begin show-cpu:"
PIPE SHOW CPU /FULL | SEARCH SYS$INPUT /NOHIGHLIGHT "COThd:","Type","Speed"
WRITE SYS$OUTPUT "end show-cpu:"

VMware ESXi

getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -lae --color=never)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -lae --color=never
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

UnixWare

getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -al
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

FreeBSD

getHostInfo

The following code is added:

if [ -x /sbin/sysctl ]; then
    ram=`/sbin/sysctl hw.realmem 2>/dev/null | sed -n 's/hw.realmem *[:=] *//p'`
    if [ "$ram" != "" ]; then
       echo "ram: $ram"
    fi
    logical_ram=`/sbin/sysctl hw.physmem 2>/dev/null | sed -n 's/hw.physmem *[:=] *//p'`
    if [ "$logical_ram" != "" ]; then
       echo "logical_ram: $logical_ram"
    fi
fi
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -alT
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

Linux

getHostInfo

The following code:

ram=`awk '/^MemTotal:/ {print $2 "KB"}' /proc/meminfo 2>/dev/null`

is replaced with:

logical_ram=`awk '/^MemTotal:/ {print $2 "KB"}' /proc/meminfo 2>/dev/null`

The following code:

        ram=`grep "Physical Mem\." ${file} | sed 's/[^0-9]*//g'`B
        uuid=`grep "BIOS UUID\." ${file}`
    else

is replaced with:

        ram=`grep "Physical Mem\." ${file} | sed 's/[^0-9]*//g'`B
        # For esx/esxi, we should NOT use memory from dmesg or /proc/meminfo 
        # because the values are incorrect
        logical_ram=""
        uuid=`grep "BIOS UUID\." ${file}`
    else

The following code:

        uuid=`PRIV_XE $XE host-list | grep uuid | head -n 1 | cut -f2 -d: | awk '{print $1;}'`
        ram=`PRIV_XE $XE host-param-get uuid=$uuid param-name=memory-total`
        print=1
    fi
fi

is replaced with:

        uuid=`PRIV_XE $XE host-list | grep uuid | head -n 1 | cut -f2 -d: | awk '{print $1;}'`
        logical_ram=`PRIV_XE $XE host-param-get uuid=$uuid param-name=memory-total`
        print=1
    fi
fi

The following code:

    if [ "${ram}" != "" ]; then
        echo 'ram:' ${ram}
    fi
fi

is replaced with:

    if [ "${ram}" != "" ]; then
        echo 'ram:' ${ram}
    fi
    if [ "${logical_ram}" != "" ]; then
        echo 'logical_ram:' ${logical_ram}
    fi
fi

The following code:

# candidate from the values returned, where "best" is the first non-bogus value
if [ -x /usr/bin/lshal ]; then 
    /usr/bin/lshal 2>/dev/null | sed -e 's/(string)$//g' -e "s/'//g" | awk '
    $1 ~ /system.hardware.serial/ {
        sub(".*system.hardware.serial = *", "");
        printf("candidate_serial[]: %s\n", $0);
    }
    $1 ~ /system.hardware.uuid/ {
        sub(".*system.hardware.uuid = *", "");
        printf("candidate_uuid[]: %s\n", $0);
    }
    $1 ~ /system.hardware.product/ {
        sub(".*system.hardware.product = *", "");
        printf("candidate_model[]: %s\n", $0);
    }
    $1 ~ /system.hardware.vendor/ {
        sub(".*system.hardware.vendor = *", "");
        printf("candidate_vendor[]: %s\n", $0);
    }'
fi

is replaced with:

# candidate from the values returned, where "best" is the first non-bogus value
if [ -x /usr/bin/lshal ]; then 
    /usr/bin/lshal 2>/dev/null | sed -e 's/(string)$//g' -e "s/'//g" | awk '
    $1 ~ /(smbios\.system|system\.hardware)\.serial/ {
        sub(/.*(smbios\.system|system\.hardware).serial = */, "");
        printf("candidate_serial[]: %s\n", $0);
    }
    $1 ~ /(smbios\.system|system\.hardware)\.uuid/ {
        sub(/.*(smbios\.system|system\.hardware)\.uuid = */, "");
        printf("candidate_uuid[]: %s\n", $0);
    }
    $1 ~ /(smbios\.system|system\.hardware)\.product/ {
        sub(/.*(smbios\.system|system\.hardware)\.product = */, "");
        printf("candidate_model[]: %s\n", $0);
    }
    $1 ~ /system(\.hardware)?\.vendor/ {
        sub(/.*(system|system\.hardware)\.vendor = */, "");
        printf("candidate_vendor[]: %s\n", $0);
    }'
fi
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -a --full-time --color=never)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -a --full-time --color=never
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

OpenBSD

getHostInfo

The following code is added:

if [ -x /sbin/sysctl ]; then
    logical_ram=`/sbin/sysctl hw.physmem 2>/dev/null | sed -n 's/hw.physmem *[:=] *//p'`
    if [ "$logical_ram" != "" ]; then
       echo "logical_ram: $logical_ram"
    fi
fi
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -alT
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

NetBSD

getHostInfo

The following code is added:

if [ -x /sbin/sysctl ]; then
    logical_ram=`/sbin/sysctl hw.physmem64 2>/dev/null | sed -n 's/hw.physmem64 *[:=] *//p'`
    if [ "$logical_ram" != "" ]; then
       echo "logical_ram: $logical_ram"
    else
       logical_ram=`/sbin/sysctl hw.physmem 2>/dev/null | sed -n 's/hw.physmem *[:=] *//p'`
       if [ "$logical_ram" != "" ]; then
          echo "logical_ram: $logical_ram"
       fi
    fi
fi
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -alT
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

HP-UX

getMACAddresses

The following code:

    echo 'end machinfo:'
else
    cores=0
    ram=0
    if [ -x /usr/sbin/parstatus ]; then
        par_id=`/usr/sbin/parstatus -w 2> /dev/null | grep "The local partition number is" | sed 's/.*The local partition number is \([0-9]*\)\..*/\1/'`
        if [ "$par_id" ]; then
            echo par_id: $par_id
            cpumem=`/usr/sbin/parstatus -C -M |awk -v PAR_ID=$par_id 'BEGIN{ FS=":" };{ if ($NF==PAR_ID) { split($4,cpuarray,"/"); split($5,memarray,"/"); cpu+=cpuarray[1]; mem+=int(memarray[1])} };END{ printf "%d %d\n",cpu,mem }'`
            cores=`echo "$cpumem" |awk '{print $1}'`
            ram=`echo "$cpumem" |awk '{print $2}'`
            ram=`echo "$ram" '* 1048576 * 1024' | bc`
            echo ram: $ram
        fi
    fi

is replaced with:

    echo 'end machinfo:'
else
    cores=0
    logical_ram=""
    ram=""
    if [ -x /usr/sbin/parstatus ]; then
        par_id=`/usr/sbin/parstatus -w 2> /dev/null | grep "The local partition number is" | sed 's/.*The local partition number is \([0-9]*\)\..*/\1/'`
        if [ "$par_id" ]; then
            echo par_id: $par_id
            cpumem=`/usr/sbin/parstatus -C -M |awk -v PAR_ID=$par_id 'BEGIN{ FS=":" };{ if ($NF==PAR_ID) { split($4,cpuarray,"/"); split($5,memarray,"/"); cpu+=cpuarray[1]; mem+=int(memarray[1])} };END{ printf "%d %d\n",cpu,mem }'`
            cores=`echo "$cpumem" |awk '{print $1}'`
            logical_ram=`echo "$cpumem" |awk '{print $2}'`
            logical_ram=`echo "$logical_ram" '* 1048576 * 1024' | bc`
            echo logical_ram: $logical_ram
        fi
    fi

The following code:

    if [ $ram -eq 0 ]; then
        ram=`echo "selclass qualifier memory;infolog" | cstm 2>/dev/null | grep 'System Total'`
        if [ "$ram" != "" ]; then
            echo $ram | sed -e 's/^.*(\(.*\))[^0-9]*\([0-9]*\).*$/ram: \2\1/'
        fi
        if [ "$ram" = "" ]; then  #cstm not installed or do not have suitable credentials, try another method
            # first try to check the Ignite-UX manifest
            MANIFEST_PATH="/var/opt/ignite/local/manifest/manifest"
            if [ -r $MANIFEST_PATH ]; then
                ram=`grep "Main Memory" $MANIFEST_PATH | cut -d: -f2 | sed 's/ //g'`
                if [ "$ram" != "" ]; then
                    echo "ram: $ram"
                fi
            fi
        fi
        if [ "$ram" = "" ]; then  #cannot read manifest or cannot extract RAM info, try to read syslog
            SYSLOG_PATH="/var/adm/syslog/syslog.log"
            if [ -r $SYSLOG_PATH ]; then
                ram=`grep "Physical" $SYSLOG_PATH | sed 's/^.*Physical: *\([0-9]*\).*\([GMK]\)bytes.*$/\1\2B/'`
                if [ "$ram" != "" ]; then
                    echo "ram: $ram"
                fi
            fi
        fi   

is replaced with:

    ram=`echo "selclass qualifier memory;infolog" | cstm 2>/dev/null | grep 'System Total'`
    if [ "$ram" != "" ]; then
        echo $ram | sed -e 's/^.*(\(.*\))[^0-9]*\([0-9]*\).*$/ram: \2\1/'
    fi

    if [ "$logical_ram" = "" ]; then
        # Get logical_ram from manifest for systems other than vpar
        if [ "$par_id" = "" ]; then
            # first try to check the Ignite-UX manifest
            MANIFEST_PATH="/var/opt/ignite/local/manifest/manifest"
            if [ -r $MANIFEST_PATH ]; then
                logical_ram=`grep "Main Memory" $MANIFEST_PATH | cut -d: -f2 | sed 's/ //g'`
                if [ "$logical_ram" != "" ]; then
                    echo "logical_ram: $logical_ram"
                fi
            fi
        fi
        if [ "$logical_ram" = "" ]; then  #cannot read manifest or cannot extract RAM info, try to read syslog
            SYSLOG_PATH="/var/adm/syslog/syslog.log"
            if [ -r $SYSLOG_PATH ]; then
                logical_ram=`grep "Physical" $SYSLOG_PATH | sed 's/^.*Physical: *\([0-9]*\).*\([GMK]\)bytes.*$/\1\2B/'`
                if [ "$logical_ram" != "" ]; then
                    echo "logical_ram: $logical_ram"
                fi
            fi
        fi   
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -al
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

VMware ESX

getHostInfo

The following code:

ram=`awk '/^MemTotal:/ {print $2 "KB"}' /proc/meminfo 2>/dev/null`

is replaced with:

logical_ram=`awk '/^MemTotal:/ {print $2 "KB"}' /proc/meminfo 2>/dev/null`

The following code is added:

        # For esx/esxi, we should NOT use memory from dmesg or /proc/meminfo 
        # because the values are incorrect
        logical_ram=""

The following code:

        # /proc/meminfo reports incorrectly for Xen domains, use "xe"
        uuid=`PRIV_XE $XE host-list | grep uuid | head -n 1 | cut -f2 -d: | awk '{print $1;}'`
        ram=`PRIV_XE $XE host-param-get uuid=$uuid param-name=memory-total`
        print=1
    fi
fi

is replaced with:

        # /proc/meminfo reports incorrectly for Xen domains, use "xe"
        uuid=`PRIV_XE $XE host-list | grep uuid | head -n 1 | cut -f2 -d: | awk '{print $1;}'`
        logical_ram=`PRIV_XE $XE host-param-get uuid=$uuid param-name=memory-total`
        print=1
    fi
fi

The following code:

    fi
    if [ "${ram}" != "" ]; then
        echo 'ram:' ${ram}
    fi
fi

is replaced with:

    fi
    if [ "${ram}" != "" ]; then
        echo 'ram:' ${ram}
    fi
    if [ "${logical_ram}" != "" ]; then
        echo 'logical_ram:' ${logical_ram}
    fi
fi

The following code:

# candidate from the values returned, where "best" is the first non-bogus value
if [ -x /usr/bin/lshal ]; then 
    /usr/bin/lshal 2>/dev/null | sed -e 's/(string)$//g' -e "s/'//g" | awk '
    $1 ~ /system.hardware.serial/ {
        sub(".*system.hardware.serial = *", "");
        printf("candidate_serial[]: %s\n", $0);
    }
    $1 ~ /system.hardware.uuid/ {
        sub(".*system.hardware.uuid = *", "");
        printf("candidate_uuid[]: %s\n", $0);
    }
    $1 ~ /system.hardware.product/ {
        sub(".*system.hardware.product = *", "");
        printf("candidate_model[]: %s\n", $0);
    }
    $1 ~ /system.hardware.vendor/ {
        sub(".*system.hardware.vendor = *", "");
        printf("candidate_vendor[]: %s\n", $0);
    }'
fi

is replaced with:

# candidate from the values returned, where "best" is the first non-bogus value
if [ -x /usr/bin/lshal ]; then 
    /usr/bin/lshal 2>/dev/null | sed -e 's/(string)$//g' -e "s/'//g" | awk '
    $1 ~ /(smbios\.system|system\.hardware)\.serial/ {
        sub(/.*(smbios\.system|system\.hardware).serial = */, "");
        printf("candidate_serial[]: %s\n", $0);
    }
    $1 ~ /(smbios\.system|system\.hardware)\.uuid/ {
        sub(/.*(smbios\.system|system\.hardware)\.uuid = */, "");
        printf("candidate_uuid[]: %s\n", $0);
    }
    $1 ~ /(smbios\.system|system\.hardware)\.product/ {
        sub(/.*(smbios\.system|system\.hardware)\.product = */, "");
        printf("candidate_model[]: %s\n", $0);
    }
    $1 ~ /system(\.hardware)?\.vendor/ {
        sub(/.*(system|system\.hardware)\.vendor = */, "");
        printf("candidate_vendor[]: %s\n", $0);
    }'
fi
getDirectoryListing

The following code:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -a --full-time --color=never)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    PRIV_TEST -x %(path)s -a -r %(path)s > /dev/null 2> /dev/null
    if [ $? -eq 0 ]; then
        (cd %(path)s 2> /dev/null
         if [ $? -eq 0 ]; then
             PRIV_LS -a --full-time --color=never
         else
             echo 'PERMISSION DENIED'
         fi)
    else
        echo 'PERMISSION DENIED'
    fi
else
    echo 'DIRECTORY NOT FOUND'
fi

Discovery command changes from 9.0 SP1 to 9.0 SP2

 Click this link to show the discovery command changes from 9.0 SP1 to 9.0 SP2
 

AIX

getHostInfo

The following code:

# Extract CPU info from lparstat
num_physical_processors=`egrep '^Active Physical CPUs in system' /tmp/tideway.$$ | cut -f2 -d:`
num_logical_processors=`egrep '^Online Virtual CPUs' /tmp/tideway.$$ | cut -f2 -d:`

is replaced with:

# Extract CPU info from lparstat
num_logical_processors=`egrep '^Online Virtual CPUs' /tmp/tideway.$$ | cut -f2 -d:`

The following code:

    echo "cpu_threading_enabled:" $smt_enabled
fi

if [ "$num_physical_processors" != "" ]; then
    echo "num_processors": $num_physical_processors
fi
if [ "$num_logical_processors" != "" ]; then
    echo "num_logical_processors:" $num_logical_processors
fi

is replaced with:

    echo "cpu_threading_enabled:" $smt_enabled
fi

if [ "$num_logical_processors" != "" ]; then
    echo "num_logical_processors:" $num_logical_processors
fi

Linux

getHostInfo

The following code is added:

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
getNetworkInterfaces

The following code:

ifconfig -a 2>/dev/null

ETHTOOL=""
if [ -f /sbin/ethtool ]; then

is replaced with:

ifconfig -a 2>/dev/null
if [ $? -eq 0 ]; then

ETHTOOL=""
if [ -f /sbin/ethtool ]; then

The following code:

echo 'begin details:'
for i in `ifconfig -a 2>/dev/null | egrep '^[a-z]' | awk '{print $1;}'`
do

is replaced with:

echo 'begin details:'
for i in `ifconfig -a 2>/dev/null | egrep '^[a-z]' | awk -F: '{print $1;}'`
do

The following code:

done
echo 'end details:'

is replaced with:

done
echo 'end details:'
fi

HP-UX

getMACAddresses

The following code:

lanscan -am

is replaced with:

lanscan | grep ETHER | awk '{print $2, $8;}'

VMware ESX

getHostInfo

The following code is added:

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
getNetworkInterfaces

The following code:

ifconfig -a 2>/dev/null

ETHTOOL=""

is replaced with:

ifconfig -a 2>/dev/null
if [ $? -eq 0 ]; then

ETHTOOL=""

The following code:

echo 'begin details:'
for i in `ifconfig -a 2>/dev/null | egrep '^[a-z]' | awk '{print $1;}'`
do

is replaced with:

echo 'begin details:'
for i in `ifconfig -a 2>/dev/null | egrep '^[a-z]' | awk -F: '{print $1;}'`
do

Discovery command changes from 9.0 and 9.0 SP1

 Click this link to show the discovery command changes from 9.0 and 9.0 SP1
 

Solaris

getHostInfo

The following code is added:

if [ -x /usr/sbin/virtinfo ]; then
    # LDOM support for Solaris 11 in system/core-os, and Solaris 9/10 in SUNWcsu
    echo 'begin virtinfo:'
    /usr/sbin/virtinfo -ap 2>/dev/null 
    echo 'end virtinfo:'
fi

AIX

getHBAList

The following code:

do
    adapter_name=`echo $i | cut -f1 -d:`
    adapter_status=`echo $i | cut -f2 -d:`
    adapter_type=`echo $i | cut -f3 -d:`
    if [ $adapter_status = "Available" ]; then
        echo begin lscfg-vl-$adapter_name:
        lscfg -vl $adapter_name

is replaced with:

do
    adapter_name=`echo $i | cut -f1 -d:`
    adapter_status=`echo $i | cut -f2 -d:`
    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

Mainframe

The following method is added:

  • getTransactionProgram

HPUX

The following method is added

  • getHBAList
initialise

The following code is added:

# fcmsutil requires superuser privileges to display any HBA information
PRIV_FCMSUTIL() {
    "$@"
}

Discovery command changes from 8.3 SP2 to 9.0

 Click this link to show the discovery command changes from 8.3 SP2 to 9.0

Solaris

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getProcessList

The following code:

if [ `uname -r | cut -f2 -d.` -ge 10 ]  && [ -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 | awk "\$5~/^($zone|ZONE)$/ {print}"
else
    ps -eo pid,ppid,uid,user,args 2>/dev/null
fi

The following code:

PRIV_PS /usr/ucb/ps -axww 2>/dev/null

is replaced with:

if [ $os_ver -ge 11 ]; then
    PRIV_PS /usr/bin/ps axww 2>/dev/null
else
    if [ -x /usr/ucb/ps ]; then
        PRIV_PS /usr/ucb/ps -axww 2>/dev/null
    fi
fi
if [ -x /usr/bin/pargs -a -d /proc ]; then
    echo begin pargs:
    PRIV_PARGS /usr/bin/pargs `ls -1 /proc` 2>/dev/null
    echo end pargs:
fi
getNetworkConnectionList

The following code is added:

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

The following code:

showrev 2>/dev/null | nawk -F: '/^Kernel version/ {gsub("^ *", "", $2); print "kernel:", $2; exit}'
echo 'model:' `uname -i 2>/dev/null`
/usr/sbin/prtconf 2>/dev/null | nawk '/^Memory size:/ {print "ram: " $3 "MB"}'

is replaced with:

os_ver=`uname -r | cut -d. -f2`
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"}'

The following code:

fi

echo 'hostid:' `hostid`
if [ -f /etc/ssphostname ]; then
    # E10K support
    echo 'ssphostname:' `cat /etc/ssphostname`
fi

is replaced with:

fi

echo 'hostid:' `hostid`
if [ -r /etc/ssphostname ]; then
    # E10K support
    echo 'ssphostname:' `cat /etc/ssphostname`
fi
getPackageList

The following code:

pkginfo -l 2>/dev/null

is replaced with:

os_ver=`uname -r | cut -d. -f2`
if [ $os_ver -ge 11 ]; then
    echo begin pkg_list:
    echo arch: `uname -p`
    pkg list -H --no-refresh 2>/dev/null
    echo end pkg_list:
fi
PKGINFO=`tw_which pkginfo`
if [ ! -z "$PKGINFO" -a -x $PKGINFO ]; then 
    pkginfo -l 2>/dev/null
fi
initialise

The following code:

  ls "$@"
}

is replaced with:

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}

tw_which() {
  SAVE=$IFS
  IFS=:

    "$@"
}

The following code:

# ndd requires superuser privileges to display any interface speed
# and negotiation settings
PRIV_NDD() {
    "$@"
}

# /usr/ucb/ps requires superuser privileges to display full command line 
# information (without this, command lines will be limited to 80 characters).
# This affects Solaris 10 and Solaris 8 & 9 with certain patches

is replaced with:

# dladm requires superuser privileges to display speed, duplex settings, and
# port aggregation information
PRIV_DLADM() {
    "$@"
}

# ndd requires superuser privileges to display any interface speed
# and negotiation settings
PRIV_NDD() {
    "$@"
}

# By default, the standard ps command on Solaris will truncate command lines
# to 80 characters. This affects Solaris 11, Solaris 10 and Solaris 8 & 9 
# with certain patches.
#
# In order to display unlimited command lines, there are several options:
#
#   pargs - This tool is available in more recent updates of Solaris 9 and
#           all updates of Solaris 10 and later. This tool requires the
#           proc_owner privilege to display unlimited command lines for all
#           processes.
#
#   /usr/bin/ps - On Solaris 11, the standard ps command can display 
#           unlimited command lines by using BSD style command line arguments.
#           This still requires the the tool is run with proc_owner privilege
#
#  /usr/ucb/ps - This tool is part of the UCB compatibility package which is 
#           usually installed by default on versions up to and including
#           Solaris 10 (SUNWscpu package). This tool requires the
#           proc_owner privilege to display unlimited command lines for all
#           processes.
#
#           On Solaris 11, the compatibility/ucb is not usually installed
#           by default and in any case, the /usr/ucb/ps command is simply
#           a link to /usr/bin/ps
#
# In order for the Discovery Condition pattern to correctly detect whether
# ps is being executed with proc_owner privilege, this function must accept
# both the ps command and the ppriv command used by pattern.
PRIV_PS() {
    "$@"
}

# See comments above PRIV_PS, above
PRIV_PARGS() {
    "$@"
}
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null 
echo end df:
echo begin mount:
if [ -f /etc/mnttab ]; then
    cat /etc/mnttab
fi
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:
noformat}

s replaced with: 
noformat}
echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
if [ -r /etc/mnttab ]; then
    cat /etc/mnttab
fi
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi
getDeviceInfo

The following code:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(search|domain)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'domain:' `domainname 2>/dev/null`
if [ -f /etc/release ]; then
    echo 'os:' `head -1 /etc/release 2>/dev/null`
else
    echo 'os:' `uname -sr 2>/dev/null`

is replaced with:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(search|domain)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'domain:' `domainname 2>/dev/null`
if [ -r /etc/release ]; then
    echo 'os:' `head -1 /etc/release 2>/dev/null`
else
    echo 'os:' `uname -sr 2>/dev/null`
getPatchList

The following code:

showrev -p 2>/dev/null | grep -v "No patches are installed" | cut -c-16 | nawk '{print $2;}'

is replaced with:

os_ver=`uname -r | cut -d. -f2`
if [ $os_ver -lt 11 ]; then
    showrev -p 2>/dev/null | grep -v "No patches are installed" | cut -c-16 | nawk '{print $2;}'
else
    echo NO PATCHES
fi

AIX

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses

The host_info command is removed from the getPatchList method.
The lsof command is removed from the getPatchList method.

initialise

The following code:

  ls "$@"
}

# lslpp requires superuser privileges to list all installed packages
PRIV_LSLPP() {
    "$@"

is replaced with:

  ls "$@"
}

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}

# lslpp requires superuser privileges to list all installed packages
PRIV_LSLPP() {
    "$@"
getNetworkConnectionList

The following code:

if [ `uname -v` -ge 6 ]; then
    if [ `uname -W` -eq 0 ]; then
        netstat -an -f inet -@ 2>/dev/null | egrep "Global|Proto" | sed -e 's/Global //'
    else
        netstat -an -f inet 2>/dev/null
    fi
else
    netstat -an -f inet  2>/dev/null
fi

is replaced with:

if [ `uname -v` -ge 6 ]; then
    if [ `uname -W` -eq 0 ]; then
        netstat -an -f inet -@ 2>/dev/null | egrep "Global|Proto" | sed -e 's/Global //'
        netstat -an -f inet6 -@ 2>/dev/null | egrep "Global|Proto" | sed -e 's/Global //'
    else
        netstat -an -f inet 2>/dev/null
        netstat -an -f inet6 2>/dev/null
    fi
else
    netstat -an -f inet 2>/dev/null
    netstat -an -f inet6 2>/dev/null
fi
getDeviceInfo

The following code:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'domain:' `domainname 2>/dev/null`
# VIO support
if [ -f /usr/ios/cli/ios.level ]; then
    viover=`cat /usr/ios/cli/ios.level`
    os="VIO $viover"
else

is replaced with:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'domain:' `domainname 2>/dev/null`
# VIO support
if [ -r /usr/ios/cli/ios.level ]; then
    viover=`cat /usr/ios/cli/ios.level`
    os="VIO $viover"
else
getHBAList

The following code:

    if [ $adapter_status = "Available" ]; then
        echo begin lscfg-vl-$adapter_name:
        lscfg -vl $adapter_name
        echo end lscfg-vl-$adapter_name:
        echo begin lslpp-$adapter_name:
        lslpp -L devices.*.$adapter_type.*

is replaced with:

    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:
        lslpp -L devices.*.$adapter_type.*
getFileSystems

The following code:

echo begin df:
if [ -x /usr/sysv/bin/df ]; then
    /usr/sysv/bin/df -lg 2>/dev/null
#else
#    df -k 2>/dev/null
fi
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
if [ -x /usr/sysv/bin/df ]; then
    PRIV_DF /usr/sysv/bin/df -lg 2>/dev/null
#else
#    PRIV_DF df -k 2>/dev/null
fi
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

Windows

The following SSH discovery methods are removed:

  • getProcessList
  • getProcessToConnectionMapping
  • getHostInfo
  • getInterfaceList
  • getDirectoryListing
  • initialise
  • getNetworkConnectionList
  • getFileMetadata
  • getDeviceInfo
  • getPatchList
  • getFileContent

Mac OS X

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getNetworkConnectionList

The following code:

netstat -an -f inet 2>/dev/null

is replaced with:

netstat -an -f inet 2>/dev/null
netstat -an -f inet6 -l 2>/dev/null
initialise

The following code:

PRIV_LS() {
  ls "$@"
}

is replaced with:

PRIV_LS() {
  ls "$@"
}

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getDeviceInfo

The following code:

echo "hostname:" `hostname -s 2>/dev/null`
system_profiler SPHardwareDataType SPSoftwareDataType > /tmp/tideway-hw-$$ 2>/dev/null
grep "Computer Name: " /tmp/tideway-hw-$$ | sed 's/^.*: \(.*\)$/description: \1/'
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf`
fi
grep "System Version: " /tmp/tideway-hw-$$ | sed 's/^.*: Mac OS X \(.*\)$/os: Mac OS X \1/'
rm -f /tmp/tideway-hw-$$
echo 'os_arch:' `uname -p 2>/dev/null`

is replaced with:

echo "hostname:" `hostname -s 2>/dev/null`
system_profiler SPHardwareDataType SPSoftwareDataType > /tmp/tideway-hw-$$ 2>/dev/null
grep "Computer Name: " /tmp/tideway-hw-$$ | sed 's/^.*: \(.*\)$/description: \1/'
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf`
fi
grep "System Version: " /tmp/tideway-hw-$$ | sed -e 's/^.*:/os:/'
rm -f /tmp/tideway-hw-$$
echo 'os_arch:' `uname -p 2>/dev/null`
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

IRIX

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
initialise

The following code:

PRIV_LS() {
  ls "$@"
}

is replaced with:

PRIV_LS() {
  ls "$@"
}

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getNetworkConnectionList

The following code:

netstat -an -f inet 2>/dev/null

is replaced with:

netstat -an -f inet 2>/dev/null
netstat -anW -f inet6 2>/dev/null
getDeviceInfo

The following code:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -s 2>/dev/null` `uname -R | awk '{print $2;}'`

is replaced with:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -s 2>/dev/null` `uname -R | awk '{print $2;}'`
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

POWER HMC

The following method:
The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses

The netstat command is replaced by hostinfo in the getProcessList method.
The lshmc-n command is replaced by monhmc-rdisk in the getPatchList method.

Tru64

The following method:
The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getHostInfo

The following code:

echo 'kernel:' `uname -v 2>/dev/null`
echo 'model:' `hwmgr get attr -cat platform -a name 2>/dev/null | grep name | sed 's/name =//'`
echo 'begin tru64_psrinfo:'
psrinfo -v
echo 'end tru64_psrinfo'

is replaced with:

echo 'kernel:' `uname -v 2>/dev/null`
echo 'model:' `PRIV_HWMGR hwmgr get attr -cat platform -a name 2>/dev/null | grep name | sed 's/name =//'`
vmstat -P 2>/dev/null | grep "^Total Physical Memory" | sed -e 's/Total Physical Memory *= */ram: /'
/sbin/consvar -g sys_serial_num  2>/dev/null  | sed -e 's/sys_serial_num *= */serial: /'
echo 'begin tru64_psrinfo:'
psrinfo -v
echo 'end tru64_psrinfo'
initialise

The following code:

  ls "$@"
}

# setld requires superuser privileges to display information on packages
PRIV_SETLD() {
  "$@"
}

is replaced with:

  ls "$@"
}

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}

# setld requires superuser privileges to display information on packages
PRIV_SETLD() {
  "$@"
}

# hwmgr requires superuser privileges to get hardware component information
PRIV_HWMGR() {
  "$@"
}
getDeviceInfo

The following code:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`

is replaced with:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`
getFileSystems

The following code:

echo begin df:
df -k -t nonfs,nfsv3 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF df -k -t nonfs,nfsv3 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

OpenVMS

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses

Mainframe

The getDatabaseDetail method is now disabled by default. Previously it was enabled.

VMware ESXi

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getHostInfo

The following code:

/sbin/smbiosDump | awk '{ if( $1 ~ /Serial:/ ) { sub(".*Serial: *",""); gsub( "\"", ""); printf( "serial: %s\n", $0 ); } }' | head -1

echo begin vim-cmd-hostsummary:
vim-cmd hostsvc/hostsummary

is replaced with:

# Get the Serial number from System Info block - Each block starts with double space and [A-Za-z]
serial=`/sbin/smbiosDump | sed -n '/^  System Info:/,/^  [A-Za-z]/ p' | grep '^ *Serial:'`

# If the Serial number does NOT exist in the System block, get it from Board Info
if [ "$serial" = "" ]; then
    serial=`/sbin/smbiosDump | sed -n '/^  Board Info:/,/^  [A-Za-z]/ p' | grep '^ *Serial:'`
fi

if [ "$serial" != "" ]; then
    echo serial: `echo $serial | cut -d: -f2- | sed 's/"//g'`
fi

echo begin vim-cmd-hostsummary:
vim-cmd hostsvc/hostsummary
initialise

The following code:

PRIV_LS() {
  ls "$@"
}

is replaced with:

PRIV_LS() {
  ls "$@"
}

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getDeviceInfo

The following code:

echo 'hostname:' $ihn
echo 'fqdn:' `hostname -f 2>/dev/null`
dns_domain=`hostname -d 2>/dev/null | sed -e 's/(none)//'` 
if [ "$dns_domain" = "" -a -f /etc/resolv.conf ]; then 
  dns_domain=`awk '/^(domain|search)/ {sub(/\\\\000$/, "", $2); print $2; exit }' /etc/resolv.conf 2>/dev/null` 
fi 
echo 'dns_domain: ' $dns_domain

is replaced with:

echo 'hostname:' $ihn
echo 'fqdn:' `hostname -f 2>/dev/null`
dns_domain=`hostname -d 2>/dev/null | sed -e 's/(none)//'` 
if [ "$dns_domain" = "" -a -r /etc/resolv.conf ]; then 
  dns_domain=`awk '/^(domain|search)/ {sub(/\\\\000$/, "", $2); print $2; exit }' /etc/resolv.conf 2>/dev/null` 
fi 
echo 'dns_domain: ' $dns_domain
getFileSystems

The following code:

echo begin df:
df -k 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null

is replaced with:

echo begin df:
PRIV_DF df -k 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null

UnixWare

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
initialise

The following code is added:

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getDeviceInfo

The following code:

echo 'hostname:' `uname -n 2>/dev/null`
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sv 2>/dev/null`

is replaced with:

echo 'hostname:' `uname -n 2>/dev/null`
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sv 2>/dev/null`
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null
echo end df:
echo begin mount:
if [ -f /etc/mnttab ]; then
    cat /etc/mnttab
fi
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
if [ -r /etc/mnttab ]; then
    cat /etc/mnttab
fi
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

FreeBSD

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getNetworkConnectionList

The following code is added:

netstat -an -f inet6 -W 2>/dev/null
initialise

The following code is added:

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}

getDeviceInfo

The following code:

    ihn=localhost
fi
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`

is replaced with:

    ihn=localhost
fi
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

Linux

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getHostInfo

The following code:

if [ -f /usr/sbin/esxcfg-info ]; then
    # On a VMWare ESX controller, report the *real* hardware information
    file=/tmp/tideway-hw-$$
    PRIV_ESXCFG /usr/sbin/esxcfg-info --hardware > ${file} 2>/dev/null
    uuid=""
    if [ $? -eq 0 ]; then
        physical=`grep "Num Packages\." ${file} | sed -e "s/[^0-9]//g"`
        logical=`grep "Num Cores." ${file} | head -n 1 | sed -e "s/[^0-9]//g"`

is replaced with:

if [ -f /usr/sbin/esxcfg-info ]; then
    # On a VMWare ESX controller, report the *real* hardware information
    file=/tmp/tideway-hw-$$
    uuid=""
    PRIV_ESXCFG /usr/sbin/esxcfg-info --hardware > ${file} 2>/dev/null
    if [ $? -eq 0 ]; then
        physical=`grep "Num Packages\." ${file} | sed -e "s/[^0-9]//g"`
        logical=`grep "Num Cores." ${file} | head -n 1 | sed -e "s/[^0-9]//g"`

The following code:

# zLinux?
if [ -f /proc/sysinfo -a -d /proc/dasd ]; then
    echo "candidate_vendor[]:" `egrep '^Manufacturer:' /proc/sysinfo | awk '{print $2;}'`
    type=`egrep '^Type:' /proc/sysinfo | awk '{print $2;}'`
    model=`egrep '^Model:' /proc/sysinfo | awk '{print $2;}'`

is replaced with:

# zLinux?
if [ -r /proc/sysinfo -a -d /proc/dasd ]; then
    echo "candidate_vendor[]:" `egrep '^Manufacturer:' /proc/sysinfo | awk '{print $2;}'`
    type=`egrep '^Type:' /proc/sysinfo | awk '{print $2;}'`
    model=`egrep '^Model:' /proc/sysinfo | awk '{print $2;}'`
getPackageList

The following code:

COLUMNS=256 dpkg -l '*' | egrep '^ii '

is replaced with:

COLUMNS=256 dpkg -l '*' 2>/dev/null | egrep '^ii '
initialise

The following code is added:

 
# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}

getDeviceInfo

The following code:

echo 'hostname:' $ihn
echo 'fqdn:' `hostname --fqdn 2>/dev/null`
dns_domain=`hostname -d 2>/dev/null | sed -e 's/(none)//'` 
if [ "$dns_domain" = "" -a -f /etc/resolv.conf ]; then 
  dns_domain=`awk '/^(domain|search)/ {sub(/\\\\000$/, "", $2); print $2; exit }' /etc/resolv.conf 2>/dev/null` 
fi 
echo 'dns_domain: ' $dns_domain

is replaced with:

echo 'hostname:' $ihn
echo 'fqdn:' `hostname --fqdn 2>/dev/null`
dns_domain=`hostname -d 2>/dev/null | sed -e 's/(none)//'` 
if [ "$dns_domain" = "" -a -r /etc/resolv.conf ]; then 
  dns_domain=`awk '/^(domain|search)/ {sub(/\\\\000$/, "", $2); print $2; exit }' /etc/resolv.conf 2>/dev/null` 
fi 
echo 'dns_domain: ' $dns_domain

The following code:

os=""
if [ "$os" = "" -a -f /etc/redhat-release ]; then
    os=`cat /etc/redhat-release`

is replaced with:

os=""
# SuSE lsb_release does 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
    # We'd like to use -ds but that puts quotes in the output!
    os=`/usr/bin/lsb_release -d | cut -f2 -d: | sed -e 's/^[ \t]//'`
    if [ "$os" = "(none)" ]; then
        os=""
    else
        # 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
if [ "$os" = "" -a -r /proc/vmware/version ]; then
    os=`grep -m1 ESX /proc/vmware/version`
fi
if [ "$os" = "" -a -r /etc/vmware-release ]; then
    os=`grep ESX /etc/vmware-release`
fi
if [ "$os" = "" -a -r /etc/redhat-release ]; then
    os=`cat /etc/redhat-release`

The following code:

if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then
    # We'd like to use -ds but that puts quotes in the output!
    os=`/usr/bin/lsb_release -d | cut -f2 -d:`
fi
if [ "$os" = "" -a -e /proc/vmware/version ]; then
    os=`grep -m1 ESX /proc/vmware/version`
fi
if [ "$os" = "" -a -f /etc/vmware-release ]; then
    os=`grep ESX /etc/vmware-release`
fi
if [ "$os" = "" -a -f /etc/SuSE-release ]; then
    os=`head -n 1 /etc/SuSE-release`
fi
if [ "$os" = "" -a -f /etc/debian_version ]; then
    ver=`cat /etc/debian_version`
    os="Debian Linux $ver"
fi
if [ "$os" = "" -a -f /etc/mandrake-release ]; then
    os=`cat /etc/mandrake-release`
fi
if [ "$os" = "" ]; then

is replaced with:

if [ "$os" = "" -a -r /etc/debian_version ]; then
    ver=`cat /etc/debian_version`
    os="Debian Linux $ver"
fi
if [ "$os" = "" -a -r /etc/mandrake-release ]; then
    os=`cat /etc/mandrake-release`
fi
if [ "$os" = "" ]; then
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

OpenBSD

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
initialise

The following code is added:

 
# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getNetworkConnectionList

The following code:

netstat -an -f inet -W 2>/dev/null

is replaced with:

netstat -an -f inet -v 2>/dev/null
netstat -an -f inet6 -v 2>/dev/null
getDeviceInfo

The following code:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`

is replaced with:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

NetBSD

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
initialise

The following code is added:

 
# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getNetworkConnectionList

The following code:

netstat -an -f inet -W 2>/dev/null

is replaced with:

netstat -an -f inet -v 2>/dev/null
netstat -an -f inet6 -v 2>/dev/null
getDeviceInfo

The following code:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`

is replaced with:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'os:' `uname -sr 2>/dev/null`
getFileSystems
echo begin df:
df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:
echo begin mount:
mount 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

HP-UX

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getNetworkConnectionList

The following code is added:

netstat -an -f inet6 2>/dev/null
getHostInfo

The following code:

fi
echo 'license:' `uname -l`

# machinfo indicates Itanium based system
if [ -x /usr/contrib/bin/machinfo ]; then
    echo 'begin machinfo:'
    if [ $OSVER -ge 1131 ]; then

is replaced with:

fi
echo 'license:' `uname -l`

if [ -x /usr/contrib/bin/machinfo ]; then
    echo 'begin machinfo:'
    if [ $OSVER -ge 1131 ]; then

The following code:

        cores=`/usr/sbin/ioscan -kC processor 2>/dev/null | grep processor | wc -l`
    fi
    if [ "$OSVER" -ge 1100 ]; then
        typeset -i2 bin
        bin=`getconf CPU_CHIP_TYPE`
        typeset -i16 hex
        hex=2#`echo $bin | sed -e 's/2#//' -e 's/.....$//'`
        chip_type=`echo $hex | cut -c4-`
    fi
    
    if [ "$chip_type" -eq 14 ]; then
        cores_per_processor=2
    else
        cores_per_processor=1

is replaced with:

        cores=`/usr/sbin/ioscan -kC processor 2>/dev/null | grep processor | wc -l`
    fi
    if [ "$OSVER" -ge 1100 ]; then
        chip_type=$((`getconf CPU_CHIP_TYPE` >> 5))
    fi
    
    if [ "$chip_type" = "20" ]; then
        cores_per_processor=2
    else
        cores_per_processor=1

The following code:

        echo "cpu_chip_type:" $chip_type
    fi
    echo 'cpu_model:' `model 2>/dev/null`
    KERNEL=/stand/vmunix  
    MEMDEV=/dev/mem
    if [ -r $MEMDEV ]; then
        if [ "$kernel_bits" -eq 64 ]; then
            ADB="adb64 -k"
        else
            ADB="adb -k"
        fi
        echo itick_per_usec/D | $ADB $KERNEL $MEMDEV 2>/dev/null | egrep -v ':$'
    fi
    echo "end hpux_cpu_info"

    if [ $ram -eq 0 ]; then

is replaced with:

        echo "cpu_chip_type:" $chip_type
    fi
    echo 'cpu_model:' `model 2>/dev/null`
    echo "end hpux_cpu_info"

    if [ $ram -eq 0 ]; then
getPackageList

The following code:

PRIV_SWLIST swlist -l product 2>/dev/null | egrep -v '^#|PH[A-Z]{2}_[0-9]+'

is replaced with:

PRIV_SWLIST swlist -v -l product -a tag -a revision -a title -a vendor_tag 2>/dev/null
initialise

The following code is added:

# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getDeviceInfo

The following code:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -f /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'domain:' `domainname 2>/dev/null`

is replaced with:

ihn=`hostname 2>/dev/null`
echo 'hostname:' $ihn
if [ -r /etc/resolv.conf ]; then
    echo 'dns_domain:' `awk '/^(domain|search)/ { print $2; exit }' /etc/resolv.conf 2>/dev/null`
fi
echo 'domain:' `domainname 2>/dev/null`
getFileSystems

The following code:

echo begin df:
bdf -l 2>/dev/null
echo end df:
echo begin mount:
mount -p 2>/dev/null
echo end mount:
echo begin xtab:
if [ -f /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

is replaced with:

echo begin df:
PRIV_DF bdf -l 2>/dev/null
echo end df:
echo begin mount:
mount -p 2>/dev/null
echo end mount:
echo begin xtab:
if [ -r /etc/xtab ]; then
    cat /etc/xtab
fi
echo end xtab:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

VMware ESX

The PATH environment variable has changed from /bin:/sbin to /bin:/usr/bin:/sbin:/usr/sbin.

The following method:

  • getInterfaceList

is replaced with:

  • getMACAddresses
  • getNetworkInterfaces
  • getIPAddresses
getHostInfo

The following code:

if [ -f /usr/sbin/esxcfg-info ]; then
    # On a VMWare ESX controller, report the *real* hardware information
    file=/tmp/tideway-hw-$$
    PRIV_ESXCFG /usr/sbin/esxcfg-info --hardware > ${file} 2>/dev/null
    uuid=""
    if [ $? -eq 0 ]; then
        physical=`grep "Num Packages\." ${file} | sed -e "s/[^0-9]//g"`
        logical=`grep "Num Cores." ${file} | head -n 1 | sed -e "s/[^0-9]//g"`

is replaced with:

if [ -f /usr/sbin/esxcfg-info ]; then
    # On a VMWare ESX controller, report the *real* hardware information
    file=/tmp/tideway-hw-$$
    uuid=""
    PRIV_ESXCFG /usr/sbin/esxcfg-info --hardware > ${file} 2>/dev/null
    if [ $? -eq 0 ]; then
        physical=`grep "Num Packages\." ${file} | sed -e "s/[^0-9]//g"`
        logical=`grep "Num Cores." ${file} | head -n 1 | sed -e "s/[^0-9]//g"`

The following code:

# zLinux?
if [ -f /proc/sysinfo -a -d /proc/dasd ]; then
    echo "candidate_vendor[]:" `egrep '^Manufacturer:' /proc/sysinfo | awk '{print $2;}'`
    type=`egrep '^Type:' /proc/sysinfo | awk '{print $2;}'`
    model=`egrep '^Model:' /proc/sysinfo | awk '{print $2;}'`

is replaced with:

# zLinux?
if [ -r /proc/sysinfo -a -d /proc/dasd ]; then
    echo "candidate_vendor[]:" `egrep '^Manufacturer:' /proc/sysinfo | awk '{print $2;}'`
    type=`egrep '^Type:' /proc/sysinfo | awk '{print $2;}'`
    model=`egrep '^Model:' /proc/sysinfo | awk '{print $2;}'`
getPackageList

The following code:

COLUMNS=256 dpkg -l '*' | egrep '^ii '

is replaced with:

COLUMNS=256 dpkg -l '*' 2>/dev/null | egrep '^ii '
initialise

The following code is added:

 
# This function supports privilege listing of file systems and related
# size and usage.
PRIV_DF() {
  "$@"
}
getDeviceInfo

The following code:

echo 'hostname:' $ihn
echo 'fqdn:' `hostname --fqdn 2>/dev/null`
dns_domain=`hostname -d 2>/dev/null | sed -e 's/(none)//'` 
if [ "$dns_domain" = "" -a -f /etc/resolv.conf ]; then 
  dns_domain=`awk '/^(domain|search)/ {sub(/\\\\000$/, "", $2); print $2; exit }' /etc/resolv.conf 2>/dev/null` 
fi 
echo 'dns_domain: ' $dns_domain

is replaced with:

echo 'hostname:' $ihn
echo 'fqdn:' `hostname --fqdn 2>/dev/null`
dns_domain=`hostname -d 2>/dev/null | sed -e 's/(none)//'` 
if [ "$dns_domain" = "" -a -r /etc/resolv.conf ]; then 
  dns_domain=`awk '/^(domain|search)/ {sub(/\\\\000$/, "", $2); print $2; exit }' /etc/resolv.conf 2>/dev/null` 
fi 
echo 'dns_domain: ' $dns_domain

The following code:

os=""
if [ "$os" = "" -a -f /etc/redhat-release ]; then

is replaced with:

os=""
# SuSE lsb_release does 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
    # We'd like to use -ds but that puts quotes in the output!
    os=`/usr/bin/lsb_release -d | cut -f2 -d: | sed -e 's/^[ \t]//'`
    if [ "$os" = "(none)" ]; then
        os=""
    else
        # 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
if [ "$os" = "" -a -r /proc/vmware/version ]; then
    os=`grep -m1 ESX /proc/vmware/version`
fi
if [ "$os" = "" -a -r /etc/vmware-release ]; then
    os=`grep ESX /etc/vmware-release`
fi
if [ "$os" = "" -a -r /etc/redhat-release ]; then
    os=`cat /etc/redhat-release`

The following code:

        os="Oracle $os"
    fi
fi
if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then
    # We'd like to use -ds but that puts quotes in the output!
    os=`/usr/bin/lsb_release -d | cut -f2 -d:`
fi
if [ "$os" = "" -a -e /proc/vmware/version ]; then
    os=`grep -m1 ESX /proc/vmware/version`
fi
if [ "$os" = "" -a -f /etc/vmware-release ]; then
    os=`grep ESX /etc/vmware-release`
fi
if [ "$os" = "" -a -f /etc/SuSE-release ]; then
    os=`head -n 1 /etc/SuSE-release`
fi
if [ "$os" = "" -a -f /etc/debian_version ]; then
    ver=`cat /etc/debian_version`
    os="Debian Linux $ver"
fi
if [ "$os" = "" -a -f /etc/mandrake-release ]; then
    os=`cat /etc/mandrake-release`
fi
if [ "$os" = "" ]; then

is replaced with:

        os="Oracle $os"
    fi
fi
if [ "$os" = "" -a -r /etc/debian_version ]; then
    ver=`cat /etc/debian_version`
    os="Debian Linux $ver"
fi
if [ "$os" = "" -a -r /etc/mandrake-release ]; then
    os=`cat /etc/mandrake-release`
fi
if [ "$os" = "" ]; then
getFileSystems

The following code:

echo begin df:
df -lk 2>/dev/null
echo end df:

is replaced with:

echo begin df:
PRIV_DF df -lk 2>/dev/null
echo end df:

The following code:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -f $configfile ]; then
        cat $configfile
    fi
fi

is replaced with:

echo begin smbconf:
configfile=`smbstatus -v 2>/dev/null | grep "using configfile" | awk '{print $4;}'`
if [ "$configfile" != "" ]; then
    if [ -r $configfile ]; then
        cat $configfile
    fi
fi

Discovery command changes from 8.3 SP1 to 8.3 SP2

 Click this link to show the discovery command changes from 8.3 SP1 to 8.3 SP2

Solaris

getHostinfo

The following code is removed:

-cputype=""
 
# Physical Processor Count
physical=`/usr/sbin/psrinfo -p 2>/dev/null`
if [ "$physical" = "" ]; then
    physical=`kstat cpu_info 2>/dev/null | grep chip_id | sort | uniq | wc -l`
    if [ $physical -eq 0 ]; then
        physical=""
    fi
fi

The following code is added:

# Run kstat cpu_info to get full CPU information, if possible
echo 'begin kstat_cpu_info:'
kstat cpu_info 2>/dev/null
echo 'end kstat_cpu_info:'

The following code is removed:

    # Solaris X86
    /usr/sbin/prtconf -v > /tmp/tideway.$$ 2>/dev/null
    if [ "$physical" = "" -o "$physical" = "0" ]; then
        physical=`grep -c "cpus, instance" /tmp/tideway.$$`
    fi
    if [ $physical -gt 0 ]; then
        cputype=`awk 'BEGIN { s=0 } /brand-string/ { s=1 } /value=/ { if (s) { print $0; exit } }' /tmp/tideway.$$ | sed -e "s/value='//" -e "s/'\$//"`
    fi
    rm -f /tmp/tideway.$$

The following code is removed:

    if [ -x $platdir/eeprom ]; then
        serial=`$platdir/eeprom 2>/dev/null | grep system-board-serial | cut -f2 -d= | grep -v 'data not available'`
        if [ "$serial" != "" ]; then
            echo "serial: $serial"
        fi
    fi
if [ "$physical" != "" ]; then
    echo 'num_processors:' $physical
fi

# Logical Processor Count
logical=`/usr/sbin/psrinfo -v 2>/dev/null | grep -i virtual | wc -l`
if [ $logical -eq 0 ]; then
    echo "__discovery_errors: Unable to determine logical processor count"

The following code is added:

# Get serial number. We first try sneep as that knows how to collect the
# serial number on the vast majority of Sun/Fujitsu machines. If that is not
# available we try a few obvious fallbacks including any "Chassis Serial Number"
# from prtdiag
if [ -x /opt/SUNWsneep/bin/sneep ]; then
    serial=`/opt/SUNWsneep/bin/sneep 2>/dev/null`
    if [ "$serial" != "unknown" ]; then
        echo "serial: $serial"
    fi

The following code is removed:

    echo 'num_logical_processors:' $logical
fi

# Total Processor Core Count
cores=`kstat cpu_info 2>/dev/null | grep -w core_id | sort | uniq | wc -l`
if [ "$cores" -eq 0 ]; then
    echo "__discovery_errors: Unable to determine total processor core count"
else
    echo 'cores:' $cores
fi

# Processor Speed
speed=`kstat cpu_info 2>/dev/null | grep clock_MHz | awk '{print $2;}' | sort -n -r | head -n 1`
if [ "$speed" = "" ]; then
    echo "__discovery_errors: Unable to determine processor speed"
else
    echo 'processor_speed:' $speed
fi

# Processor Type
if [ "$cputype" = "" ]; then
    cputype=`kstat cpu_info 2>/dev/null | grep implementation | sort | uniq | awk '{print $2;}' | head -n 1`
    if [ "$cputype" = "" ]; then
        echo "__discovery_errors: Unable to determine processor type"
    else
        if [ "$speed" != "" ]; then
            cputype="$cputype ${speed}MHz"
        fi

The following code is added:

    # Sneep isn't available. Check for Fujitsu serialid command
    if [ -x /opt/FJSVmadm/sbin/serialid ]; then
        /opt/FJSVmadm/sbin/serialid | sed -e 's/serialid/serial/'

The following code is removed:

fi
if [ "$cputype" != "" ]; then
    echo 'processor_type:' $cputype 

The following code:

echo 'end solaris_uptime_string'

Is replaced with:

echo 'end solaris_uptime_string:'
initialise

The following code:

# insulate against systems with -u set by default
 set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

getDeviceInfo
The following code:

echo 'os:' `uname -sr 2>/dev/null`
echo 'os_arch:' `uname -p 2>/dev/null`

Is replaced with:

if [ -f /etc/release ]; then
    echo 'os:' `head -1 /etc/release 2>/dev/null`
else
    echo 'os:' `uname -sr 2>/dev/null`
fi
echo 'os_arch:' `isainfo -k 2>/dev/null`

AIX

initialise

The following code:

 
# Clear any shell aliases on VIO
unalias uname
unalias hostname
unalias lsdev
unalias netstat

# insulate against systems with -u set by default
 set +u

Is replaced with:

 
# Stop alias commands changing behaviour.
unalias -a
# Insulate against systems with -u set by default.
 set +u
getDeviceInfo

The following code is added:

maintlevel=`oslevel -r 2>/dev/null`
if [ $? -ne 0 ]; then
    maintlevel=""
fi
if [ "$maintlevel" != "" ]; then
    echo 'os_level:' $maintlevel
fi

Mac OS X

initialise

The following code:

 
# insulate against systems with -u set by default
 set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

IRIX

initialise

The following code:

 
# insulate against systems with -u set by default
 set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

Tru64

initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

VMware ESXi

getHostInfo

The following code:

 
     if [ -r /etc/slp.reg ]; then
        uuid=`grep hardwareUuid /etc/slp.reg | cut -f2 -d= | tr '[:upper:]' '[:lower:]' | sed -e 's/"//g'`

Is replaced with:

     if [ -r /etc/slp.reg ]; then
        uuid=`grep hardwareUuid /etc/slp.reg | cut -f2 -d= | awk '{ print tolower($_); }' | sed -e 's/"//g'`
initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

UnixWare

The following code:

initialise
 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

FreeBSD:

initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

Linux

getNetworkConnectionList

The following code:

 
PRIV_NETSTAT netstat -aneep --tcp --udp 2>/dev/null

Is replaced with:

PRIV_NETSTAT netstat -aneep --tcp --udp -T 2>/dev/null
if [ $? -eq 4 ]; then
    # netstat failed due to invalid option, try -W
    PRIV_NETSTAT netstat -aneep --tcp --udp -W 2>/dev/null
    if [ $? -eq 4 ]; then
        # netstat still failed, try without any wide option
        PRIV_NETSTAT netstat -aneep --tcp --udp 2>/dev/null
    fi
fi

Linux

getHostInfo

The following code:

 
                     if [ `echo ${opteron_number} | cut -c1` -eq 4 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 41xx where xx is lower than 60 are 4 cores
                            core_hint=4
                            sibling=4

Is replaced with:

                     if [ `echo ${opteron_number} | cut -c1` -eq 4 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 41xx where xx is lower than 60 are 4 cores
                            cores_hint=4
                            siblings=4

The following code:

 
                     elif [ `echo ${opteron_number} | cut -c1` -eq 6 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 61xx where xx is lower than 60 are 8 cores
                            core_hint=8
                            sibling=8
                         else
                             # 61xx where xx is higher than 60 are 12 cores                    
                            core_hint=12
                            sibling=12

Is replaced with:

                     elif [ `echo ${opteron_number} | cut -c1` -eq 6 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 61xx where xx is lower than 60 are 8 cores
                            cores_hint=8
                            siblings=8
                         else
                             # 61xx where xx is higher than 60 are 12 cores                    
                            cores_hint=12
                            siblings=12

Linux

initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u
getDeviceInfo

The following code:

echo 'domain:' `hostname -y 2>/dev/null | sed -e 's/(none)//'`
 os=""
 if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then
     # We'd like to use -ds but that puts quotes in the output!
     os=`/usr/bin/lsb_release -d | cut -f2 -d:`
 fi
 if [ "$os" = "" -a -f /etc/vmware-release ]; then
     os=`grep ESX /etc/vmware-release`
fi
if [ "$os" = "" -a -f /etc/redhat-release ]; then
    os=`cat /etc/redhat-release`

    # 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
 if [ "$os" = "" -a -f /etc/SuSE-release ]; then
     os=`head -n 1 /etc/SuSE-release`

Is replaced with:

nis_domain=`domainname 2>/dev/null`
if [ "$nis_domain" == "" ]; then
  nis_domain=`hostname -y 2>/dev/null`
fi
echo 'domain: ' $nis_domain | sed -e 's/(none)//'
 os=""
if [ "$os" = "" -a -f /etc/redhat-release ]; then
    os=`cat /etc/redhat-release`

    # 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
 if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then
     # We'd like to use -ds but that puts quotes in the output!
     os=`/usr/bin/lsb_release -d | cut -f2 -d:`

 fi
 if [ "$os" = "" -a -f /etc/vmware-release ]; then
     os=`grep ESX /etc/vmware-release`
 fi
 if [ "$os" = "" -a -f /etc/SuSE-release ]; then
     os=`head -n 1 /etc/SuSE-release`

OpenBSD

initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

NetBSD

initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

HPUX

initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u

VMware ESX

getNetworkConnectionList

The following code:

 
PRIV_NETSTAT netstat -aneep --tcp --udp 2>/dev/null

Is replaced with:

PRIV_NETSTAT netstat -aneep --tcp --udp -T 2>/dev/null
if [ $? -eq 4 ]; then
    # netstat failed due to invalid option, try -W
    PRIV_NETSTAT netstat -aneep --tcp --udp -W 2>/dev/null
    if [ $? -eq 4 ]; then
        # netstat still failed, try without any wide option
        PRIV_NETSTAT netstat -aneep --tcp --udp 2>/dev/null
    fi
fi

VMware ESX

getHostInfo

The following code:

 
                     if [ `echo ${opteron_number} | cut -c1` -eq 4 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 41xx where xx is lower than 60 are 4 cores
                            core_hint=4
                            sibling=4
                         else
                             # 41xx where xx is higher than 60 are 6 cores                    
                             cores_hint=6

Is replaced with:

                     if [ `echo ${opteron_number} | cut -c1` -eq 4 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 41xx where xx is lower than 60 are 4 cores
                            cores_hint=4
                            siblings=4
                         else
                             # 41xx where xx is higher than 60 are 6 cores                    
                             cores_hint=6

The following code:

 
                     elif [ `echo ${opteron_number} | cut -c1` -eq 6 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 61xx where xx is lower than 60 are 8 cores
                            core_hint=8
                            sibling=8
                         else
                             # 61xx where xx is higher than 60 are 12 cores                    
                            core_hint=12
                            sibling=12

Is replaced with:

                     elif [ `echo ${opteron_number} | cut -c1` -eq 6 ]; then
                         if [ `echo ${opteron_number} | cut -c3` -lt 6 ]; then
                             # 61xx where xx is lower than 60 are 8 cores
                            cores_hint=8
                            siblings=8
                         else
                             # 61xx where xx is higher than 60 are 12 cores                    
                            cores_hint=12
                            siblings=12

VMware ESX

initialise

The following code:

 
# insulate against systems with -u set by default
set +u

Is replaced with:

# Stop alias commands changing behaviour.
unalias -a

# Insulate against systems with -u set by default.
 set +u
getDeviceInfo

The following code:

 
 echo 'dns_domain: ' $dns_domain
echo 'domain:' `hostname -y 2>/dev/null | sed -e 's/(none)//'`
 os=""
 if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then
     # We'd like to use -ds but that puts quotes in the output!
     os=`/usr/bin/lsb_release -d | cut -f2 -d:`
 fi
 if [ "$os" = "" -a -f /etc/vmware-release ]; then
     os=`grep ESX /etc/vmware-release`
fi
if [ "$os" = "" -a -f /etc/redhat-release ]; then
    os=`cat /etc/redhat-release`

    # 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
 if [ "$os" = "" -a -f /etc/SuSE-release ]; then
     os=`head -n 1 /etc/SuSE-release`

Is replaced with:

 echo 'dns_domain: ' $dns_domain

nis_domain=`domainname 2>/dev/null`
if [ "$nis_domain" == "" ]; then
  nis_domain=`hostname -y 2>/dev/null`
fi
echo 'domain: ' $nis_domain | sed -e 's/(none)//'
 
 os=""
if [ "$os" = "" -a -f /etc/redhat-release ]; then
    os=`cat /etc/redhat-release`

    # 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
 if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then
     # We'd like to use -ds but that puts quotes in the output!
     os=`/usr/bin/lsb_release -d | cut -f2 -d:`
 fi
 if [ "$os" = "" -a -f /etc/vmware-release ]; then
     os=`grep ESX /etc/vmware-release`
 fi
 if [ "$os" = "" -a -f /etc/SuSE-release ]; then
     os=`head -n 1 /etc/SuSE-release`

Discovery command changes from 8.3 to 8.3 SP1

There have been no discovery command changes between BMC Atrium Discovery 8.3 and 8.3 SP1

Discovery command changes from 8.2.03 to 8.3

 Click this link to show the discovery command changes from 8.2.03 to 8.3

Solaris

The PATH is changed.
The following code:

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

is replaced with:

/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

Changed method:

  • getHBAList – enabled changed: was hbainfo, now hba_lputil

The following code is added:

echo 'arp:'
arp -a -n 2>/dev/null | awk '{ if ( $4 ~ /SP/ ) { print $2, $5 } }'
echo 'end arp'

The following code:

NDD=`which ndd` 
TW_KSTAT=`which kstat 2>/dev/null`
if [ -x "$TW_KSTAT" ]

is replaced with:

NDD=`tw_which ndd`
KSTAT=`tw_which kstat`
if [ -x "$KSTAT" ]

The following code:

kstat -p -m $iface 2>/dev/null

is replaced with:

$KSTAT -p -m $iface 2>/dev/null

The following code:

instance=`PRIV_NDD $NDD -get /dev/$NIC_TYPE instance`

is replaced with:

instance=`PRIV_NDD $NDD -get /dev/$NIC_TYPE instance 2>/dev/null`

The following code:

if [ -d "${P}" -a -r "${P}" ]; then
    (cd "${P}"; ls -al)

is replaced with:

PRIV_TEST -d "${P}" -a -r "${P}" > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd "${P}"; PRIV_LS -al)

The following code is added:

# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
   test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

tw_which() {
  SAVE=$IFS
  IFS=:
  for d in $PATH
  do
    if [ -x $d/$1 -a ! -d $d/$1 ]
    then
        echo $d/$1
        break
    fi
  done
  IFS=$SAVE
}

The following code is added:

# fcinfo requires superuser privileges to display any HBA information
PRIV_FCINFO() {
    "$@"
}

The following code:

if [ -f "${P}" ]; then
    echo "ls:" `ls -ld "${P}"`
    if [ -x `which digest` ]; then
        echo "md5sum:" `digest -a md5 "${P}" 2>/dev/null`

is replaced with:

PRIV_TEST -f "${P}" > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld "${P}"`
    DIGEST=`tw_which digest`
    if [ -x "$DIGEST" ]; then
        echo "md5sum:" `$DIGEST -a md5 "${P}" 2>/dev/null`

Solaris: getHBAList: hbainfo: REMOVED
Solaris: getHBAList: hba_lputil: ADDED

The following code:

showrev -p 2>/dev/null | cut -c-16 | nawk '{print $2;}'

is replaced with:

showrev -p 2>/dev/null | grep -v "No patches are installed" | cut -c-16 | nawk '{print $2;}'

AIX

The following code is added:

num_logical_processors=`egrep '^Online Virtual CPUs' /tmp/tideway.$$ | cut -f2 -d:`

The following code:

echo 'model:' `egrep '^System Model:' /tmp/tideway.$$ | cut -f2 -d:`

is replaced with:

echo 'model:' `egrep '^System Model:' /tmp/tideway.$$ | cut -f2 -d: | sed -e 's/IBM,//'`

The following code:

num_logical_processors=`egrep '^Number Of Processors:' /tmp/tideway.$$ | cut -f2 -d:`

is replaced with:

# Use this processor value if lparstat failed
if [ "$num_logical_processors" = "" ]; then
    num_logical_processors=`egrep '^Number Of Processors:' /tmp/tideway.$$ | cut -f2 -d:`
fi

The following code:

num_logical_processors=`lscfg -lproc\* 2>/dev/null | wc -l`

is replaced with:

# Use this processor value if lparstat failed
if [ "$num_logical_processors" = "" ]; then
    num_logical_processors=`lscfg -lproc\* 2>/dev/null | wc -l`
fi

The following code:

     echo "num_processors": $num_physical_processors
     echo "num_logical_processors:" $num_logical_processors
     echo "processor_type:" $cputype $cpuspeed
     echo "processor_speed:" $cpuspeed
 fi

is replaced with:

fi
if [ "$num_physical_processors" != "" ]; then
     echo "num_processors": $num_physical_processors
fi
if [ "$num_logical_processors" != "" ]; then
     echo "num_logical_processors:" $num_logical_processors
fi
if [ "$cputype" != "" -a "$cpuspeed" != "" ]; then
     echo "processor_type:" $cputype $cpuspeed
     echo "processor_speed:" $cpuspeed
fi

The following code is added:

num_logical_processors=`egrep '^Online Virtual CPUs' /tmp/tideway.$$ | cut -f2 -d:`

The following code:

echo 'model:' `egrep '^System Model:' /tmp/tideway.$$ | cut -f2 -d:`

is replaced with:

echo 'model:' `egrep '^System Model:' /tmp/tideway.$$ | cut -f2 -d: | sed -e 's/IBM,//'`

The following code:

num_logical_processors=`egrep '^Number Of Processors:' /tmp/tideway.$$ | cut -f2 -d:`

is replaced with:

# Use this processor value if lparstat failed
if [ "$num_logical_processors" = "" ]; then
    num_logical_processors=`egrep '^Number Of Processors:' /tmp/tideway.$$ | cut -f2 -d:`
fi

The following code:

num_logical_processors=`lscfg -lproc\* 2>/dev/null | wc -l`

is replaced with:

# Use this processor value if lparstat failed
if [ "$num_logical_processors" = "" ]; then
    num_logical_processors=`lscfg -lproc\* 2>/dev/null | wc -l`
fi

The following code:

echo "num_processors": $num_physical_processors
echo "num_logical_processors:" $num_logical_processors
echo "processor_type:" $cputype $cpuspeed
echo "processor_speed:" $cpuspeed
fi

is replaced with:

fi
if [ "$num_physical_processors" != "" ]; then
    echo "num_processors": $num_physical_processors
fi
if [ "$num_logical_processors" != "" ]; then
    echo "num_logical_processors:" $num_logical_processors
fi
if [ "$cputype" != "" -a "$cpuspeed" != "" ]; then
    echo "processor_type:" $cputype $cpuspeed
    echo "processor_speed:" $cpuspeed
fi

The following code:

if [ `uname -v` -ge 6 ]; then
    wparaddrs=`lswpar -Nqa address 2>/dev/null | xargs echo | sed -e 's/\./\./g
' -e 's/ /|/g'`
fi
if [ "$wparaddrs" = "" ]; then
    ifconfig -a 2>/dev/null
else
    ifconfig -a 2>/dev/null | egrep -v "$wparaddrs"

is replaced with:

if [ `uname -v` -lt 5 ]; then
    for name in `netstat -i | cut -f 1 -d\  | grep -Ev '^Name|^lo0|^$' | sort -u`
    do
        ifconfig $name 2>/dev/null
    done
else
    if [ `uname -v` -ge 6 ]; then
        wparaddrs=`lswpar -Nqa address 2>/dev/null | xargs echo | sed -e 's/\./\./g
' -e 's/ /|/g'`
    fi
    if [ "$wparaddrs" = "" ]; then
        ifconfig -a 2>/dev/null
    else
        ifconfig -a 2>/dev/null | egrep -v "$wparaddrs"
    fi

The following code:

if [ `uname -v` -ge 6 ]; then
    wparaddrs=`lswpar -Nqa address 2>/dev/null | xargs echo | sed -e 's/\./\./g
' -e 's/ /|/g'`
fi
if [ "$wparaddrs" = "" ]; then
    ifconfig -a 2>/dev/null
else
    ifconfig -a 2>/dev/null | egrep -v "$wparaddrs"

is replaced with:

if [ `uname -v` -lt 5 ]; then
    for name in `netstat -i | cut -f 1 -d\  | grep -Ev '^Name|^lo0|^$' | sort -u`
    do
        ifconfig $name 2>/dev/null
    done
else
    if [ `uname -v` -ge 6 ]; then
        wparaddrs=`lswpar -Nqa address 2>/dev/null | xargs echo | sed -e 's/\./\./g
' -e 's/ /|/g'`
    fi
    if [ "$wparaddrs" = "" ]; then
        ifconfig -a 2>/dev/null
    else
        ifconfig -a 2>/dev/null | egrep -v "$wparaddrs"
    fi

The following code:

entstat -d ${adapter} 2>/dev/null | egrep "(Media Speed)|(Hardware Address)" 2>/dev/null

is replaced with:

entstat -d ${adapter} 2>/dev/null | egrep "(ETHERNET STATISTICS)|(Device Type)|(Media Speed)|(Hardware Address)|(PVID)|(Port VLAN ID)" 2>/dev/null

The following code is added:

echo 'begin lsdev-lscfg:'
for i in `lsdev -Cc adapter -F name:status | grep "^en"`
do
  adapter=`echo $i | cut -f1 -d:`
  status=`echo $i | cut -f2 -d:`

  if [ $status = "Available" ]; then
    echo Begin-interface: $adapter
    lscfg -vl $adapter 2>/dev/null
    echo End-interface: $adapter
  fi
done
echo 'end lsdev-lscfg:'

# VIO support
if [ -x /usr/ios/cli/ioscli ]; then
  echo begin ioscli-lsmap-all:
  /usr/ios/cli/ioscli lsmap -all -net -fmt ":"
  echo end ioscli-lsmap-all:
fi

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code is added:

# Clear any shell aliases on VIO
unalias uname
unalias hostname
unalias lsdev
unalias netstat

The following code is added:

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

osver=`oslevel 2>/dev/null`
if [ $? -ne 0 ]; then
    osver=""
fi
if [ "$osver" = "" -o "$osver" = "TYPERML" ]; then
    osmaj=`uname -v 2>/dev/null`
    osmin=`uname -r 2>/dev/null`
    osver="$osmaj.$osmin"
fi
echo 'os:' `uname -s 2>/dev/null` $osver
echo 'os_arch:' `uname -p 2>/dev/null`

is replaced with:

# VIO support
if [ -f /usr/ios/cli/ios.level ]; then
    viover=`cat /usr/ios/cli/ios.level`
    os="VIO $viover"
else
    osver=`oslevel 2>/dev/null`
    if [ $? -ne 0 ]; then
        osver=""
    fi
    if [ "$osver" = "" -o "$osver" = "TYPERML" ]; then
        osmaj=`uname -v 2>/dev/null`
        osmin=`uname -r 2>/dev/null`
        osver="$osmaj.$osmin"
    fi
    os="`uname -s 2>/dev/null` $osver"
fi
echo 'os:' $os
echo 'os_arch:' `uname -p 2>/dev/null`

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s` 

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s` 

Mac OS-X

The following code:

grep "Memory: " /tmp/tideway-hw-$$ | sed 's/^.*: \(.*\)$/ram: \1/'

is replaced with:

grep "^[[:blank:]]*Memory: " /tmp/tideway-hw-$$ | sed 's/^.*: \(.*\)$/ram: \1/'

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -alT)

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
 PRIV_TEST() {
   test "$@"
 }

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -lTd %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -lTd %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

IRIX

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

 # This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directorie
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s`
else
    echo "FILE NOT FOUND"
fi

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s`
else
    echo "FILE NOT FOUND"
fi

Tru64

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

 # This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s`
else
    echo "FILE NOT FOUND"
fi

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s`
else
    echo "FILE NOT FOUND"
fi

Mainframe

New methods:

  • getApplication
  • getDependency

Changed methods:

  • getDatabaseDetail – enabled changed: was False, now True.
  • getTransaction – enabled changed: was False, now True.
  • getMQDetail – enabled changed: was False, now True.

UnixWare

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s`
else
    echo "FILE NOT FOUND"
fi

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s`
else
    echo "FILE NOT FOUND"
fi

FreeBSD

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -lTd %(path)s`
    echo "md5sum:" `md5 -q %(path)s 2>/dev/null`
else
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -lTd %(path)s`
    echo "md5sum:" `md5 -q %(path)s 2>/dev/null`
else
    echo "FILE NOT FOUND"

Linux

The following code:

if [ "${model}" != "" ]; then
    echo 'model:' ${model}
fi

is replaced with:

if [ "${model}" != "" ]; then
    echo 'candidate_model[]:' ${model}
fi

The following code:

    echo 'serial:' ${serial}
fi

if [ "${model}" != "" ]; then
    echo 'model:' ${model}
fi

is replaced with:

    echo 'candidate_serial[]:' ${serial}
fi

if [ "${model}" != "" ]; then

    echo 'candidate_model[]:' ${model}
fi

The following code:

    # On a VMWare ESX controller, report the *real* hardware information
    file=/tmp/tideway-hw-$$
    PRIV_ESXCFG /usr/sbin/esxcfg-info --hardware > ${file} 2>/dev/null
    if [ $? -eq 0 ]; then
        physical=`grep "Num Packages\." ${file} | sed -e "s/[Changes to Discovery Commands^0-9]//g"`
        logical=`grep "Num Cores." ${file} | head -n 1 | sed -e "s/[Changes to Discovery Commands^0-9]//g"`
        tmp=`echo ${cputype} | sed 's/ @.*$//'`
        cputype="${tmp} ${cpuspeed}"
        ram=`grep "Physical Mem\." ${file} | sed 's/[Changes to Discovery Commands^0-9]*//g'`B
    else
        print=0
    fi
    rm -f ${file}

fi
if [ -f /opt/xensource/bin/xe ]; then
    print=0
  }
}'

is replaced with:

    # On a VMWare ESX controller, report the *real* hardware information
    file=/tmp/tideway-hw-$$
    PRIV_ESXCFG /usr/sbin/esxcfg-info --hardware > ${file} 2>/dev/null
    uuid=""
    if [ $? -eq 0 ]; then
        physical=`grep "Num Packages\." ${file} | sed -e "s/[Changes to Discovery Commands^0-9]//g"`
        logical=`grep "Num Cores." ${file} | head -n 1 | sed -e "s/[Changes to Discovery Commands^0-9]//g"`
        tmp=`echo ${cputype} | sed 's/ @.*$//'`
        cputype="${tmp} ${cpuspeed}"
        ram=`grep "Physical Mem\." ${file} | sed 's/[Changes to Discovery Commands^0-9]*//g'`B
        uuid=`grep "BIOS UUID\." ${file}`
    else
        print=0
    fi
    rm -f ${file}

    # Get UUID as hostid if possible
    if [ "$uuid" != "" ]; then
        # Process horrid BIOS UUID format :(
        echo "$uuid" | sed -e 's/\./ /g' | awk '{
printf("hostid: ");
for(i = 3 ; i < 19; i++)
{
    printf("%02s", substr($i,3,2));
    if (i == 6 || i == 8 || i == 10 || i == 12) printf("-");
}
printf("\n");
}'
    else
        if [ -r /etc/slp.reg ]; then
            uuid=`grep hardwareUuid /etc/slp.reg | cut -f2 -d= | tr '[:upper:]' '[:lower:]' | sed -e 's/"//g'`
            if [ "${uuid}" != "" ]; then
                echo 'hostid:' ${uuid}
            fi
        fi
    fi
fi
if [ -f /opt/xensource/bin/xe ]; then
    print=0
  }
}'

The following code:

# Can we get information from the BIOS?
if [ -f /usr/sbin/dmidecode ]; then 
    PRIV_DMIDECODE /usr/sbin/dmidecode 2>/dev/null | sed -n '/DMI type 1,/,/^Handle 0x0/p' | awk '
    $1 ~ /Manufacturer:/ { sub(".*Manufacturer: *",""); printf( "vendor: %s\n", $0); } 
    $1 ~ /Vendor:/ { sub(".*Vendor: *",""); printf( "vendor: %s\n", $0 ); } 
    $1 ~ /Product/ && $2 ~ /Name:/ { sub(".*Product Name: *",""); printf( "model:  %s\n", $0 ); } 
    $1 ~ /Product:/ { sub(".*Product: *",""); printf( "model: %s\n", $0 ); } 
    $1 ~ /Serial/ && $2 ~ /Number:/ { sub(".*Serial Number: *",""); printf( "serial: %s\n", $0 ); } ' 
fi

if [ -f /usr/sbin/hwinfo ]; then 
    PRIV_HWINFO /usr/sbin/hwinfo --bios 2>/dev/null | sed -n '/System Info:/,/Info:/p' | awk ' 
    $1 ~ /Manufacturer:/ { sub(".*Manufacturer: *",""); gsub( "\"", ""); printf( "vendor: %s\n", $0 ); } 
    $1 ~ /Product:/ { sub(".*Product: *",""); gsub( "\"", ""); printf( "model: %s\n", $0 ); } 
    $1 ~ /Serial:/ { sub(".*Serial: *",""); gsub( "\"", ""); printf( "serial: %s\n", $0 ); }' 
fi

# PPC64 LPAR?
if [ -f /proc/ppc64/lparcfg ]; then
    sed -e 's/=/: /' /proc/ppc64/lparcfg | egrep '^[a-z]' | sed -e 's/^serial_number/serial/' -e 's/^system_type/model/' -e 's/partition_id/lpar_id/' -e 's/^group/lpar_partition_group_id/' -e 's///'
fi

# zLinux?
if [ -f /proc/sysinfo -a -d /proc/dasd ]; then
    echo "vendor:" `egrep '^Manufacturer:' /proc/sysinfo | awk '{print $2;}'`
    type=`egrep '^Type:' /proc/sysinfo | awk '{print $2;}'`
    model=`egrep '^Model:' /proc/sysinfo | awk '{print $2;}'`
    echo "model: $type-$model"
    echo "zlinux_seqence:" `egrep '^Sequence Code:' /proc/sysinfo | awk '{print $3;}'`
    echo "zlinux_vm_name:" `egrep '^VM00 Name:' /proc/sysinfo | awk '{print $3;}'`
    echo "zlinux_vm_software:" `egrep '^VM00 Control Program:' /proc/sysinfo | awk '{print $4, $5;}'`
fi

is replaced with:

# zLinux?
if [ -f /proc/sysinfo -a -d /proc/dasd ]; then

    echo "candidate_vendor[]:" `egrep '^Manufacturer:' /proc/sysinfo | awk '{print $2;}'`
    type=`egrep '^Type:' /proc/sysinfo | awk '{print $2;}'`
    model=`egrep '^Model:' /proc/sysinfo | awk '{print $2;}'`
    echo "candidate_model[]: $type-$model"
    echo "zlinux_sequence:" `egrep '^Sequence Code:' /proc/sysinfo | awk '{print $3;}'`
    echo "zlinux_vm_name:" `egrep '^VM00 Name:' /proc/sysinfo | awk '{print $3;}'`
    echo "zlinux_vm_software:" `egrep '^VM00 Control Program:' /proc/sysinfo | awk '{print $4, $5;}'`
fi

# Can we get information from the BIOS? We use lshal if available as that
# requires no superuser permissions but we attempt to run all tools as some
# can return invalid values in some cases. The system will select the "best"
# candidate from the values returned, where "best" is the first non-bogus value
if [ -x /usr/bin/lshal ]; then 
    /usr/bin/lshal 2>/dev/null | sed -e 's/(string)$//g' -e "s/'//g" | awk '
    $1 ~ /system.hardware.serial/ {
        sub(".*system.hardware.serial = *", "");
        printf("candidate_serial[]: %s\n", $0);
    }
    $1 ~ /system.hardware.uuid/ {
        sub(".*system.hardware.uuid = *", "");
        printf("candidate_uuid[]: %s\n", $0);
    }
    $1 ~ /system.hardware.product/ {
        sub(".*system.hardware.product = *", "");
        printf("candidate_model[]: %s\n", $0);
    }
    $1 ~ /system.hardware.vendor/ {
        sub(".*system.hardware.vendor = *", "");
        printf("candidate_vendor[]: %s\n", $0);
    }'
fi
if [ -f /usr/sbin/dmidecode ]; then
        PRIV_DMIDECODE /usr/sbin/dmidecode 2>/dev/null | sed -n '/DMI type 1,/,/^Handle 0x0/p' | awk '
    $1 ~ /Manufacturer:/ { sub(".*Manufacturer: *", ""); printf("candidate_vendor[]: %s\n", $0); }
    $1 ~ /Vendor:/ { sub(".*Vendor: *", ""); printf("candidate_vendor[]: %s\n", $0); }
    $1 ~ /Product/ && $2 ~ /Name:/ { sub(".*Product Name: *", ""); printf("candidate_model[]: %s\n", $0); }
    $1 ~ /Product:/ { sub(".*Product: *",""); printf("candidate_model[]: %s\n", $0 ); }
    $1 ~ /Serial/ && $2 ~ /Number:/ { sub(".*Serial Number: *", ""); printf("candidate_serial[]: %s\n", $0); }
    $1 ~ /UUID:/ { sub(".*UUID: *", ""); printf( "candidate_uuid[]: %s\n", $0 ); } '
fi
if [ -f /usr/sbin/hwinfo ]; then
        PRIV_HWINFO /usr/sbin/hwinfo --bios 2>/dev/null | sed -n '/System Info:/,/Info:/p' | awk '
    $1 ~ /Manufacturer:/ { sub(".*Manufacturer: *", ""); gsub("\"", ""); printf("candidate_vendor[]: %s\n", $0); }
    $1 ~ /Product:/ { sub(".*Product: *", ""); gsub("\"", ""); printf("candidate_model[]: %s\n", $0); }
    $1 ~ /Serial:/ { sub(".*Serial: *", ""); gsub("\"", ""); printf("candidate_serial[]: %s\n", $0); }
    $1 ~ /UUID:/ { sub(".*UUID: *", ""); gsub("\"", ""); printf("candidate_uuid[]: %s\n", $0); } ' 
fi

# PPC64 LPAR?
if [ -r /proc/ppc64/lparcfg ]; then
    echo begin lparcfg:
    cat /proc/ppc64/lparcfg 2>/dev/null
    echo end lparcfg
fi
# LPAR name?
if [ -r /proc/device-tree/ibm,partition-name ]; then
    echo "lpar_partition_name:" `cat /proc/device-tree/ibm,partition-name`
fi

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -a --full-time --color=never)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -a --full-time --color=never)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code is removed:

# emlxadm requires superuser privileges to display any HBA information
PRIV_EMLXADM() {
    "$@"
}

The following code:

os=""

if [ "$os" = "" -a -e /proc/vmware/version ]; then
    os=`grep -m1 ESX /proc/vmware/version`
fi

if [ "$os" = "" -a -f /etc/SuSE-release ]; then
    os=`head -n 1 /etc/SuSE-release`
fi
if [ "$os" = "" -a -f /etc/lsb-release ]; then
    ostype=`grep DISTRIB_ID /etc/lsb-release | cut -f2 -d=`
    osver=`grep DISTRIB_RELEASE /etc/lsb-release | cut -f2 -d=`
    os="$ostype $osver"
fi
if [ "$os" = "" -a -f /etc/debian_version ]; then
    ver=`cat /etc/debian_version`
    os="Debian Linux $ver"


is replaced with:

os=""

if [ "$os" = "" -a -x /usr/bin/lsb_release ]; then
    # We'd like to use -ds but that puts quotes in the output!
    os=`/usr/bin/lsb_release -d | cut -f2 -d:`
fi
if [ "$os" = "" -a -e /proc/vmware/version ]; then
    os=`grep -m1 ESX /proc/vmware/version`
fi

if [ "$os" = "" -a -f /etc/SuSE-release ]; then
    os=`head -n 1 /etc/SuSE-release`
fi

if [ "$os" = "" -a -f /etc/debian_version ]; then
    ver=`cat /etc/debian_version`
    os="Debian Linux $ver"

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

Changed method:

  • getHBAList – enabled changed: was hbainfo, now hba_lputil

OpenBSD

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -lTd %(path)s`
    echo "md5sum:" `md5 -q %(path)s 2>/dev/null`
else
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -lTd %(path)s`
    echo "md5sum:" `md5 -q %(path)s 2>/dev/null`
else
    echo "FILE NOT FOUND"

NetBSD

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -alT)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -lTd %(path)s`
    echo "md5sum:" `md5 -q %(path)s 2>/dev/null`
else
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -lTd %(path)s`
    echo "md5sum:" `md5 -q %(path)s 2>/dev/null`
else
    echo "FILE NOT FOUND"

HP-UX

The following code:

par_id=`/usr/sbin/parstatus -w 2> /dev/null | grep "The local partition number is" | sed 's/.*The local partition number is \([0-9]*\)\..*/\1/'`
if [ "$par_id" ]; then
    echo par_id: $par_id
    par_status=`/usr/sbin/parstatus -C -M | grep "$par_id"\$`
    for i in `echo "$par_status" | sed 's/^[Changes to Discovery Commands^:]*:[Changes to Discovery Commands^:]*:[Changes to Discovery Commands^:]*: *\([0-9]*\).*/\1/'`; do
        cores=$((cores + i))
    done
    for i in `echo "$par_status" | sed 's/^[Changes to Discovery Commands^:]*:[Changes to Discovery Commands^:]*:[Changes to Discovery Commands^:]*:[Changes to Discovery Commands^:]*: *\([0-9]*\).*/\1/'`; do
        ram=$((ram + i))
    done
    ram=`echo "$ram" '* 1048576 * 1024' | bc`
    echo ram: $ram
fi

is replaced with:

par_id=`/usr/sbin/parstatus -w 2> /dev/null | grep "The local partition number is" | sed 's/.*The local partition number is \([0-9]*\)\..*/\1/'`
if [ "$par_id" ]; then
    echo par_id: $par_id
    cpumem=`/usr/sbin/parstatus -C -M |awk -v PAR_ID=$par_id 'BEGIN{ FS=":" };{ if ($NF==PAR_ID) { split($4,cpuarray,"/"); split($5,memarray,"/"); cpu+=cpuarray[1]; mem+=int(memarray[1])} };END{ printf "%d %d\n",cpu,mem }'`
    cores=`echo "$cpumem" |awk '{print $1}'`
    ram=`echo "$cpumem" |awk '{print $2}'`
    ram=`echo "$ram" '* 1048576 * 1024' | bc`
    echo ram: $ram
fi

The following code:

interfaces=`netstat -in 2>/dev/null | cut -d\  -f 1 | grep -Ev '\*|^Name|^lo0|^IP|^$' | sort -u`
for interface in $interfaces
do
  ifconfig $interface 2>/dev/null

is replaced with:

netstat -inw > /tmp/addm.$$ 2>/dev/null
if [ $? -ne 0 ]; then
  netstat -in > /tmp/addm.$$ 2>/dev/null
fi
interfaces=`cat /tmp/addm.$$ | cut -d\  -f 1 | grep -Ev '\*|^Name|^lo0|^IP|^$' | sort -u`
rm /tmp/addm.$$
for interface in $interfaces
do
  ifconfig $interface 2>/dev/null

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -al)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT.
PRIV_TEST() {
  test "$@"
}

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else        
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else        
    echo "FILE NOT FOUND"

VMware ESXi

The following code is added:

# Get UUID as hostid if possible
uuid=`/sbin/smbiosDump | grep UUID | grep -v undefined`
if [ "$uuid" != "" ]; then
    # UUID from smbiosDump is not formated and bytes are reversed :(
    echo $uuid | awk '{
        sub(".*UUID: *","");
        printf("hostid: %s%s%s%s-%s%s-%s%s-%s%s-%s%s%s%s%s%s\n",
        substr($0,31,2), substr($0,29,2), substr($0,27,2), substr($0,25,2),
        substr($0,23,2), substr($0,21,2), substr($0,19,2), substr($0,17,2),
        substr($0,15,2), substr($0,13,2), substr($0,11,2), substr($0,9,2),
        substr($0,7,2),  substr($0,5,2),  substr($0,3,2),  substr($0,1,2));
    }'
else
    # Attempt to get UUID from slp.reg
    if [ -r /etc/slp.reg ]; then
        uuid=`grep hardwareUuid /etc/slp.reg | cut -f2 -d= | tr '[:upper:]' '[:lower:]' | sed -e 's/"//g'`
        if [ "${uuid}" != "" ]; then
            echo 'hostid:' ${uuid}
        fi
    fi
fi

The following code:

if [ -d %(path)s -a -r %(path)s ]; then
    (cd %(path)s; ls -lae --color=never)
else
    echo 'DIRECTORY NOT FOUND'
fi

is replaced with:

PRIV_TEST -d %(path)s -a -r %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    (cd %(path)s; PRIV_LS -lae --color=never)
else
    echo 'DIRECTORY NOT FOUND'
fi

The following code:

 # This function supports privilege testing of attributes of files.
-# Used in conjunction with PRIV_CAT.
 PRIV_TEST() {
   test "$@"
 }

is replaced with:

# This function supports privilege testing of attributes of files.
# Used in conjunction with PRIV_CAT and PRIV_LS
PRIV_TEST() {
  test "$@"
}

# This function supports privilege listing of files and directories
# Used in conjunction with PRIV_TEST 
PRIV_LS() {
  ls "$@"
}

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

The following code:

if [ -f %(path)s ]; then
    echo "ls:" `ls -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

is replaced with:

PRIV_TEST -f %(path)s > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
    echo "ls:" `PRIV_LS -ld %(path)s`
    echo "md5sum:" `md5sum %(path)s 2>/dev/null | awk '{print $1;}'`
else
    echo "FILE NOT FOUND"

The following code:

ihn=`hostname -s 2>/dev/null`
if [ "$ihn" = "localhost" ]; then
    ihn=`hostname 2>/dev/null`
fi
echo 'hostname:' $ihn

is replaced with:

ihn=`hostname -s 2>/dev/null`
if [ "$ihn" = "" -o "$ihn" = "localhost" ]; then
    ihn=`hostname 2>/dev/null`
fi
echo 'hostname:' $ihn
Was this page helpful? Yes No Submitting... Thank you

Comments