Server monitoring using shell script


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Server monitoring using shell script
# 1  
Old 04-04-2016
Server monitoring using shell script

I want to write a shell script which is used in cron job and it runs every 4 hours to check whether tomcat servers are running or not . If servers are not running , one email should be triggered like alert notification. if servers are Running then no need to print anything.

This is what i want to achieve through shell script

Can you please guide me how to write these or better approach to write this. Thanks in advance.
# 2  
Old 04-04-2016
Hi,

What have you tried so far?

Gull04
# 3  
Old 04-04-2016
So far I tried using by command "netstat" and grep.
But alternatively I need script for cron job is should run for every 4 hours and send email when server is down
# 4  
Old 04-04-2016
Hi,

I'm not sure how you would achieve your goal using netstat, you should read this thread for some help with this matter.

Regards

Gull04
# 5  
Old 04-04-2016
Sure gull04.

I will go through this link.
# 6  
Old 05-12-2016
Quote:
Originally Posted by kk123
I want to write a shell script which is used in cron job and it runs every 4 hours to check whether tomcat servers are running or not .
Well, you can write a script that will execute something like 'service tomcat status', parse output with grep and start it if they didn't run.

It's a common job actually.

You can use a supervisord instead, which can run any service or program and immediately restart if it.

Or you can use Munin for the same goal: monitor the service or process and start if it's fail. You can look for some examples here.

I'd suggest you to invest some time to learn a well known and supported tool instead of making a your own script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Monitoring Script

Hi guys, I didn't understand this monitoring script request - I don't ask for the script result. If you understand the request, I'm just asking an explanation to simplify it for me. THE Script Request: Our organization keeps various files in directories structured as... (2 Replies)
Discussion started by: moshesa
2 Replies

2. Shell Programming and Scripting

Monitoring Tomcat Service with shell script

Hello Forum, I have prepared script to monitor the tomcat status. Following is the script which will monitor tomcat instance. I need little modifcation in the script. My script will grep for process, the output of grep command will analyze by if condition under for loop and will send... (2 Replies)
Discussion started by: ooilinlove
2 Replies

3. Shell Programming and Scripting

Shell script for process monitoring

Im having a bit of troble coming up with a script that does this monitors processes to see if they die, if they do die, restart the process and write out to a log file that the process was restarted with the new PID and the date and time the new process was launched. Any suggestions? (1 Reply)
Discussion started by: jspinal
1 Replies

4. Red Hat

HELP - Resource/Performance Monitoring Script - Red Hat Enterprise Linux Server

Hi all, ------------------------- Linux OS Version/Release: ------------------------- Red Hat Enterprise Linux Server release 5.5 (Tikanga) Linux <hostname> 2.6.18-194.8.1.el5 #1 SMP Wed Jun 23 10:52:51 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux I have a server that hosts 30+ Oracle... (1 Reply)
Discussion started by: newbie_01
1 Replies

5. Shell Programming and Scripting

Monitoring Tomcat Instance using shell script

Hello Forum, I have prepared script to monitor the tomcat status. Following is the script which will monitor tomcat instance.I need little modifcation in the script. My script will grep for java,the output of grep command will analyze by if condition under for loop and will send following echo... (7 Replies)
Discussion started by: coolguyamy
7 Replies

6. Shell Programming and Scripting

Shell Script for monitoring File system.

Hi, need help to write one shell script to monitor UNIX file systems and if any changes happend like deletion of any file, adding new file, time stamp changed, permisson changed etc. Script need to send alert mail to defined person/mail id. I request someone to help me to create the... (1 Reply)
Discussion started by: vjauhari
1 Replies

7. Shell Programming and Scripting

shell script for monitoring users activities

hi I need a shell script which runs perpetually in background and monitors different aspects of different users on different files and their usages for example say there r 3 users so i want when they log in i.e. their log in time and their file access, modify and change log of each file of a... (3 Replies)
Discussion started by: rrd1986
3 Replies

8. Shell Programming and Scripting

Error in script to automate the daily monitoring process of UNIX server and it's proc

hi friends, I am trying to automate the daily monitoring process of UNIX server and it's processes. the script are below i executed the above script using ksh -x monitortest1.sh in root login . It shows error at some lines . 1. i logged in using root ,but it... (8 Replies)
Discussion started by: rdhaprakasam
8 Replies

9. Shell Programming and Scripting

Weblogic monitoring shell script

HI, I'm new in unix. I would like to know if you have a ready script for monitoring the weblogic and managed servers. I want to have a script that checks the weblogic once in a while if it's up and running. if not running, will send an email to me. any idea? please help me. i will... (4 Replies)
Discussion started by: tungaw2004
4 Replies

10. Shell Programming and Scripting

Linux Server Monitoring Script !!!

I am the Linux Admin in my organisation and need to write a shell script which will monitor the machine statistics every day and will send a consolidated report to me on my email id / will display the output into a file. Does anyone have such kind of script fulfilling this kind of purpose? ... (4 Replies)
Discussion started by: csaha
4 Replies
Login or Register to Ask a Question