Created
November 10, 2020 16:01
-
-
Save rtrouton/319b76533c9732f627dba13da9fa35ec to your computer and use it in GitHub Desktop.
Jamf Pro Extension Attribute which is designed to report on kernel panics which occurred in the last seven days.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Detects kernel panics which occurred in the last seven days. | |
# | |
# Original idea and script from here: | |
# https://www.jamf.com/jamf-nation/discussions/23976/kernal-panic-reporting#responseChild145035 | |
# | |
# This Jamf Pro Extension Attribute is designed to | |
# check the contents of /Library/Logs/DiagnosticReports | |
# and report on how many log files with the file suffix | |
# of ".panic" were created in the previous seven days. | |
PanicLogCount=$(/usr/bin/find /Library/Logs/DiagnosticReports -Btime -7 -name *.panic | grep . -c) | |
echo "<result>$PanicLogCount</result>" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment