LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-25-2016, 10:03 PM   #1
Javezim
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Rep: Reputation: Disabled
Monitoring TCP Port Traffic


Hey Team,
Is there a way that anyone knows of to automate the following: Ok we have an FTP Server that receives traffic on Port 443. Is there a way to monitor it and when no traffic is received or its coming back as not being able to connect into, we can restart a service or reboot the server?
We have monitoring in place and a continuous issue is that the 443 Port receives no data. We have to manually reboot the server or restart the service, and it's something we generally would like to automate.
Anyone out there have a similar situation and have some sort of automation package or software they use?
 
Old 04-26-2016, 03:01 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,292
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
Why not run the daemon from xinetd or inetd instead? Or is it frequently connected to with many new connections?
 
Old 04-26-2016, 04:13 AM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,148

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
It would be better if you can include what is the FTP Server platform you're using.

Some FTP software includes a built-in option to block IP Address if multiple failed login and auto unblock after a specified number of hours or minutes.
 
Old 04-26-2016, 07:09 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Javezim View Post
Hey Team,
Is there a way that anyone knows of to automate the following: Ok we have an FTP Server that receives traffic on Port 443. Is there a way to monitor it and when no traffic is received or its coming back as not being able to connect into, we can restart a service or reboot the server?
Yes.
Examples are abundant.
Ask if you need further help.

Have a Good Day!
 
Old 04-29-2016, 09:44 AM   #5
donald3.heckel
Member
 
Registered: Aug 2014
Posts: 60

Rep: Reputation: Disabled
Suggestion

Hello,

I believe the best way in this case to automate your task is to create a script and run it as a systemd service or a cron job.

Code:
#!/bin/bash

systemctl restart service1 # restart services on execution.
systemctl restart service2

command1
command2 # Your automated commands (Just like in the terminal)

main subroutines # More commands
main subroutines

exit 0 # Exit on Success
and save it as "yourscriptname".

furthermore,

run "chmod +x yourscriptname" (without quotes)

and copy it over to your /usr/bin directory if you want to run it directly from the command line as "yourscriptname"

and/or as a cron job:

http://www.cyberciti.biz/faq/how-do-...-or-unix-oses/

I hope this suggestion helps you in your situation of automation.

Sincerely,

donald3.heckel

Last edited by donald3.heckel; 04-29-2016 at 09:46 AM.
 
  


Reply

Tags
automation, monitor, tcp, ubuntu 14.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate TCP traffic on a port to another sidsgr88 Linux - Networking 0 05-25-2013 02:45 PM
Can I "tee" traffic on a TCP port? bigearsbilly Linux - Networking 6 03-05-2012 03:31 AM
Traffic monitoring and port mirroring reeaver Linux - Networking 3 12-13-2011 07:39 AM
monitoring traffic on specific port lildee Programming 2 10-03-2009 06:03 AM
unwanted network traffic on tcp port 135 debasish_5849 Linux - Security 4 04-20-2006 10:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration