LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Monitoring TCP Port Traffic (https://www.linuxquestions.org/questions/linux-server-73/monitoring-tcp-port-traffic-4175578325/)

Javezim 04-25-2016 10:03 PM

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?

Turbocapitalist 04-26-2016 03:01 AM

Why not run the daemon from xinetd or inetd instead? Or is it frequently connected to with many new connections?

JJJCR 04-26-2016 04:13 AM

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.

Habitual 04-26-2016 07:09 AM

Quote:

Originally Posted by Javezim (Post 5536548)
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!

donald3.heckel 04-29-2016 09:44 AM

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


All times are GMT -5. The time now is 03:51 AM.