Re: Processlist in PHP in consistent output format
- From: matt <matthew.leonhardt@xxxxxxxxx>
- Date: Mon, 16 Aug 2010 06:07:01 -0700 (PDT)
On Aug 16, 5:53 am, Bart Van der Donck <b...@xxxxxxxxxx> wrote:
Hello,
I'm using Perl to store and interpret the output of the unix 'ps'-
command. It works well on my machine (FreeBSD 6.2.), but it doesn't
work on a few other unix variants that I tested.
I came to the conclusion that the 'ps' output format is the culprit.
This appears to differ across ps/top variants on several OS-es, even
with the command line options mentioned in the docs.
More likely, the version of ps. I was about to recommend parsing the
output of ps -V to determine the version of ps. I tested it on my
Solaris 10 box, and that ps version doesn't even support -V, or any
other flag to get the version!!! I imagine you could parse the column
headers in the first line of output, though.
The script doesn't look for general system info, but detects the 20
most CPU-intensive processes ('ps -aux' or 'top -b' on FreeBSD),
e.g.:
PID USER THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
978 root 1 8 -20 5636K 2964K nanslp 18.2H 0.10% perl
8003 bind 1 4 20 28012K 1892K kqread 452:24 0.00% named
1019 root 1 4 -15 6172K 1332K sbwait 279:27 0.00% perl
...
Does PHP have a functionality to return such data in a consistent, OS-
independent format ?
Nope
.
- References:
- Processlist in PHP in consistent output format
- From: Bart Van der Donck
- Processlist in PHP in consistent output format
- Prev by Date: Macros in PHP - is it possible?
- Next by Date: Re: Macros in PHP - is it possible?
- Previous by thread: Re: Processlist in PHP in consistent output format
- Next by thread: Re: Processlist in PHP in consistent output format
- Index(es):
Relevant Pages
|