psauxlog(8)

πŸ“¦ version 3.1.3, in opensuse-leap 16.0

πŸ’– psauxlog(8) β€” like, the process list but with a timestamp, bestie πŸ’–

okay so you found the psauxlog page from the ClusterTools2 crew and honestly? it's giving "small script, big main character energy." stay with me, we're gonna go through it together 🫢


✨ NAME ✨

psauxlog β€” logs the process list, but with a timestamp, because context is everything πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

psauxlog [ logfile ]

🌸 DESCRIPTION 🌸

psauxlog logs the process list with a timestamp. basically, the script is out here putting the output of date +%F %T in front of each line of the output of ps aux. that's it. that's the whole vibe. ⭐

and like, if you need more data than that? pidstat could be the right choice, no cap. πŸ‘‘


πŸŽ€ EXAMPLES πŸŽ€

lowkey the best part, let's go πŸƒβ€β™€οΈ

  • Run psauxlog every 10 minutes. the crontab entry could look like this:
-04-59/10 * * * * root /usr/sbin/psauxlog /var/log/psaux.log
  • Rotate and compress the log from time to time. the logrotate entry could look like this:
/var/log/psaux.log {
    compress
    dateext
    maxage 365
    rotate 99
    size +4M
    notifempty
    missingok
    copytruncate
}
  • Show processes waiting on IO. use the default logfile:
# awk '$10~/D/' /var/log/psaux.log
  • Show zombie processes. πŸ§Ÿβ€β™€οΈ use the default logfile:
# awk '$10~/Z/' /var/log/psaux.log
  • Show processes existing at a certain time, e.g. 2021-09-27 07:01. use the default logfile:
# awk '$1~/2021-09-27/&&$2~/^07:01:/' /var/log/psaux.log
  • Show when a certain process did exist, e.g sapstartsrv. use the default logfile:
# awk '$13~/sapstartsrv/' /var/log/psaux.log
  • Show processes using more than a certain CPU percentage, e.g. 100%. use the default and all compressed logfiles:
# less /var/log/psaux.log* | awk '$5>100'
  • Show processes of a certain user using more than a certain CPU percentage. e.g. SAP <sid>adm of SID HA1 using more than 50%. use the default and all compressed logfiles:
# less /var/log/psaux.log* | awk '$3="ha1adm"&&$5>50'
ok bestie, that last one is literally copied character-for-character, single = and all β€” don't come for me, I'm just the messenger πŸ™ˆ

πŸ“ EXIT STATUS πŸ“

  • 0 β€” successful program execution. we love a clean exit ✨
  • >0 β€” usage, syntax or execution errors. πŸ’€

🧚 FILES 🧚

  • /usr/sbin/psauxlog β€” the script itself
  • /var/log/psaux.log β€” the default logfile
  • /etc/cron.d/ClusterTools2 β€” the cron entry
  • /etc/logrotate.d/ClusterTools2 β€” the logrotate entry

πŸ’€ BUGS πŸ’€

feedback is welcome, please mail to feedback@suse.com . they're literally asking, so like… tell them 🫢


🌈 SEE ALSO 🌈

ps(1), pidstat(1), crontab(5), systemd.timer(5), logrotate(8), ClusterTools2(7), ClusterTools2-timer(7)


(c) 2011-2021 L.Pinne, Germany.

psauxlog comes with ABSOLUTELY NO WARRANTY. for details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html


ngl the all-caps "ABSOLUTELY NO WARRANTY" is the loudest thing on this whole page and I respect it 😭

and that's the tea, bestie β€” this page is psauxlog(8) from ClusterTools2, dated 24 Sep 2021. go forth, log your processes, slay πŸ’…πŸ’–

πŸ“¦ where this page comes from