Xymon Mailing List Archive search

FreeBSD 6.1 and PS and COMMAND

5 messages in this thread

list Dave Overton · Wed, 21 Jun 2006 11:57:56 -0700 ·
I am running FreeBSD 6.1 Release, Hobbit with the patches on the website
today, and a bit frustrated.
 
In hobbit-clients.cfg I have added the following lines:
 
HOST=mail02.syix.com
        PROC cron 1 -1 yellow
        PROC httpd 2 -1 red
        PROC radiusd 1 -1 red
        PROC named 1 -1 red
 
In the Hobbit Display, and in my pages on my phone, I get for that server:
 
Expected string COMMAND not found in ps output header
 
and on the display, the "COMMAND" column is not there...
 
It looks like this:
 

Wed Jun 21 11:51:47 PDT 2006 - Processes NOT ok

 yellow <http://puma.syix.com/hobbit/gifs/yellow.gif>;  Expected string
COMMAND not found in ps output header


  PID  PPID USER    STARTED STAT PRI %CPU      TIME %MEM  RSS   VSZ

    0     0 root    31Aug05 DLs  -18  0.0   0:04.46  0.0    0     0

    1     0 root    31Aug05 SLs   10  0.0   0:01.30  0.1   72   544

    2     0 root    31Aug05 DL    10  0.0   0:00.00  0.0    0     0

    3     0 root    31Aug05 DL    10  0.0   0:04.90  0.0    0     0

    4     0 root    31Aug05 DL    10  0.0   0:00.00  0.0    0     0
(which is probably broken on your screen, but there is no "COMMAND" column)
 
So, I go looking...  Can't find where PS is told to do this!!!  Argh.  A bit
of guidance, like what file tells PS to read those columns?  and why does it
hate the COMMAND column?
 
Help?


Dave Overton, Owner
SYIX.COM

user-4179705f9dca@xymon.invalid
(XXX) XXX-XXXX x101
Fax (XXX) XXX-XXXX
800-988-SYIX
list Henrik Størner · Mon, 26 Jun 2006 14:28:25 +0200 ·
quoted from Dave Overton
On Wed, Jun 21, 2006 at 11:57:56AM -0700, Dave Overton wrote:
I am running FreeBSD 6.1 Release, Hobbit with the patches on the website
today, and a bit frustrated.
[snip]
Expected string COMMAND not found in ps output header
So, I go looking...  Can't find where PS is told to do this!!!  Argh.  A bit
of guidance, like what file tells PS to read those columns?  and why does it
hate the COMMAND column?
The "ps" command that the Hobbit client runs is in the
~hobbit/client/hobbitclient-freebssd.sh script. It was recently changed
to provide a specific set of columns and therefore now is

ps -ax -ww -o pid,ppid,user,start,state,pri,pcpu,cputime,pmem,rss,vsz,args

Last I tested this, it did provide the "COMMAND" column. Maybe this has
changed in 6.1 ?


Regards,
Henrik
list Dave Overton · Mon, 26 Jun 2006 08:15:00 -0700 ·
There is the problem, and my information was incorrect.

Freebsd 4.11 returns this with the command string:
ps -ax -ww -o pid,ppid,user,start,state,pri,pcpu,cputime,pmem,rss,vsz,args
ps: args: keyword not found
  PID  PPID USER    STARTED STAT PRI %CPU      TIME %MEM  RSS   VSZ
    0     0 root    31Aug05 DLs  -18  0.0   0:04.53  0.0    0     0

Freebsd 6.1 returns: (as expected)
ps -ax -ww -o pid,ppid,user,start,state,pri,pcpu,cputime,pmem,rss,vsz,args
  PID  PPID USER   STARTED STAT PRI %CPU      TIME %MEM   RSS   VSZ COMMAND
    0     0 root   17Jun06 WLs   98  0.0   0:00.00  0.0     0     0
[swapper]

So, my subject line was wrong, the PS line works fine in v6.1, its v4.11 it
breaks in.

Excerpt from #man ps:

KEYWORDS
     The following is a complete list of the available keywords and their
     meanings.  Several of them have aliases (keywords which are synonyms).

     %cpu       percentage cpu usage (alias pcpu)
     %mem       percentage memory usage (alias pmem)
     acflag     accounting flag (alias acflg)
     command    command and arguments
     cpu        short-term cpu usage factor (for scheduling)
     flags      the process flags, in hexadecimal (alias f)
signature


Dave Overton, Owner
SYIX.COM

user-4179705f9dca@xymon.invalid
(XXX) XXX-XXXX x101
Fax (XXX) XXX-XXXX
800-988-SYIX 
-----Original Message-----

quoted from Henrik Størner
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Monday, June 26, 2006 5:28 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] FreeBSD 6.1 and PS and COMMAND

On Wed, Jun 21, 2006 at 11:57:56AM -0700, Dave Overton wrote:
I am running FreeBSD 6.1 Release, Hobbit with the patches on the > website today, and a bit frustrated.
[snip]
Expected string COMMAND not found in ps output header
So, I go looking...  Can't find where PS is told to do this!!!  Argh.  > A bit of guidance, like what file tells PS to read those columns?  and > why does it hate the COMMAND column?
The "ps" command that the Hobbit client runs is in the ~hobbit/client/hobbitclient-freebssd.sh script. It was recently changed to provide a specific set of columns and therefore now is

ps -ax -ww -o pid,ppid,user,start,state,pri,pcpu,cputime,pmem,rss,vsz,args

Last I tested this, it did provide the "COMMAND" column. Maybe this has changed in 6.1 ?


Regards,
Henrik

list Dave Overton · Mon, 26 Jun 2006 10:01:52 -0700 ·
quoted from Dave Overton
There is the problem, and my information was incorrect.

Freebsd 4.11 returns this with the command string:
ps -ax -ww -o 
pid,ppid,user,start,state,pri,pcpu,cputime,pmem,rss,vsz,args
ps: args: keyword not found
  PID  PPID USER    STARTED STAT PRI %CPU      TIME %MEM  RSS   VSZ
    0     0 root    31Aug05 DLs  -18  0.0   0:04.53  0.0    0     0

Freebsd 6.1 returns: (as expected)
ps -ax -ww -o 
pid,ppid,user,start,state,pri,pcpu,cputime,pmem,rss,vsz,args
  PID  PPID USER   STARTED STAT PRI %CPU      TIME %MEM   RSS 
  VSZ COMMAND
    0     0 root   17Jun06 WLs   98  0.0   0:00.00  0.0     0     0
[swapper]

Answering myself.  Changing the string in the "hobbitclient-freebsd.sh" file
to the same one found in the  "hobbitclient-darwin.sh" fixed it to work on
both systems.

Thanks for heading me in the right direction.

Dave
list Henrik Størner · Tue, 27 Jun 2006 14:19:45 +0200 ·
quoted from Dave Overton
On Mon, Jun 26, 2006 at 10:01:52AM -0700, Dave Overton wrote:
Answering myself.  Changing the string in the "hobbitclient-freebsd.sh" file
to the same one found in the  "hobbitclient-darwin.sh" fixed it to work on
both systems.

Thanks for heading me in the right direction.
Looking at the FreeBSD man-pages, it seems that "-o command" should work
on all FreeBSD versions. So I've changed the client script to use this.


Regards,
Henrik Størner