How do I automatically check heavy processes at regular intervals?
I'd like to investigate when the load is on during the night, weekends, and holidays.
I have a vague image like creating a shell and starting it at regular intervals in the scheduler, but
Linux is a beginner and I don't know how to do it.
Please let me know if there is a good way to avoid overloading the server.
The environment is Red Hat Enterprise Linux 6.3.
linux rhel
If you use cron
, how about registering 32**root/bin/ps-A-Opcpu -- sort-pcpu|head>/path/to/log/dir/pslog-$(date+%Y%m%d%H%M%S)
in ?
Sort all processes in descending order of cpu utilization and log 10 from the top.
If you want to change the information you want to log, do mamps
to see the OUTPUT MODIFIERS
section.
© 2024 OneMinuteCode. All rights reserved.