This article is to show you a step-by step on how to create a script in the run command box and send your logs to Addigy. This action would imply when Addigy request logs for when issue occurs.

Creating a script to retrieve logs

1. Select the Devices button on your navigation pane.
2. Click on Manage button located on the right side of the window.


3. Create a Name for the Script.
4. Copy and paste from the code snippet below into the Bash File Content box.

#!/bin/bash
device=$(hostname | awk -F'.' '{print $1}')
file_path="/Library/Addigy/logs"

#Create System Report
system_profiler -xml > ${file_path}/system_information.spx

body=$(/Library/Addigy/go-agent upload ${file_path})
curl -d "${body}" -H "Content-Type: application/json" -H "Device-Name: ${device}"  -X POST https://log-shipper.addigy.com/api/get-device-logs


5. Click the Create button to save the code for future use.





Sending logs to Addigy

6. Return back to Devices page.

7.Select which device you would like to retreive the logs from.
8. Type in the name you put to create the script in the run command box.



9. Click on the Send button  and you are done!