[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]


     Re: [snips-users] No Subject on Notifier.pl Emails

<3C6F3507 21284A1C at navya.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.95.6i
In-Reply-To: <3C6F3507 21284A1C at navya.com>; from Vikas Aggarwal on Sat, Feb 16,
2002 at 11:43:51PM -0500
Sender: owner-snips-users at navya com
Precedence: normal

On Sat, Feb 16, 2002 at 11:43:51PM -0500, Vikas Aggarwal wrote:
> Chris Cannon wrote:
> > 
> > I am running snips with the pingmon, and have notifier.pl called from
> > snipslogd to send email of critical events.  However, these emails never
> > include a subject line.  I see that the notifier script has variables for
> > subject, but I never have received an email with a subject line so far.
> notifier.pl calls the Unix 'mail' program to do the actual mailing.
> Historically the /usr/ucb/mail program accepted a subject flag on the
> command line (-s) but /bin/mail did not accept such a flag.  On newer
> systems this might be different, so you can test by editing this following
> line of code in notifier.pl (around line 333)

Specifically, on Solaris, there's a half dozen mail programs that come
bundled with the operating system.  Ideally, I think this routine should
simply call "sendmail -t" -- but I think that would require a few more
changes than just the one Vikas mentions (and could result in some odd
warnings that might panic some).

But, you can use any one of the following:

	/usr/bin/mail    <- does NOT accept "-s"

(and I'm probably missing a couple - but hopefully that clarifies things


> 	-vikas
> --------------------------------------------
> if ($email_program =~ /ucb/) {
>   open(XPIPE, "|$email_program -s \"SNIPS notification: $subject\"
> $address") 
> ||
>    die "Cannot open $email_program.\n";
> }
>   else { # not ucb/mail so cannot take -s command line option
>     open(XPIPE, "|$email_program $address") || die "Cannot open
> $email_program.\
> n";

Russell M. Van Tassell
russell at loosenut com

Love your enemies, for they tell you your faults.    - Benjamin Franklin

Zyrion Traverse Network Monitoring & Network Management Software