# Errors with broctl cron

**URL:** <https://community.zeek.org/t/errors-with-broctl-cron/3035>\
**Category:** Zeek\
**Created:** [March 10, 2014, 2:40pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035 "2014-03-10T14:40:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![C\_L\_Martinez](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@C\_L\_Martinez](https://community.zeek.org/u/C_L_Martinez)\
**Post date:** [March 10, 2014, 2:40pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/1 "2014-03-10T14:40:29Z")

</div>

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...

---

<div class="post-metadata">

**Author:** ![Azoff\_Justin](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Azoff\_Justin](https://community.zeek.org/u/Azoff_Justin)\
**Post date:** [March 10, 2014, 3:12pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/2 "2014-03-10T15:12:30Z")

</div>

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

What happens if you run

&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bro/share/broctl/scripts/local-interfaces

manually?

---

<div class="post-metadata">

**Author:** ![C\_L\_Martinez](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@C\_L\_Martinez](https://community.zeek.org/u/C_L_Martinez)\
**Post date:** [March 10, 2014, 3:16pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/3 "2014-03-10T15:16:09Z")

</div>

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 ...

---

<div class="post-metadata">

**Author:** ![Azoff\_Justin](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Azoff\_Justin](https://community.zeek.org/u/Azoff_Justin)\
**Post date:** [March 10, 2014, 3:34pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/4 "2014-03-10T15:34:43Z")

</div>

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

&nbsp;&nbsp;&nbsp;&nbsp;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?

---

<div class="post-metadata">

**Author:** ![C\_L\_Martinez](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@C\_L\_Martinez](https://community.zeek.org/u/C_L_Martinez)\
**Post date:** [March 10, 2014, 3:39pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/5 "2014-03-10T15:39:29Z")

</div>

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 ...

---

<div class="post-metadata">

**Author:** ![Daniel\_Thayer](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@Daniel\_Thayer](https://community.zeek.org/u/Daniel_Thayer)\
**Post date:** [March 10, 2014, 5:13pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/6 "2014-03-10T17:13:01Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Azoff\_Justin](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Azoff\_Justin](https://community.zeek.org/u/Azoff_Justin)\
**Post date:** [March 10, 2014, 5:23pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/7 "2014-03-10T17:23:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![C\_L\_Martinez](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@C\_L\_Martinez](https://community.zeek.org/u/C_L_Martinez)\
**Post date:** [March 11, 2014, 10:32am UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/8 "2014-03-11T10:32:02Z")

</div>

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

Many thanks for your help.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:41pm UTC](https://community.zeek.org/t/errors-with-broctl-cron/3035/9 "2022-05-06T15:41:38Z")

</div>


