[ https://bro-tracker.atlassian.net/browse/BIT-233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20032#comment-20032 ]
grigorescu commented on BIT-233: -------------------------------- I believe that we can close this. The 4th field of df is available bytes, and shouldn't have any percent symbols in it. The percent available is the 5th field. I tested Gentoo, Ubuntu, OS X and FreeBSD, and I was unable to find a df implementation that doesn't follow this convention. > Python error when running `broctl cron` > --------------------------------------- > > Key: BIT-233 > URL: https://bro-tracker.atlassian.net/browse/BIT-233 > Project: Bro Issue Tracker > Issue Type: Problem > Components: Bro > Affects Versions: 1.5.1 > Reporter: jones > > I have a fresh installation of Bro 1.5.1, and I am encountering an error when > running 'broctl cron'. It appears that when broctl attempts to do a df, the % > symbol is not stripped before python tries to convert it to a float. This > throws a python error, as you can see below. > I made the error disappear by changing {{avail=float(df[3])}} to > {{avail=float(df[3].strip("%"))}} > Thanks, > Nick Jones > {noformat} > # broctl cron > warning: removing stale lock > Traceback (most recent call last): > File "/usr/local/bro/bin/broctl", line 726, in ? > loop.onecmd(line) > File "/usr/lib64/python2.4/cmd.py", line 219, in onecmd > return func(arg) > File "/usr/local/bro/bin/broctl", line 341, in do_cron > cron.doCron() > File "/usr/local/bro/lib/broctl/BroControl/cron.py", line 41, in doCron > _checkDiskSpace() > File "/usr/local/bro/lib/broctl/BroControl/cron.py", line 150, in > _checkDiskSpace > avail = float(df[3]) > ValueError: invalid literal for float(): 2% > {noformat} -- This message was sent by Atlassian JIRA (v6.4-OD-15-055#64014) _______________________________________________ bro-dev mailing list bro-dev@bro.org http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev