Skip to main content
Question

System Diagnostic Logs from your Users

  • April 25, 2013
  • 31 replies
  • 167 views

Show first post

31 replies

Forum|alt.badge.img+9
  • Contributor
  • June 5, 2015

Oldie but goodie! In case you want to upload to an smb file share instead:

computername=`scutil --get ComputerName`
logfile=`ls /tmp/ | grep sysdiagnose`

mkdir /tmp/SHARENAME 2>&1
mount -t smbfs //USERNAME:PASSWORD@SERVERNAME/SHARENAME /tmp/SHARENAME

if [ ! -d /tmp/SHARENAME/${computername} ]; then
    mkdir /tmp/SHARENAME/${computername}
fi

cp /tmp/${logfile} /tmp/SHARENAME/${computername}/

rm /tmp/${logfile}

umount -t smbfs /tmp/SHARENAME

Forum|alt.badge.img+7
  • Contributor
  • November 27, 2015

Andrina: thank you very much for sharing. found your "Getting Users to Do Your Job (Without Them Knowning It) YouTube video.


Forum|alt.badge.img+1
  • New Contributor
  • April 8, 2016

Hi @jarednichols , I've been using your script above to collect client logs onto an AFP dropbox, with great success -- thanks for this. But, the "jamf mount" command fails for me since I upgraded my JSS to v9.9 -- that's the only change I made at the time. I can still mount the share manually in the Finder just as I'd expect, I just can't "jamf mount" it successfully. The script returns:

Mounting 172.20.1.8
Could not mount distribution point "172.20.1.8"
There was an error mounting the file server at 172.20.1.8. Will attempt again.
Mounting to /Volumes/ClientLogs...
Could not mount distribution point "172.20.1.8"
There was an error mounting the file server at 172.20.1.8. Giving up.
zip I/O error: No such file or directory
zip error: Could not create output file (/Volumes/ClientLogs/2016-04-08-bhwhite.zip)
umount: /Volumes/ClientLogs: not currently mounted

Do you have any advice? Thanks in advance for any suggestions.


Forum|alt.badge.img+1
  • New Contributor
  • April 20, 2016

@brandon.white and I were able to fix this in our organization by replacing the JAMF mount command with OSX's native mount_afp command:

#!/bin/sh

# Mount the drive 
sudo mkdir /Volumes/ClientLogs
mount_afp "afp://172.20.1.8/ClientLogs" /Volumes/ClientLogs

# Send zip file
dateformat=`date +"%Y-%m-%d"`
hostname=`jamf getComputerName | sed -e 's/<computer_name>//' -e 's/</computer_name>//'`

user=`ls -l /dev/console | cut -d " " -f 4`
filename="$dateformat-$hostname.zip"

zip -r /Volumes/ClientLogs/$filename /var/log/ /Library/Logs/ /Users/$user/Library/Logs
umount -f /Volumes/ClientLogs

exit 0

Forum|alt.badge.img+18
  • Honored Contributor
  • April 20, 2016

We do something a bit different with the diagnostic output.
We upload them to the JSS in attachments, and then we can grab it from there.
More Info


Forum|alt.badge.img+2
  • New Contributor
  • November 8, 2019

Sorry to bug you on this old thread...but has anyone had luck to attach multiple attachments in a new message in Outlook by command line?