| |||
| Shell script for a mail queue notification! Hi guys I am looking for a script to run in cron and notify the admin, if the mail queue exceed some predefined level. i have made the script and it working fine by executing the qmHandle -s command. But I found out these mail notification is not suitable to alert the admin, since if the mail queue is huge then notification mail will also wait until the other mails been delivert. so the solution is not ideal. What other way I can make this alert? is there any way to alert another server to send an email? or any other suggestions? kind regards Nathan |
| |||
| Re: Shell script for a mail queue notification! On Thu, 08 Mar 2007 02:18:58 +0100, Nightman wrote: > I am looking for a script to run in cron and notify the admin, if the mail > queue exceed some predefined level. i have made the script and it working > fine by executing the qmHandle -s command. > > But I found out these mail notification is not suitable to alert the > admin, since if the mail queue is huge then notification mail will also > wait until the other mails been delivert. so the solution is not ideal. > > What other way I can make this alert? is there any way to alert another > server to send an email? or any other suggestions? Does your distro have nail (now known as Heirloom mailx)? http://heirloom.sourceforge.net/mailx.html "Supports SMTP to send messages directly to a remote server." Alternatively you could consider sending via IM or as SMS message to admin's cellphone. -- -- Posted via a free Usenet account from http://www.teranews.com |
| |||
| Re: Shell script for a mail queue notification! mailx.html seems to be a big thing install compare to the purpose it. Anyway the sms option will be perfect. I am trying to find how this can be done from the server. any help? Is there any way to pass some data to another server to trigger something to send an email? -- Med venlig hilsen Nathan Thurairajasingham http://www.remozone.dk salg@remozone.dk "Snowbat" <snowbat@geocities.com> wrote in message news:pan.2007.03.09.02.30.49.213099@geocities.com. .. > On Thu, 08 Mar 2007 02:18:58 +0100, Nightman wrote: > >> I am looking for a script to run in cron and notify the admin, if the >> queue exceed some predefined level. i have made the script and it working >> fine by executing the qmHandle -s command. >> >> But I found out these mail notification is not suitable to alert the >> admin, since if the mail queue is huge then notification mail will also >> wait until the other mails been delivert. so the solution is not ideal. >> >> What other way I can make this alert? is there any way to alert another >> server to send an email? or any other suggestions? > > Does your distro have nail (now known as Heirloom mailx)? > http://heirloom.sourceforge.net/mailx.html > "Supports SMTP to send messages directly to a remote server." > > Alternatively you could consider sending via IM or as SMS message to > admin's cellphone. > > > -- > > > -- > Posted via a free Usenet account from http://www.teranews.com > |
| |||
| Re: Shell script for a mail queue notification! On Fri, 09 Mar 2007 10:41:38 +0100, Nightman wrote: > mailx.html seems to be a big thing install compare to the purpose it. Nail seems to be already installed on my Mandriva 2006 box in place of Berkeley Mail. Which distro does your server run? Nail might be already installed or easily installable from the repositories. > Anyway the sms option will be perfect. I am trying to find how this can be > done from the server. > any help? Lots of scripts at the following URL. Note that some cellphone providers are known to block incoming SMS from the free international gateways - test with the admin's cellphone first, or ask in a dk newsgroup about policies of the local networks: http://tuxmobil.org/phones_linux_sms.html Another possibility is to hook a cellphone up to the server and send SMS through that. You'll be looking for a command line program that can send SMS on a supported phone. Some ideas here: http://tuxmobil.org/phones_linux_nokia_other.html > Is there any way to pass some data to another server to trigger something > to send an email? Limited only by imagination. eg. A remote server could be scripted to log in, check the mail queue, and send a mail through it's own mail system. Or you could use an expect script to talk to any mail server you like. Here's a pair I wrote previously (crude since doesn't handle SMTP error codes) - the expectscript is called from a bash script. #!/bin/bash message="Message goes here." ../expectscript smtp.somenetwork.com 25 target********.com sender********.com "$message" exit 0 #!/usr/bin/expect -f set resfile [open /home/USER/tmpfile w] set targetserver [lindex $argv 0] set targetport [lindex $argv 1] set touser [lindex $argv 2] set fromuser [lindex $argv 3] set body [lindex $argv 4] spawn telnet expect "telnet>" send "open $targetserver $targetport\n" expect "220" send "HELO somenetwork.com\n" expect "250" send "mail from: $fromuser\n" expect "250" send "rcpt to: $touser\n" expect "250" send "data\n" expect "354" send "\n$body\n.\n" expect "250" puts $resfile $expect_out(buffer) close $resfile send "quit\n" expect "221" exit 0 -- -- Posted via a free Usenet account from http://www.teranews.com |
| |||
| Re: Shell script for a mail queue notification! Snowbat wrote: > On Fri, 09 Mar 2007 10:41:38 +0100, Nightman wrote: > >> mailx.html seems to be a big thing install compare to the purpose it. > > Nail seems to be already installed on my Mandriva 2006 box in place of > Berkeley Mail. Which distro does your server run? Nail might be already On another server, run #ssh remotehost "mailq" and parse the output. |
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No mail notification.... | Jim | Windows Vista | 1 | 04-21-2007 04:00 PM |
| script shell pour lancement easy-php | Mathieu | Windows XP | 4 | 03-03-2007 03:15 PM |
| E-mail notification animation | Patrick Carlson | Windows Vista | 3 | 02-10-2007 08:01 AM |
| seeking thru a string in a shell script | Chris the Hunter | Linux | 18 | 01-19-2007 02:45 PM |
| Shell Notification Error | =?Utf-8?B?SmFzb24gT2xkaWdlcw==?= | Windows XP Tablet PC Newsgroup | 2 | 11-14-2004 10:30 PM |