script for monitoring service


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script for monitoring service
# 1  
Old 02-24-2010
Question script for monitoring service

Hi,

I am new to shell programming,

I would like to write a script which will monitor sendmail service in linux, and if service goes down it will send the mail

can you please suggest me how to monitor the service?

Regards,

Manoj
# 2  
Old 02-24-2010
First, check if the process is still there using ps and grep
Second, if you can, try and connect to TCP port 25 and try to get an reaction out of it.

But more fundamentally: if the mail service is down, how do you intent to send a mail telling you it's down? I'd solve that one first.
# 3  
Old 02-24-2010
Maybe SSH to another box and issue the mail command there..?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Infrastructure Monitoring

Problem with service monitoring

This morning we had an activity on our Nagios server, whereby we inserted new disks into the server, and rebooted the server. The disk implementation failed, therefore we had to revoke the changes, and rebooted the server once again. The server was up and running at 6:00 am this morning.... (2 Replies)
Discussion started by: anaigini45
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

Help with a monitoring script

I currently have a shellscript to check the size of a filesystem and email me if the size is over a certain percentage (80%). I have this script on crontab and executes the shell every 10 mins. I have the above in place on 8 servers. It so happens that a file system on one of the servers is... (1 Reply)
Discussion started by: goddevil
1 Replies

4. Shell Programming and Scripting

Monitoring Script

Hello All, I have written a script which will grep for error codes in a file and if the count for the same is about 500 it will send and smpp alert. Here is my code. #!/bin/bash #########################################################################################################... (3 Replies)
Discussion started by: Siddheshk
3 Replies

5. UNIX for Advanced & Expert Users

ldapsearch in monitoring script without bind password written in script

Hi I do a very simple monitoring of our OpenLDAP (runs in cronjob and generate alerts if unsuccessfull) $ ldapsearch -h hostname.domain -D "cn=monitor_user,ou=People,dc=organisation" -w "password" -b "dc=organisation" -x "(&(cn=monitor_user)(ou=People))" dn | grep -v version dn:... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

6. Red Hat

monitoring script

Hi, I ned to monitor the memory for the red-hat machine,when its reaches a threshold value like 2GB then a mail should be sent as soon as it finds the the value is met can you suggest me which is the best way to do this? (2 Replies)
Discussion started by: sriniv666
2 Replies

7. Shell Programming and Scripting

Monitoring script

Hi, I want to write script that monitors particular ports in a server. I completed the script but.... If the server is restarted i need manually start the script.. Is there any way i can make the script start by it self after the server reboot........ Thanks, Firestar (4 Replies)
Discussion started by: firestar
4 Replies

8. Shell Programming and Scripting

Help with Monitoring script

Hi Gurus, Currently I am learning UNIX through online forums and unix blogs. I have the below requirement. I need to write a script to monitor server processes. For example, there are 3 processes currently running on the server.(java, pmrepagent, pmserver). If any of the process goes down,... (2 Replies)
Discussion started by: svajhala
2 Replies

9. Solaris

Monitoring Script

Hi, I want to write a script that will monitor cpu,mem usage and disk usage for entire day and data will be redirected to file, (4 Replies)
Discussion started by: manoj.solaris
4 Replies

10. UNIX for Advanced & Expert Users

monitoring script

i have a unix batch written in c, dealing with really time-consuming database operations i want to write a ksh script to monitor its performance. which items i should monitor? do you have any suggestions? 1)cputime 2)swap area 3)pmem 4) 5) what else? (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies
Login or Register to Ask a Question