Sponsored Content
Top Forums Shell Programming and Scripting Script going upward and downward direction Post 302865791 by baris35 on Saturday 19th of October 2013 07:08:49 PM
Old 10-19-2013
Hello,
Many thanks for you all.
Now, I am able to extract ip addresses that should be banned.
My question is how I can communicate iplist file with fail2ban

At first I added below line into crontab:

Code:
*/10 * * * * root /var/bin/iplist.sh

my iplist.sh file with chmod 755 under /var/bin is :

Code:
#!/bin/bash
cd /usr/local/darwin
awk -F'[][]' '{F6[NR%6]=$6} /not in the User Database/{print $4, F6[(NR-5)%6]}' system_backup.log > fail2ban.txt
sleep 1
grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' fail2ban.txt > daemon.log
fi

My daemon.log file is like this:
Code:
15.41.150.134
15.41.10.134
15.41.30.134
15.41.50.134
15.41.60.134
16.41.80.134
16.41.90.134
17.41.44.134

Then I added below explanation into fail2ban:
Code:
[darwin]
enabled = true
port = 8000,1934,5544,7001,7002,7003
filter = darwin
logpath = /usr/local/darwin/daemon.log
maxretry = 1
bantime = 3600

The next step is I created a file named darwin.conf :
Code:
[Definition]
failregex = .* <HOST>
ignoreregex =

Could you please let me know what I should type instead of failregex = .* <HOST> in related file?

When I stop/start fail2ban, I can not see banned ip addresses under /var/log/fail2ban file.

Thanks in advance
Boris

Last edited by Scrutinizer; 10-20-2013 at 03:10 AM.. Reason: Additional code tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

New & could use some direction!

First, I just rebuilt/installed my custom kernel & I don't know how to check if it ran properly (I'm fairly sure it did, but I'm looking for reassurance that it loaded the new kernel file). Second, I'd love to get into programming, scripting, whatever, I want my imagination to be the builder &... (2 Replies)
Discussion started by: LazySpoon
2 Replies

2. Programming

In what direction should I take computer programming?

I'm a senior in high school trying to start getting into computer programming. All I've done so far is picked up a book on C for beginners and started to teach myself. There aren't really any courses at my high school for introductory programming, so it looks like I'll have to wait for college to... (7 Replies)
Discussion started by: Fritzz
7 Replies

3. Shell Programming and Scripting

re-direction

Say I have a single bin directory with Linux and SunOS executables, like this: bin/myprog_lnx bin/myprog_sun Assume these programs read from stdin and write to stdout and, thus, are meant to be run like this: myprog_lnx < filein > fileout My users may log in from a Linux or Solaris... (3 Replies)
Discussion started by: gsal
3 Replies

4. Programming

Daemon direction. Or, What do I need to watch for?

Hi, I'm writing my first daemon application. I need to make sure I cover my bases as far as correct procedures, etc... I've tried to do my own legwork by reading as much as I could on daemonizing programs, etc... There are so many different examples, some include this but not that, etc...... (3 Replies)
Discussion started by: mph
3 Replies

5. Fedora

Need Direction for extra work ?

Hey , I have become pretty normal, using unix and what not and working around FEDORA 9 I was wondering does anyone have any IDEAS or have anything I should try to build or scripts to write , or possibly know any sites where I could practice some things just so I know I am writing them... (2 Replies)
Discussion started by: Producer
2 Replies

6. Fedora

In need of some direction

Okay, so I'm not a complete newb when it comes to using Unix/Linux. I've been using Ubuntu for a few years now and I've dipped my toes into a few other distros but now I want to get a bit serious. I'm looking at becoming a sysadmin but the trouble is...I have no idea where to start. What I'm... (1 Reply)
Discussion started by: Tamachan87
1 Replies

7. Shell Programming and Scripting

Displays the text upward

I need to print out text from a file in the console up, you know someone like that? (8 Replies)
Discussion started by: gizmo16
8 Replies

8. AIX

New to aix virtualization direction ?

picked up a 9111-520 p5 hardware recently with 8 Gig of RAM, lots of internal disk space...6 x 140 gig had 7.1 pre-installed, and managed to upgrade the firmware to latest SF240_xxxx goal is to virtualize this and have LPARs running aix 7.1, 6.x, and Rhat for ppc .. need some... (13 Replies)
Discussion started by: ppchu99
13 Replies

9. Shell Programming and Scripting

Search and Destroy Script Direction Help

Being a beginner in scripting I am not sure the direction to take to accomplish the below task and would love suggestions. GOAL input file: domains.list Read input file, search in named.conf and find domain and delete entry for the purpose of cleanup activity. named.conf entry example zone... (8 Replies)
Discussion started by: djzah
8 Replies
AMANDA-SCRIPTS(7)						    Miscellanea 						 AMANDA-SCRIPTS(7)

NAME
amanda-scripts - Configuring and using the Script API DESCRIPTION
The Script API is a flexible system for invoking user-supplied scripts at various points in the execution of Amanda. This manual page describes the operation and configuration of the API. For help writing Script API scripts, see http://wiki.zmanda.com/index.php/Script_API. SCRIPTS
This section lists the scripts included with Amanda, see the individual man page for instructions on using them. For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com. o amzfs-snapshot(8), - create/destroy zfs snapshot. o script-email(8), - send email. Script properties work just like application properties: they are insensitive to case, and - (dash) and _ (underscore) may be used interchangeably. SCRIPTS OUTPUT PROPERTY
A pre-dle-amcheck, pre-dle-estimate or pre-dle-backup executed on the client can output property on stdout that are sent to the application. If the output line matches "PROPERTY str1 str2", Amanda sets a property called "str1" by the value of "str2", that property is sent to the application. SEE ALSO
amanda(8), amanda.conf(5) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
Jean-Louis Martineau <martineau@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Dustin J. Mitchell <dustin@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Amanda 3.3.1 02/21/2012 AMANDA-SCRIPTS(7)
All times are GMT -4. The time now is 03:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy