Lengkap

Linux Script custom

Need to write a simple shell script ( Ubuntu/CentOS) that is ran using crontab, idea is to scan for number of connections per ip, if it exceeds specified limit, run command to block that IP in our firewall.

Functions:

1. run netstat -atun | awk '{print $5}' | cut -d: -f1 | sed -e '/^$/d' |sort | uniq -c | sort -n

2. scan number of connections and IP addresses

sample output:

2 [login to view URL]

2 [login to view URL]

3 [login to view URL]

5 [login to view URL]

5 [login to view URL]

5 [login to view URL]

6 [login to view URL]

6 [login to view URL]

8 [login to view URL]

9 0.0.0.0

10 [login to view URL]

12 [login to view URL]

22 [login to view URL]

22 [login to view URL]

24 [login to view URL]

24 [login to view URL]

60 [login to view URL]

370 [login to view URL]

450 [login to view URL]

Threshhold limit in conf is for ex 200 that means the last 2 ips should be blocked using command:

csf -d [login to view URL]

csf -d 450 175.137.180

use sendmail to email this event (only if block was done)

Must work without bugs/crashing/memory leaks etc, at end of script it must be terminated.

Kemahiran: Pengaturcaraan C, Linux, Skrip Kekerang, Ubuntu, UNIX

Lihat lagi: linux script mysql sync, tell friend script custom, dash linux script, linux script manager users, linux script error handling, linux script probleme, linux script replace string file, linux script update database, linux script imagemagick, html2pdf linux script, linux script backup lto, linux script transferring files sftp, read the numbers and decide what the next number should be 15 14 13 12 11 10 9

Tentang Majikan:
( 1 ulasan ) Ajax, Canada

ID Projek: #21796058

Dianugerahkan kepada:

kaloyan13

Master in Bash scripting. Can finish your script in 30 minutes. Thank you......................................

$20 USD dalam sehari
(432 Ulasan)
7.2

5 pekerja bebas membida secara purata $28 untuk pekerjaan ini

liujianmin

Hi, Glad to apply to your offer. I have gone through your job description in depth, and now I am sure that I can develop what you want exactly to your expectations, OR more. I have been through many frameworks that bo Lagi

$30 USD dalam 7 hari
(3 Ulasan)
1.2
victoryfive1990

Hello. Fast and accurate result will be delivered on time. I am experienced working with the project as you suggest and I think I can complete your work on time. Now I am fully avaliable for your project and for your t Lagi

$30 USD dalam 7 hari
(0 Ulasan)
0.0
Artemrodin1987

Hello, I have just read your requirement very careful and I am sure that I can finish it for 1 hours because I am a professional C/C++ expert. Now I don't have even one review because I am a new freelancer. So I think Lagi

$30 USD dalam sehari
(0 Ulasan)
0.0
guoming1988

Hi, sir. I have many experiences with Python, C/C++ langeuages for 15 years. And I think your project is not so difficult work for me. If you want work with me, you’ll see satisfactory results. I am looking forward to Lagi

$30 USD dalam 7 hari
(0 Ulasan)
0.0