LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2009, 08:21 AM   #1
surya_prakash
LQ Newbie
 
Registered: Oct 2008
Location: Hyderabad
Posts: 26

Rep: Reputation: 15
could not find the mail in mail queue


Hi,
All


I hav two ethernet interface cards to my machine eth0 and eth1.through eth1 i can access public network and mail server.where as eth1 is used to access internal network.I wrote a script to monitor eth0 interface.Whenever it goes down it sends mail to administrator.I thought since eth0 is down,I expected the mail to be in mail queue and when the eth0 gets up it will send the mail.But to my pleasant surprise i could find the mail in mail queue when eth0 is down and after eth0 goes up i could not get any mail.Can any expert say why,And what might be the possible reason?

Thanks
surya prakash
 
Old 03-26-2009, 08:27 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
do you see anything in the logfiles?
perhaps you can show us the script.
 
Old 03-26-2009, 08:34 AM   #3
surya_prakash
LQ Newbie
 
Registered: Oct 2008
Location: Hyderabad
Posts: 26

Original Poster
Rep: Reputation: 15
ethtool eth0|grep "Link detected"| cut -d ':' -f2


I used the above command to know the Ethernet interface status in a script called eth1linkstatus if status is "Yes" am writing the process id to /var/run/eth0.pid if status is "No" i am removing the file /var/run/eth0.pid . In the monit script i made the following configuration


check process SERVICE_26 with pidfile /var/run/eth1.pid
start program = "/etc/init.d/eth1linktest start"
stop program = "/etc/init.d/eth1linktest stop"
if 3 restarts within 3 cycles then exec "/usr/local/monit/bin/timeout SERVICE_26"
mode active
group local

if monit fails to restart the service in 3 attempts i am calling a script called timeout . timeout will call a php script to sent the mail.And i am using sendmail client .
 
  


Reply


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
queue mail Gran_Maestre Linux - Server 4 09-30-2008 04:14 PM
exim mail queue alexr186 Linux - Server 1 01-03-2007 08:00 AM
Mail Queue failures Ziggie Linux - General 3 12-06-2005 10:51 AM
qmail mail queue bluestorm Linux - Software 0 10-06-2003 07:52 AM
Mail Queue... shibata Linux - Networking 1 11-24-2001 09:58 AM


All times are GMT -5. The time now is 11:04 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration