Posted on 10-13-2009 01:10 PM
This should be simple:
I am trying to provide a master inventory to our Technology director with all the system specs as well as user and asset information. All the system specs are easy: I do a saved search and select no criteria (selecting all), then select the applicable display fields. Then search into a csv. Easy! We are on Casper 7.1
The problem is this: I would like the excel sheet that I provide to show both the ethernet AND the airport MAC addresses, but there is no checkbox for multiple MAC's or MAC 1 and MAC 2, just "MAC Address." I spoke with JAMF and they told me there are a few options: submit a feature request, or, use terminal to dump the Airport MAC into a field (like Room or Phone) in the JSS. This would take a bit of research, plus I currently use all of those fields. I thought there must be a way to export that information (the MAC from en1, in most cases) for all my machines from the MySQL database. Or maybe something even easier.
Just wondering if anyone has a way to get information from the JSS into a CSV where there is no option under Display Field in saved searches. Again, it's simple, but any help is appreciated. Thanks.
- Jay Heath
Fieldston Lower
jheath at ecfs.org
Posted on 10-13-2009 04:32 PM
We use a custom report to get the Airport MAC address.
I have attached it here - you may have to modify it as it only shows you the
computer name, Ethernet MAC address, and Airport MAC address.
Or you may be able to get all the info by:
1) export all the information that you can they way you are now.
2) export the ethernet mac and airport mac with the attached report.
3) use excel (or filemaker) to import the airport address by matching the
ethernet mac address.
Hope this helps.
--Brad Rellinger
Technology Specialist
Anthony Wayne Local Schools K-12
aw_aca_bre at nwoca.org
Posted on 10-14-2009 06:37 AM
This could be done via simple shell script as well....here is a quick example I just whipped up.
######################## #!/bin/bash
nic=/usr/sbin/networksetup -getmacaddress Ethernet | awk '/ / { print $3 }'
aport=/usr/sbin/networksetup -getmacaddress Airport | awk '/ / { print $3 }'
#now write to a file
/bin/echo "Ethernet MAC is $nic, Airport MAC is $aport" > /Library/Receipts/macadd.txt
exit 0 ##############################
Posted on 10-14-2009 06:40 AM
Not enough coffee yet, you need to add back ticks to those variables for it to work....
Posted on 10-14-2009 06:40 AM
you could also add the computer name so you could identify later
Criss Myers
Senior Customer Support Analyst (Mac Services)
Apple Certified Technical Coordinator v10.5
LIS Business Support Team
Library 301
University of Central Lancashire
Preston PR1 2HE
Ex 5054
01772 895054
Posted on 10-14-2009 06:46 AM
Yeah OK, so since Criss added that I will just rewrite it real quick. I had a few more sips of coffee. Back ticks now included.
######################## #!/bin/bash
nic=/usr/sbin/networksetup -getmacaddress Ethernet | awk '/ / { print $3 }'
aport=/usr/sbin/networksetup -getmacaddress Airport | awk '/ / { print $3 }'
cname=/usr/sbin/networksetup -getcomputername
#now write to a file
/bin/echo "$cname has Ethernet MAC of $nic, and Airport MAC of $aport" > /Library/Receipts/macadd.txt
exit 0 ##############################
Posted on 10-14-2009 08:06 AM
Actually, now that I think about it, if you wanted to do this in a fashion where you could get a centralized. I tested this and it worked on one machine, but I didn't go much further. This is juts proof of concept.
#!/bin/bash
############ # this script is meant for building a report # and writing certain information to a text file over the network # # this script will contain a username and password to mount a network share #############
#set the variables of the info we need
nic=/usr/sbin/networksetup -getmacaddress Ethernet | awk '/ / { print $3 }'
aport=/usr/sbin/networksetup -getmacaddress Airport | awk '/ / { print $3 }'
cname=/usr/sbin/networksetup -getcomputername
#not make sure that we can mount the network share to write to a text file #please edit this to reflect your environment
/bin/mkdir /Volumes/temp/
/sbin/mount -t afp afp://username:password@myserver.com/sharepoint /Volumes/temp/
#now make sure that the mount point is mounted #edit this line to reflect what should go here
mountpoint="/Volumes/temp/Sharepoint"
if [[ -e $mountpoint ]]
then /bin/echo "$cname, $nic, $aport" >> $mountpoint/report.txt
else exit 1
fi
exit 0
You could go further to unmount the share point when the script exits. I also used commas in the echo, that way when you go to import it in say a spread sheet, you can use the comma as a point to separate fields. Since I used the double >> it will keep adding lines to that text file. So then just set up a casper policy to run this script on every computer and it will mount the share, write to that file and then exit. You can of course go even further and add lots of more info. I am not sure how Casper does their reports under the hood, but I got to assume it is something similar. Of course I just tested this on my local machine, and it worked so it is just proof of concept.
Just FYI,
Tom