Monitor or Log Script Execution Time?
Does anyone know of a utility that will monitor or log PHP script execution times that will specify the script being executed? Looking for another option than adding code to all my scripts to do this. ConfigServer Firewall (CSF) will send email alerts if the set threshold is exceeded but it doesn't tell you the script being executed, this is an example for a PERL script what it sends:
Time: Wed May 16 07:01:43 2018 -0700
Account: cptest
Resource: Process Time
Exceeded: 22283 > 1800 (seconds)
Executable: /usr/local/cpanel/3rdparty/perl/526/bin/perl
Command Line: spamd child
PID: 15690 (Parent PID:14162)
Killed: No
-
What CSF does, is simply looking at the ps tree, or most likely the proc mount point to get the time processes has been running, from /proc, you'll be able to get quite a bit of information about what executable is being used as well as which command line is called (sometimes), this can also include the actual PHP script that is called. 0 -
cPanel has nothing natively that does this but there's a wealth of information on stackexchange on this subject as well as some tools at github others have written such as: flaviovs/timeit 0
Please sign in to leave a comment.
Comments
2 comments