Below is a ready-to-use script. Review and adapt variables to your environment.
#!/usr/bin/env bash kubectl get nodes -o wide kubectl get pods -A --field-selector=status.phase!=Running | tail -n +2 kubectl get events -A --sort-by=.lastTimestamp | tail -n 50