forked from hkrewson/panicparse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetWMPanicCount.sh
More file actions
22 lines (18 loc) · 803 Bytes
/
getWMPanicCount.sh
File metadata and controls
22 lines (18 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# Watchman Monitoring keeps track of Kernel Panics
# Check for the quanity of currently tracked panic logs
# Get the kernel panic count
panicCount=$(/usr/libexec/PlistBuddy -c 'print :Last_Panic_Count' /Library/MonitoringClient/PluginSupport/check_panic_count_settings.plist)
# If there are panics recorded, print the count and the recorded dates
if [[ $panicCount == *"Does Not Exist"* ]]; then
echo "<result>No Panics</result>"
else
echo "Panic Count: "$panicCount
i=0
panicResults=()
while [ $i -lt $panicCount ]; do
panicResults+=("$(echo "Panic Date: " $(/usr/libexec/PlistBuddy -c "print :Panic_List:$i" /Library/MonitoringClient/PluginSupport/check_panic_count_settings.plist | xargs date -r))")
echo ${panicResults[$i]}
i=$(($i + 1))
done
fi