Scroll to navigation

psauxlog(8) ClusterTools2 psauxlog(8)

NAME

psauxlog - log the process list with timestamp

SYNOPSIS

psauxlog [ logfile ]

DESCRIPTION

psauxlog logs the process list with timestamp. Basically the script puts the output of "date +%F %T" in front of each line for the output of "ps aux". If more data is needed, pidstat could be the right choice.

EXAMPLES

* 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 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 default logfile:

# awk '$10~/D/' /var/log/psaux.log
* Show zombie processes. Use default logfile:

# awk '$10~/Z/' /var/log/psaux.log
* Show processes existing at a certain time, e.g. 2021-09-27 07:01. Use 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 default logfile:

# awk '$13~/sapstartsrv/' /var/log/psaux.log
* Show processes using more than a certain CPU percentage, e.g. 100%. Use 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 default and all compressed logfiles:

# less /var/log/psaux.log* | awk '$3="ha1adm"&&$5>50'

EXIT STATUS

0 Successful program execution.
>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 .

SEE ALSO

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

COPYRIGHT

(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

24 Sep 2021