Here is a script we use to find both NICs MAC addresses within KACE. Using the default scripts from KACE only selects on the Machine table. We used this to find our laptops & both nics. AGain, not a SQL person by any stretch. Probably could be cleaner etc.
SELECT DISTINCT NAME, BIOS_SERIAL_NUMBER, OS_NAME, CS_MODEL, CHASSIS_TYPE, MACHINE.MAC as MAC1,
(SELECT NIC
FROM ORG1.MACHINE_NICS
WHERE ((ORG1.MACHINE_NICS.ID=ORG1.MACHINE.ID) AND (MAC1 = MAC)) LIMIT 1 ) as NIC1,
(SELECT MAC
FROM ORG1.MACHINE_NICS
WHERE ((ORG1.MACHINE_NICS.ID=ORG1.MACHINE.ID) AND (MAC1 != MAC)) LIMIT 1 ) as MAC2,
(SELECT NIC
FROM ORG1.MACHINE_NICS
WHERE ((ORG1.MACHINE_NICS.ID=ORG1.MACHINE.ID) AND (MAC1 != MAC)) LIMIT 1 ) as NIC2
FROM `ORG1`.`MACHINE`
JOIN `ORG1`.`MACHINE_NICS`
ON ORG1.MACHINE.ID=ORG1.MACHINE_NICS.ID
WHERE ORG1.MACHINE.CHASSIS_TYPE='laptop'
ORDER BY NAME, NIC1;
Thanks for sharing!
ReplyDelete