Posted on 07-10-2017 11:56 AM
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.
Posted on 07-10-2017 12:17 PM
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.
Posted on 07-10-2017 12:53 PM
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?
Posted on 07-10-2017 01:12 PM
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
Posted on 07-12-2017 07:13 AM
>>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.
Posted on 05-24-2018 01:50 PM
If anyone is interested, I created a script to try to solve this for myself.
Github