So one of our AEM nodes was freaking out the other day .. No, not the election results .. Some code was deployed to it that had runaway processes, thus gorging itself on CPU and memory .. EEEKK !! What to do ?? If you’ve been around AEM for awhile, you know how we love our raw thread dumps .. That being said, I really dislike the process on how to obtain them:
- Log into the node
- Get the Java PID
- Execute jstack and output to a log file
- Repeat every 10 seconds for at least one minute
- Compress the log file
- Share the compressed log file
- Typically via email
So how can I automate this ?? Easy !!
Create a Bash script that will generate the thread dumps for you ..
Create an Ansible playbook that will execute the script, compress the log file, and email it