LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
LinkBack Search this Thread
Old 01-15-2010, 11:51 AM   #1
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS, Linux Mint , Solaris 10
Posts: 1,565
Blog Entries: 1

Rep: Reputation: 79
Piping mail to a script


I am trying to pipe email going to ng_recycle but I am getting an error and it won't fire off the script...

Code:
hamster1 sendmail[24762]: [ID 801593 mail.info] o0FHcmj9024761: to="|/usr/home/chrish/scripts/ng_recycle.sh", ctlad
dr=<hamster1_ng@hamster1> (1/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=30842, dsn=5.3.0, stat=unknown mailer error 1
Here is the aliases file

Code:
hamster1_ng: "|/usr/home/chrish/scripts/ng_recycle.sh"
Currently all the script is doing is this
Code:
#!/bin/ksh -fuh
#
#
#
logger -p local5.info -t APACHE_RECYCLE "Nagios triggerd an apache recycle"
#
exit 0
#
#-30-
Any ideas?

-C
 
Old 01-16-2010, 05:10 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,570
Blog Entries: 47

Rep: Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399Reputation: 1399
Quote:
Originally Posted by custangro View Post
Any ideas?
Grep your maillog for "o0FHcmj9024761" and post back full output in code tags?
 
Old 02-02-2010, 12:11 PM   #3
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS
Posts: 370

Rep: Reputation: 38
Depending on your distro you may have to add a symlink to your script in /etc/smrsh to give permission to sendmail to run the script.
 
Old 02-03-2010, 10:47 AM   #4
jonesr
Member
 
Registered: Feb 2008
Location: Sacramento
Distribution: RHEL AS, mostly
Posts: 36

Rep: Reputation: 18
Quote:
Originally Posted by frndrfoe View Post
Depending on your distro you may have to add a symlink to your script in /etc/smrsh to give permission to sendmail to run the script.
...and ng_recycle.sh will need ownership and mode that allows execution in the mailer's context.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Piping to mail and adding a subject line. Echo Kilo Linux - General 1 12-03-2005 11:24 AM
piping to and 'error' window from termalan (shell script) dna3e8 Linux - Software 2 03-19-2005 11:08 AM
Exim - piping mail sent to a particular address to a script Khang Linux - Software 2 01-31-2005 11:04 AM
piping mail into a program ejy2 Linux - Networking 5 06-23-2004 10:35 PM
Piping to ttoogg in bash script goofyheadedpunk Linux - General 8 06-06-2004 05:44 PM


All times are GMT -5. The time now is 12:07 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration