Errors with broctl cron

Hi all,

Running Bro 2.2 under FreeBSD 10 host, "broctl cron" task returns me
the following error every hour:

warning: cannot get list of local IP addresses
error: script must be run on manager node

This is a Bro manager node controlling two Bro workers nodes.

What can be the problem?? I have revised node.cfg and broctl.cfg and
all its ok...

You get that error when the `local-interfaces` script fails.

What happens if you run

    /usr/local/bro/share/broctl/scripts/local-interfaces

manually?

Here it is:

root@testbro:~ # /nsm/bro/share/broctl/scripts/local-interfaces
10.196.0.103
fe80::5054:ff:fe91:3813
172.17.22.1
fe80::5054:ff:fec4:d17f
172.17.23.1
fe80::5054:ff:fe1a:3c94
172.17.24.1
fe80::5054:ff:fe69:9e59
::1
fe80::1
127.0.0.1

Nothing strange in my opinion ... In ode.cfg I use IP 172.17.24.1 to
connect to other workers ...

Yep, that's what it is supposed to do.. bro tries to fix the path in
that script:

    export PATH=$PATH:/sbin:/usr/sbin

so ifconfig can be found, but I wonder if it is not finding sed on your
system. Can you double check what your PATH is in the shell vs. what
it is for cron jobs?

PATH in cron:

PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin

crontab entry is:

59 * * * * root /nsm/bro/bin/broctl cron

In my shell:

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin:/nsm/bro/bin

sed: /usr/bin/sed /usr/share/man/man1/sed.1.gz /usr/src/usr.bin/sed
ifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz
/usr/src/sbin/ifconfig

Uhmmm... I don't see where is the problem ...

I think the problem is that "bash" (probably located in /usr/local/bin)
is not found when broctl runs in a cron job. Probably the easiest fix
is to create a symlink to bash in either /bin or /usr/bin.

You might also need to make a symlink to python (broctl
requires both bash and python).

Hmm, if you run broctl cron from the shell, does it work?

Ok, problem solved. I have created a custom script exporting PATH
variable and all works ok.

Many thanks for your help.