checks fail in audit_linux.sh

Bug #1111573 reported by Paul Janzen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OAv2
Fix Released
Undecided
Brandon Pierce

Bug Description

Altough audit_linux.sh works fine on a workstation it fail's on a server, for example a HP DL380G6 with unbuntu 10.04.04 installed.

Line 770
memory_detail=$($OA_ECHO "$bank_info" |\
    $OA_AWK '/Type:/{for (u=2; u<=NF; u++){printf("%s ", $u)}printf("\n")}' |\
    $OA_AWK '{gsub(" ","");print}')

On this hardware is returns "&lt;OUTOFSPEC&gt; this will fail the XML check, add

memory_detail=$($OA_ECHO "$bank_info" |\
    $OA_AWK '/Type:/{for (u=2; u<=NF; u++){printf("%s ", $u)}printf("\n")}' |\
    $OA_AWK '{gsub(" ","");print}')
if [ $memory_detail == "<OUTOFSPEC>" ]; then
     memory_detail = "N/A"
fi

In the network card section on line 1021 this command is executed

net_card_mac=`$OA_CAT /sys/class/net/$net_card_id/address`

this command fails because a bond interface is a virtual interface and hold only the referring interface (ie: eth0 eth1). A simple fix is as follow.

Line 999 to 1004 change this:
net_cards=`$OA_LS -l /sys/class/net/ |\
 $OA_GREP -Ev 'lo|total' |\
 $OA_REV |\
 $OA_CUT -d/ -f1,3 |\
 $OA_REV |\
 $OA_CUT -d: -f2,3`

To:
net_cards=`$OA_LS -l /sys/class/net/ |\
 $OA_GREP -Ev 'lo|total|bond' |\
 $OA_REV |\
 $OA_CUT -d/ -f1,3 |\
 $OA_REV |\
 $OA_CUT -d: -f2,3`

And on line 1011 change this:
$OA_GREP -Ev 'lo|total' |\
To
$OA_GREP -Ev 'lo|total|bond' |\

That will fix this issue.

Changed in oav2:
assignee: nobody → Brandon Pierce (ihashacks)
Revision history for this message
Brandon Pierce (ihashacks) wrote :

Adding "bond" to the grep will prevent the error occurence, but it has a side effect of not showing the IP of the bond interface and listing the device as "Not-Networked." Another unintended result is that only the current active interface in an active-backup bond is even listed.

I do acknowledge the error issue but don't think this is the best way to fix it. I spun up some VMs with difference bond settings so that I can work on a fix.

As for the "OUT OF SPEC," that happens when you have an old version of dmidecode. I have already made at least one "OUT OF SPEC" exception elsewhere:

 529 system_form_factor=`$OA_DMIDECODE -s chassis-type`
 530 if [ "$system_form_factor" = "<OUT OF SPEC>" ]; then
 531 system_form_factor="Unknown"
 532 fi

I'll have to come up with a better way of handling "OUT OF SPEC" from dmidecode without having to set that "if" on every single instance of dmidecode output.

Changed in oav2:
status: New → Confirmed
Revision history for this message
Brandon Pierce (ihashacks) wrote :
Changed in oav2:
status: Confirmed → Fix Released
Revision history for this message
Paul Janzen (paul-l) wrote :

I have ran this script on the same machine it initially failed and I can confirm that this is fixed.

Thnx
Paul.

Not pinging target, attempting to audit.
My PID is : 1803
Audit Start Time : 2013-02-25 11:48:16
Audit Location: local
-------------------
System Info
BIOS Info
Processor Info
Memory Info
Motherboard Info
Optical Drives Info
Video Cards Info
Sound Cards Info
Shares Info
Network Cards Info
Log Info
Swap Info
User Info
Software Info
Service Info
Route Info
Submitting results to server
Audit Generated in 6 seconds.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.