How to customize what gets inventory for Primary MAC Address and Secondary MAC Address

ckafs
New Contributor

The JSS by default only reports on the two network adapters that are assigned to en0 and en1.

Primary MAC address = en0
Secondary MAC address = en1

How can I get this to report only the Wi-Fi and Thunderbolt Ethernet adapters?

Most of my Macs look like this
en0 = Wi-Fi
en1 = Bluetooth PAN
en2 = Thunderbolt Bridge
en3 = Thunderbolt Ethernet
en4 = iPhone USB

I am trying to allow access to the network using Aruba ClearPass Policy Manager and having the Bluetooth PAN as the Secondary MAC address in the JSS inventory is useless.

5 REPLIES 5

mm2270
Legendary Contributor III

I think you can only do this with custom Extension Attributes. As far as I know, you can't modify the way the JSS gathers information in this regard. You can make some choices about what general categories get captured when inventory is collected, but you can't tweak specific items to pull different information. That is coded into the jamf binary most likely.

ckafs
New Contributor

I already made Extension Attributes to capture the first six MAC addresses. Is there a way in with the command line and grep? to change what gets assigned to en0 and en1?

mm2270
Legendary Contributor III

So let me make sure I understand. You want to capture only the MAC addresses from Wi-Fi and Thunderbolt Ethernet and nothing else, correct?
If so, yes that can be done. Were you looking to have these as two separate Extension Attributes? That would probably make the most sense since it would make for easier reporting later. Each field can have it's own column in a report rather than being lumped into one for example.

Example EA for capturing Wi-Fi MAC address

#!/bin/bash

WIFI_MAC=$(/usr/sbin/networksetup -listallhardwareports | awk '/Wi-Fi/{getline; getline; print $NF}')

if [ ! -z "$WIFI_MAC" ]; then
    echo "<result>$WIFI_MAC</result>"
else
    echo "<result>Not Available</result>"
fi

For Thunderbolt Ethernet, it would probably be this. i don't have a TBolt Enet dongle connected to my Mac at the moment, so for me it reports Not Available

#!/bin/bash

TBOLT_MAC=$(/usr/sbin/networksetup -listallhardwareports | awk '/Thunderbolt Ethernet/{getline; getline; print $NF}')

if [ ! -z "$TBOLT_MAC" ]; then
    echo "<result>$TBOLT_MAC</result>"
else
    echo "<result>Not Available</result>"
fi

ckafs
New Contributor

>>So let me make sure I understand. You want to capture only the MAC addresses from Wi-Fi and Thunderbolt Ethernet and nothing else, correct?

This is correct but extension attributes are not going to work for this. I need Wi-Fi to be en0 and Thunderbolt Ethernet to be en1 so these get captured in the default inventory in JAMF Pro for the Primary MAC address field and the Secondary MAC address field. Aruba is ONLY using these two fields from JAMF Pro so extension attributes are useless.

jrippy
Contributor II

If anyone is interested, I created a script to try to solve this for myself.
Github