Posted on 10-13-2014 06:50 AM
Is there a way or does anyone out there have something that regularly looks to see if a computer has any Kernal Panic and reports out on it?
Posted on 10-13-2014 07:02 AM
You could write something to check /cores. but thats only if you have core dumping turned on. The only way to catch kernal panics is to set the computer to upload it to your own server, vs apples. Its easier to do on stationary macs vs laptops.
Posted on 10-13-2014 07:07 AM
I have been using this one for a while
# List only the .panic files and count how many lines
numOfPanics=$(ls -l /Library/Logs/DiagnosticReports/*.panic | wc -l | sed 's/ //g')
echo "<result>$numOfPanics</result>"
Posted on 10-15-2014 05:21 AM
Just started testing this. Works well, especially combined with a few other things I look for in "problem" units. Combine that with automatically generated email and it's a brilliant way to convince users that they should come into the helpdesk when things start going bad.
Posted on 10-15-2014 07:50 AM
Just wanted to post a slight alternative to the above. I think its a great idea to capture this for trending purposes. My only concern would be that its possible to count up panic logs that are weeks old, which doesn't necessarily give you a good view on how recent the issues may be. It might be good for long term trending however; so if a Mac starts showing up with a high number of these, it could point to a serious issue with the system.
That said, here's a modification that only pulls a count of panic logs created within the last 7 days, and ignores anything older. The number of days can be easily adjusted to whatever works for you. Just change the "-7" to however many days you want to go back.
#!/bin/sh
echo "<result>$(find /Library/Logs/DiagnosticReports/ -Btime -7 -name *.panic | wc -l | sed 's/^ *//')</result>"
Posted on 10-17-2014 10:28 AM
I like the mod... Nice! I'm actually going to rotate that into another grouping actually!