Page 1 of 2

Can't get to work BLOCK_REPORT script

Posted: 16 Mar 2013, 21:08
by vertebrac
Hi everyone!
I'm trying to call a simple script at the block_report option at csf.
In my configuration file i'v got this:

Code: Select all

# address block following for example a login failure. The following setting
# is to the full path of the external script which must be executable. See
# readme.txt for format details
#
# Leave this setting blank to disable
BLOCK_REPORT = "/usr/local/bin/scripts/cban"

# To also run an external script when a temporary block is unblocked: the
# following setting can be the full path of the external script which must be
# executable. See readme.txt for format details
#
# Leave this setting blank to disable
UNBLOCK_REPORT = "/usr/local/bin/scripts/cnul"
And the scripts are never executing, they have execution permissions for every user.
I'm trying to fire up those scripts simulating a 5 time whm failed login.
What could be happening?

Thanks!!

Re: Can't get to work BLOCK_REPORT script

Posted: 25 Mar 2013, 10:31
by nemke
I can only say that i have same issue without solution :(

I wanted to use BLOCK_REPORT and UNBLOCK_REPORT to also ban IP on my Cloudflare account, but scripts never get called.

Re: Can't get to work BLOCK_REPORT script

Posted: 25 Mar 2013, 10:37
by ForumAdmin
You need to ensure that any scripts called have:

1. Executable bit set
2. A valid first line shebang
3. Use full paths to any binaries (there will be no PATH setting)

Re: Can't get to work BLOCK_REPORT script

Posted: 25 Mar 2013, 11:28
by nemke
1. Already set
2. I have it
3. I didn't have full paths. But I changed them, and it still script doesn't get called.

When i call my scripts from command line, they work fine.

Hm, i use csf -d and csf -dr to test this scripts, maybe they are called only when csf performs a ban?

Re: Can't get to work BLOCK_REPORT script

Posted: 25 Mar 2013, 11:35
by ForumAdmin
They are only ever called by lfd when it blocks an IP, not csf - that is not the purpose of the options.

Re: Can't get to work BLOCK_REPORT script

Posted: 27 Mar 2013, 10:33
by nemke
You are right, thank you for the info. Now everything works as expected :)

Re: Can't get to work BLOCK_REPORT script

Posted: 28 Mar 2013, 08:35
by johnang
Can you enable BLOCK_REPORT and UNBLOCK_REPORT for csf, also?

Re: Can't get to work BLOCK_REPORT script

Posted: 28 Mar 2013, 08:37
by nemke
Yes that would be nice feature request, that block_report is called for every type of ban/unban.

Re: Can't get to work BLOCK_REPORT script

Posted: 28 Mar 2013, 18:59
by snowwhiteeg
vertebrac wrote:Hi everyone!
I'm trying to call a simple script at the block_report option at csf.
In my configuration file i'v got this:

Code: Select all

# address block following for example a login failure. The following setting
# is to the full path of the external script which must be executable. See
# readme.txt for format details
#شركات التسويق 
# Leave this setting blank to disable
BLOCK_REPORT = "/usr/local/bin/scripts/cban"

# To also run an external script when a temporary block is unblocked: the
# following setting can be the full  seo egypt  path of the external script which must be
# executable. See اشهار الموقع  readme.txt for format details
#
# Leave this setting blank to ] نشر موقع   disable
UNBLOCK_REPORT = "/usr/local/bin/scripts/cnul"
And the scripts are never executing, they have execution permissions for every user.
I'm trying to fire up those scripts simulating a 5 time whm failed login.
What could be happening?

Thanks!!
i have the same problem , still no solution

Re: Can't get to work BLOCK_REPORT script

Posted: 05 Jun 2015, 03:12
by Cyph3r
deleted