Re: Processlist in PHP in consistent output format



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
.



Relevant Pages

  • Processlist in PHP in consistent output format
    ... I'm using Perl to store and interpret the output of the unix 'ps'- ... work on a few other unix variants that I tested. ... I came to the conclusion that the 'ps' output format is the culprit. ... with the command line options mentioned in the docs. ...
    (comp.lang.php)
  • Re: Processlist in PHP in consistent output format
    ... 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, ... with the command line options mentioned in the docs. ...
    (comp.lang.php)
  • Re: Processlist in PHP in consistent output format
    ... I'm using Perl to store and interpret the output of the unix 'ps'- ... I came to the conclusion that the 'ps' output format is the culprit. ... with the command line options mentioned in the docs. ... Does PHP have a functionality to return such data in a consistent, ...
    (comp.lang.php)
  • Re: vi horizontal split screen
    ... Command line recall and edit, which I had on DOS, was worth the price of admission by itself. ... The script language was designed to look like C for the benefit of C programmers working on *nix, but you still needed to know Bourne syntax, because all the scripts that controlled Unix itself were in the Bourne shell language. ... Emacs is not it. ... The default Emacs keystrokes have the same basic characteristic as the default vi keystrokes and the default WordStar command set: they are keyboard independent. ...
    (comp.editors)
  • Re: Sarahs very sad...
    ... There is a core of a Unix OS in the foundations, ... It is a considerable wrench going from a GUI to a program whose interface ... Linux or Unix system without ever seeing a command line or a config file ...
    (uk.people.support.depression)