checks fail in audit_linux.sh
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_
$OA_AWK '/Type:/{for (u=2; u<=NF; u++){printf("%s ", $u)}printf("\n")}' |\
$OA_AWK '{gsub(" ","");print}')
On this hardware is returns "<OUTOFSPEC> this will fail the XML check, add
memory_
$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_
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) |
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` form_factor" = "<OUT OF SPEC>" ]; then form_factor= "Unknown"
530 if [ "$system_
531 system_
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.