[Nagiosplug-devel] BUG: check_proc doeas not work under FreeBSD 4

Tomasz Pilat poncki.lists at axelspringer.com.pl
Tue Dec 21 03:25:10 CET 2004


>> However, you are probably much better than me at understanding FreeBSD
>> 4 - is there another way to get the columns of information that
>> check_procs wants?

#  /bin/ps  -axwo  'state  uid  ppid  vsz  rss pcpu ucomm command' can
(almost) do the trick:

S       80 90152 24156 13780  0.0 httpd            /usr/local/sbin/httpd -DSSL
S       80 90152 23312 12912  0.0 httpd            /usr/local/sbin/httpd -DSSL
S       80 90152 29452 19196  0.2 httpd            /usr/local/sbin/httpd -DSSL
Ss       0     1  4104  500  0.0 dccm             /usr/local/dcc/libexec/dccm -l log -t CMN,5, -w whiteclnt -U userdirs
Ss       0     1 15976 3892  0.0 httpd            /usr/local/sbin/httpd -DSSL
I        0     1   908  308  0.0 courierlogger    /usr/local/sbin/courierlogger -pid=/usr/local/var/authdaemon/pid -start /usr/local/libexec/courier-imap/authlib/authdaemond.plain
S        0 90193  1096  392  0.0 authdaemond.plai /usr/local/libexec/courier-imap/authlib/authdaemond.plain

Same output on 4-STABLE nad 5.2.1.

And  i  think  there  is no way to get command-name longer than 16
bytes. From src/bin/ps/keyword.c:

        {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16},
        {"ucomm", "UCOMM", NULL, LJUST, ucomm, NULL, MAXCOMLEN},

HTH,

Ponc





More information about the Devel mailing list