Changes to Discovery commands
The following changes are not shown:
- Entirely new discovery platforms
- Changes to comments only
- Commands which have been removed and not replaced
- Changes to echo only statements
Discovery command changes from 11.2 to 11.3
Linux
getHostInfo
The following code:
if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then # This web request is not chargeable. # See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html aws_instance_id=`curl http://instance-data/latest/meta-data/instance-id 2>/dev/null` fi
is replaced with:
if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then # This web request is not chargeable. # See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html aws_instance_id=`curl --connect-timeout 5 --fail http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null | egrep '^i-[0-9a-f]+$'` fi
getMACAddresses
The following code:
ip -o link show 2>/dev/null
is replaced with:
ip -d -o link show 2>/dev/null | egrep -v '\bbridge(_slave)?|vxlan|openvswitch(_slave)?|veth\b'
getDeviceInfo
The following code:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) os_id=`egrep ^ID= /etc/os-release | cut -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi
is replaced with:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) and Container Linux os_id=`egrep ^ID= /etc/os-release | cut -s -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" -o "$os_id" = "coreos" ]; then os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi
HP-UX
getHostInfo
The following code:
ram=`echo "selclass qualifier memory;infolog" | cstm 2>/dev/null | grep 'System Total'`
is replaced with:
ram=`echo "selclass qualifier memory;infolog" | PRIV_CSTM cstm 2>/dev/null | grep 'System Total'`
initialise
The following code is added:
# This function supports running privileged cstm command PRIV_CSTM() { "$@" }
VMware ESX
getHostInfo
The following code:
if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then # This web request is not chargeable. # See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html aws_instance_id=`curl http://instance-data/latest/meta-data/instance-id 2>/dev/null` fi
is replaced with:
if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then # This web request is not chargeable. # See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html aws_instance_id=`curl --connect-timeout 5 --fail http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null | egrep '^i-[0-9a-f]+$'` fi
getMACAddresses
The following code:
ip -o link show 2>/dev/null
is replaced with:
ip -d -o link show 2>/dev/null | egrep -v '\bbridge(_slave)?|vxlan|openvswitch(_slave)?|veth\b'
getDeviceInfo
The following code:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) os_id=`egrep ^ID= /etc/os-release | cut -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi
is replaced with:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) and Container Linux os_id=`egrep ^ID= /etc/os-release | cut -s -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" -o "$os_id" = "coreos" ]; then os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi
Discovery command changes from 11.1 to 11.2
Solaris
getHostInfo
The following code:
if [ $os_ver -ge 11 ]; then pkg list -H --no-refresh system/kernel | awk '{print "kernel:", $2; exit}' else showrev 2>/dev/null | nawk -F: '/^Kernel version/ {gsub("^ *", "", $2); print "kernel:", $2; exit}' fi echo 'model:' `uname -i 2>/dev/null` /usr/sbin/prtconf 2>/dev/null | nawk '/^Memory size:/ {print "ram: " $3 "MB"}'
is replaced with:
if [ $os_ver -ge 11 ]; then pkg list -H --no-refresh system/kernel | awk '{print "kernel:", $(NF-1); exit}' else showrev 2>/dev/null | nawk -F: '/^Kernel version/ {gsub("^ *", "", $2); print "kernel:", $2; exit}' fi echo 'model:' `uname -i 2>/dev/null` echo 'begin prtconf:' /usr/sbin/prtconf 2>/dev/null | egrep "System Configuration:|Memory size:" echo 'end prtconf'
getProcessList: ps: cmd changed:
The following code:
if [ $os_ver -ge 10 -a -x /usr/bin/zonename ]; then zone=`/usr/bin/zonename 2>/dev/null` ps -eo pid,ppid,uid,user,zone,args 2>/dev/null | nawk "\$5~/^($zone|ZONE)$/ {print}" else ps -eo pid,ppid,uid,user,args 2>/dev/null fi if [ $os_ver -ge 11 ]; then PRIV_PS /usr/bin/ps axww 2>/dev/null
is replaced with:
if [ $os_ver -ge 10 -a -x /usr/bin/zonename ]; then zone=`/usr/bin/zonename 2>/dev/null` /usr/bin/ps -eo pid,ppid,uid,user,zone,args 2>/dev/null | nawk "\$5~/^($zone|ZONE)$/ {print}" else /usr/bin/ps -eo pid,ppid,uid,user,args 2>/dev/null fi if [ $os_ver -ge 11 ]; then PRIV_PS /usr/bin/ps axww 2>/dev/null
getFileSystems
The following code:
cat /etc/xtab fi echo end xtab: echo begin smbclient: smbclient -N -L localhost echo end smbclient:
is replaced with:
cat /etc/xtab fi echo end xtab: echo begin sharetab: if [ -r /etc/dfs/sharetab ]; then cat /etc/dfs/sharetab fi echo end sharetab: echo begin smbclient: smbclient -N -L localhost echo end smbclient:
getNetworkConnectionList
The following code:
netstat -an -f inet 2>/dev/null | grep -v '^ *\*\.\*' netstat -an -f inet6 2>/dev/null | grep -v '^ *\*\.\*'
is replaced with:
os_ver=`uname -r | cut -d. -f2` if [ $os_ver -gt 11 -o \( $os_ver -eq 11 -a `uname -v | cut -d. -f2` -ge 2 \) ]; then netstat -anu -f inet 2>/dev/null | grep -v '^ *\*\.\*' netstat -anu -f inet6 2>/dev/null | grep -v '^ *\*\.\*' else netstat -an -f inet 2>/dev/null | grep -v '^ *\*\.\*' netstat -an -f inet6 2>/dev/null | grep -v '^ *\*\.\*' fi
Tru64
getProcessList
The following code:
ps -eo pid,ppid,uid,user,args 2>/dev/null
is replaced with:
ps -eo pid,ppid,uid,user,args 2>/dev/null | cat
VMware ESXi
initialise
The following code:
# replace the following PRIV_XXX functions with one that has the path to a # program to run the commands as super user, e.g. sudo. For example # PRIV_LSOF() { # /usr/bin/sudo "$@" # } # lsof requires superuser privileges to display information on processes # other than those running as the current user PRIV_LSOF() { "$@" } # This function supports running privileged commands from patterns PRIV_RUNCMD() {
is replaced with:
# replace the following PRIV_XXX functions with one that has the path to a # program to run the commands as super user, e.g. sudo. For example # PRIV_CAT() { # /usr/bin/sudo cat "$@" # } # This function supports running privileged commands from patterns PRIV_RUNCMD() {
Linux
getHostInfo
The following code:
if [ -d /sys/class/dmi/id ]; then echo "candidate_model[]: " `cat /sys/class/dmi/id/product_name 2>/dev/null` echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null` echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null` echo "candidate_vendor[]: " `cat /sys/class/dmi/id/sys_vendor 2>/dev/null` fi
is replaced with:
if [ -d /sys/class/dmi/id ]; then model=`cat /sys/class/dmi/id/product_name 2>/dev/null` vendor=`cat /sys/class/dmi/id/sys_vendor 2>/dev/null` if [ -r /etc/system-release ]; then grep Amazon /etc/system-release >/dev/null 2>&1 if [ $? -eq 0 ]; then model="Amazon Virtual Machine" vendor="Amazon" fi fi echo "candidate_model[]: " "$model" echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null` echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null` echo "candidate_vendor[]: " "$vendor" fi # Trying to get the Amazon EC2 instance ID, if any. aws_instance_id="" if [ -x /opt/aws/bin/ec2-metadata ]; then aws_instance_id=`/opt/aws/bin/ec2-metadata -i 2>/dev/null | awk '{print $2; }'` fi if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then # This web request is not chargeable. # See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html aws_instance_id=`curl http://instance-data/latest/meta-data/instance-id 2>/dev/null` fi if [ "$aws_instance_id" != "" ]; then echo "aws_instance_id: " "$aws_instance_id" fi
getDeviceInfo
The following code:
if [ "$os" = "(none)" ]; then os="" elif [ "$os" != "" ]; then # Check to see if its a variant of Red Hat rpm -q oracle-logos > /dev/null 2>&1 if [ $? -eq 0 ]; then # Oracle variant os="Oracle $os" fi fi fi
is replaced with:
if [ "$os" = "(none)" ]; then os="" elif [ "$os" != "" ]; then if [ -f /etc/redhat-release ]; then # Check to see if its a variant of Red Hat # Early 4/5 version have /etc/enterprise-release without mentioning # Oracle in the name. if [ -f /etc/enterprise-release ]; then os="Oracle $os" elif [ -f /etc/oracle-release ]; then os=`cat /etc/oracle-release` fi fi fi fi
The following code:
# Check to see if its a variant of Red Hat rpm -q oracle-logos > /dev/null 2>&1 if [ $? -eq 0 ]; then # Oracle variant fi fi
is replaced with:
# Check to see if its a variant of Red Hat # Early 4/5 version have /etc/enterprise-release rather then # /etc/oracle-release without mentioning Oracle. if [ -f /etc/enterprise-release ]; then os="Oracle $os" elif [ -f /etc/oracle-release ]; then os=`cat /etc/oracle-release` fi fi
The following code:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) os_id=`grep ID= /etc/os-release | cut -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`grep ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then os=`grep PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi
is replaced with:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) os_id=`egrep ^ID= /etc/os-release | cut -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi if [ "$os" = "" -a -r /etc/system-release ]; then os=`cat /etc/system-release` fi
HPUX
getFileSystems
The following code:
fi echo end xtab: echo begin smbclient: smbclient -N -L localhost echo end smbclient:
is replaced with:
fi echo end xtab: echo begin sharetab: if [ -r /etc/dfs/sharetab ]; then cat /etc/dfs/sharetab fi echo end sharetab: echo begin smbclient: smbclient -N -L localhost echo end smbclient:
VMware ESX
getHostInfo
The following code:
if [ -d /sys/class/dmi/id ]; then echo "candidate_model[]: " `cat /sys/class/dmi/id/product_name 2>/dev/null` echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null` echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null` echo "candidate_vendor[]: " `cat /sys/class/dmi/id/sys_vendor 2>/dev/null` fi
is replaced with:
if [ -d /sys/class/dmi/id ]; then model=`cat /sys/class/dmi/id/product_name 2>/dev/null` vendor=`cat /sys/class/dmi/id/sys_vendor 2>/dev/null` if [ -r /etc/system-release ]; then grep Amazon /etc/system-release >/dev/null 2>&1 if [ $? -eq 0 ]; then model="Amazon Virtual Machine" vendor="Amazon" fi fi echo "candidate_model[]: " "$model" echo "candidate_serial[]: " `PRIV_CAT /sys/class/dmi/id/product_serial 2>/dev/null` echo "candidate_uuid[]: " `PRIV_CAT /sys/class/dmi/id/product_uuid 2>/dev/null` echo "candidate_vendor[]: " "$vendor" fi # Trying to get the Amazon EC2 instance ID, if any. aws_instance_id="" if [ -x /opt/aws/bin/ec2-metadata ]; then aws_instance_id=`/opt/aws/bin/ec2-metadata -i 2>/dev/null | awk '{print $2; }'` fi if [ -z "$aws_instance_id" -a -f /usr/bin/curl ]; then # This web request is not chargeable. # See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html aws_instance_id=`curl http://instance-data/latest/meta-data/instance-id 2>/dev/null` fi if [ "$aws_instance_id" != "" ]; then echo "aws_instance_id: " "$aws_instance_id" fi
getDeviceInfo
The following code:
if [ "$os" = "(none)" ]; then os="" elif [ "$os" != "" ]; then # Check to see if its a variant of Red Hat rpm -q oracle-logos > /dev/null 2>&1 if [ $? -eq 0 ]; then # Oracle variant os="Oracle $os" fi fi fi
is replaced with:
if [ "$os" = "(none)" ]; then os="" elif [ "$os" != "" ]; then if [ -f /etc/redhat-release ]; then # Check to see if its a variant of Red Hat # Early 4/5 version have /etc/enterprise-release without mentioning # Oracle in the name. if [ -f /etc/enterprise-release ]; then os="Oracle $os" elif [ -f /etc/oracle-release ]; then os=`cat /etc/oracle-release` fi fi fi fi
The following code:
# Check to see if its a variant of Red Hat rpm -q oracle-logos > /dev/null 2>&1 if [ $? -eq 0 ]; then # Oracle variant fi fi
is replaced with:
# Check to see if its a variant of Red Hat # Early 4/5 version have /etc/enterprise-release rather then # /etc/oracle-release without mentioning Oracle. if [ -f /etc/enterprise-release ]; then os="Oracle $os" elif [ -f /etc/oracle-release ]; then os=`cat /etc/oracle-release` fi fi
The following code:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) os_id=`grep ID= /etc/os-release | cut -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`grep ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then os=`grep PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi if [ "$os" = "" ]; then os=`uname -sr 2>/dev/null`
is replaced with:
if [ "$os" = "" -a -r /etc/os-release ]; then # Use os-release for SuSE (if SuSE-release wasn't present, above) os_id=`egrep ^ID= /etc/os-release | cut -f2 '-d"'` if [ "$os_id" = "" ]; then os_id=`egrep ^ID= /etc/os-release | cut -f2 -d=` fi if [ "$os_id" = "sles" -o "$os_id" = "opensuse" ]; then os=`egrep ^PRETTY_NAME /etc/os-release | cut -f2 '-d"'` fi fi if [ "$os" = "" -a -r /etc/system-release ]; then os=`cat /etc/system-release` fi if [ "$os" = "" ]; then os=`uname -sr 2>/dev/null`
Comments
Log in or register to comment.