Today, I'm looking at problem with NS7 inventory.
Whenever Linux automation has a kernel upgrade (which hasn't happened for a while but is about too), one of the steps I do is confirm hardware support. In NS6 I did this by gathering up all the relevent device IDs of the PCI bus for network cards and storage with the following SQL,
SELECT *
FROM (SELECT Count(*) AS [Card Count],
pciid,
[device description]
FROM (SELECT LEFT([hardware id], 21) AS PCIID,
[device description]
FROM altiris.dbo.inv_aex_hw_pci_bus bus
JOIN dbo.inv_aex_hw_serial_number hw
ON hw._resourceguid = bus._resourceguid
WHERE class = 'net'
AND [device description] NOT LIKE '@%'
AND [device description] NOT LIKE '%wireless%'
AND [device description] NOT LIKE '%wifi%'
AND [device description] NOT LIKE '%wlan%'
AND [device description] NOT LIKE '%advanced-n%'
) xxx
GROUP BY pciid,
[device description]) yyy
WHERE [card count] > 1
SELECT *
FROM (SELECT Count(*) AS [Card Count],
pciid,
[device description]
FROM (SELECT LEFT([hardware id], 21) AS PCIID,
[device description]
FROM altiris.dbo.inv_aex_hw_pci_bus bus
JOIN dbo.inv_aex_hw_serial_number hw
ON hw._resourceguid = bus._resourceguid
WHERE class = 'HDC'
) xxx
GROUP BY pciid,
[device description]) yyy
WHERE [card count] > 1
Where I ignore cards which are just singly instanced in the estate as these are usually from random hardware, unsupported motherboard upgrades and NIC installs.
From the NS6 Altiris DB, this gives me a list of devices and IDs as shown below,
From this I could extract all the device IDs which I needed to support in my environment (there are caveats, but they're too complicated to go into here). These device IDs I then save to a file on my DS6.9 Deployment Share called ids.txt.
In automation, I can then analyse these device IDs against the hardware support in the linux environment which can be scavenged from the modules pcimap file. The contents of this file id_scan.sh is detailed below,
#!/bin/bash# myids is a windows file which contains a list of the device IDs# which are required in Linux automation.## The list is newline delimeted, and each line just contains the 4 characters# that specify the device ID##myids=/mnt/ds/ids.txtIFS=$'\r\n'mymap=`find /lib/modules -name modules.pcimap`lines=($(cat ${myids}))for (( i=0; i<=${#lines[@]}; i++))domyresult=`cat ${mymap} | sed 's/\s\s*/ /g' | cut -d' ' -f 3 | grep "${lines[$i]}"`if [ $? -ne 0 ]; thenecho "NO ${lines[$i]}"fidone
That process works fairly nicely, and now I'm transferring this process to the CMS 7.5 inventory. It turns out that the table Inv_Aex_HW_PCI_Bus no longer exists and the data mapping guide for Inventory solution migrations says I should now refer to Inv_HW_Logical_Device which isn't helpful for this data.
I'm exploring more tables... and not finding the critical data I need of PCI device IDs and device classes. Some of the tables say they have that data as columns, but what they contain so far isn't actually what I understand by these items...
If anyone can prod me in the right direction, please, please don't hesitate to chip in... ;-)