Broctl top output broken

Description

BroControl top output is broken on one host for me.

Output looks like (note the cmd column)

[johanna ~/install-master/share/bro/site]$ broctl top
Name Type Host Pid Proc VSize Rss Cpu Cmd
manager manager localhost 57267 parent 252M 112M 4% bro
manager manager localhost 57269 child 136M 48M 0% bro
proxy-1 proxy localhost 57304 parent 80M 45M 0% bro
proxy-1 proxy localhost 57306 child 136M 45M 0% bro
worker-1-1 worker localhost 57397 parent 489M 455M 19% bro
worker-1-1 worker localhost 57967 child 409M 44M 0% bro
worker-1-10 worker localhost 57412 parent 489M 454M 0% 15.38%
worker-1-10 worker localhost 57826 child 409M 44M 0% bro
worker-1-11 worker localhost 57417 parent 485M 453M 0% 10.60%
worker-1-11 worker localhost 57868 child 409M 44M 0% bro
worker-1-12 worker localhost 57426 parent 489M 457M 10% bro
worker-1-12 worker localhost 57968 child 409M 44M 0% bro
worker-1-13 worker localhost 57432 parent 489M 456M 0% 9.08%
worker-1-13 worker localhost 57971 child 409M 44M 0% bro
worker-1-14 worker localhost 57442 parent 485M 453M 0% 11.67%
worker-1-14 worker localhost 57969 child 409M 44M 0% bro
worker-1-15 worker localhost 57461 parent 489M 457M 0% 11.57%

The operating system is FreeBSD 9.3. Node.cfg is:

[manager]
type=manager
host=localhost

[worker-1]
type=worker
host=localhost
interface=myri0
lb_method=myricom
lb_procs=20

[proxy-1]
type=proxy
host=localhost

Environment

None

Activity

Show:
Daniel Thayer
July 9, 2015, 9:52 PM

This problem is caused by broctl assuming that every line in the output of "top -u -b all" has
the same number of fields. However, in this case the output looks something like this
(notice the "STATE" column contains the text "mx cv", which could be caused by
the myricom drivers):

PID UID THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
57267 20206 31 20 0 324M 166M uwait 21 990:19 101.61% bro
57269 20206 1 52 5 136M 72608K select 18 711:37 66.80% bro
57471 20206 1 44 0 1089M 1060M mx cv 13 293:10 31.30% bro

Daniel Thayer
July 25, 2015, 9:24 PM

Branch topic/dnthayer/ticket1434 in the broctl repo has a fix for this.
I changed the awk script contained in the "top" helper script to account
for a varying number of fields in the output of the "top" command
on FreeBSD.

Assignee

Justin Azoff

Reporter

Johanna Amann

Labels

None

External issue ID

None

Components

Fix versions

Affects versions

Priority

Normal
Configure