Operating System - HP-UX
1748268 Members
3730 Online
108760 Solutions
New Discussion юеВ

Re: Email failure, but no message in /var/adm/syslog/mail.log

 
SOLVED
Go to solution
Joseph P. Smith
Regular Advisor

Email failure, but no message in /var/adm/syslog/mail.log

Good Morning,

Running hp-ux 11.23, Sendmail 8.11.1 (PHNE_35951)

A scheduled DataProtector v 6.0. job executes a post-exec shell script. Included in this script is the command:

echo "omnirpt -report media_list -timeframe 12 12 -email dpmail -html" |at now + 5 minutes

The recipients in the distribution list dpmail are MS/Exchange clients.

The shell reports back the normal message:

warning: commands will be executed using /usr/bin/sh
job 1252029781.a at Thu Sep 3 22:03:01 2009

Just this past week the command fails.
/var/adm/syslog/mail.log for the execution time has no entries, and recipients in the "dpmail" distribution list do not receive emails.

I execute "mailq" and /var/spool/mqueue is empty

The next morning, the same "echo omnirpt ..." command is run interactively, all is well. See below the excerpt from
/var/adm/syslog/mail.log (actual names changed to foo* for security):

Sep 3 07:05:13 foonode sendmail[21031]: n83B5DI21029: to=foo1.foo2@foo.net,
foo3.foo4@foo.net,foo5.foo6@foo.net,foo7.foo8@foo.net, ctladdr=roo
t (0/3), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=212154, relay=chelse
a3.mwra.net. [10.1.1.48], dsn=2.0.0, stat=Sent ( <200909031105.n83B5DI21029@foonode.foo.net> Queued mail for delivery)

and all intended recipients successfully receive email on their Exchange accounts.

Questions:
What causes no message to be a logged?
How do I view outcome of "at" command?
Why would the same command succeed if executed interactively?

I have searched ITRC with "no message in /var/adm/syslog/mail .log" with limited success, as I step through other solutions for different problems without success, hence this request. Any pointer to a more valid search string and actual solution is greatly appreciated. Thanks.
5 REPLIES 5
Steven Schweda
Honored Contributor

Re: Email failure, but no message in /var/adm/syslog/mail.log

I know nothing, but ...

> What causes no message to be a logged?

No message in the e-mail log file suggests
that no one actually tried to send any
e-mail.

> How do I view outcome of "at" command?

It returns an exit status, like every other
command. How you'd extract that in this
environment is a mystery to me.

> Why would the same command succeed if
> executed interactively?

A completely different environment might have
some effect.

You might try things like running a simpler
command/script, whose execution can be more
easily detected. (If the script creates a
file, and you see that file created, then you
know that the script was run. And so on...)
A script might be able more easily to do more
error detection and handling than you can
cram onto a simple command line, too.
TTr
Honored Contributor
Solution

Re: Email failure, but no message in /var/adm/syslog/mail.log

> at now + 5 minutes

The at command (cron) sends email to the root account of the local server with the entire "at" job output. Check root's mail on the local server.

As Stephen mentioned, if there are no mail records the mail command was never executed which might indicate that the "at" job may have not been executed either.

Check /var/adm/cron/log and look for a log entry of the "at" job to see if it got executed or not. There could be a problem with the capacity of the "at" queue.
Joseph P. Smith
Regular Advisor

Re: Email failure, but no message in /var/adm/syslog/mail.log

>> I know nothing, but ...

But you have forgotten more than I'll ever know!

> What causes no message to be a logged?

>> No message in the e-mail log file suggests that no one actually tried to send any e-mail.

The script invokes ksh
$! /usr/bin/ksh -xv
The command used to work, i.e. email was sent & received, and entries were made to /var/adm/syslog/mail.log 7 days ago with no problem.

> How do I view outcome of "at" command?

>>It returns an exit status, like every other command. How you'd extract that in this environment is a mystery to me.

At least I'm not missing something obvious. It doesn't seem to be shell problem, more of a smtp/sendmail issue, but there has to be a place that captures status/events

Breaking the command down might work into file creation and then invoking a mailer to send it. I'll experiment.
Joseph P. Smith
Regular Advisor

Re: Email failure, but no message in /var/adm/syslog/mail.log

Checked root's mail and voila!

sh[52]: omnirpt: not found.

Doh! I know who did it, and would lead a posse, but not before a long weekend. I've put the full path in the command (as I should have done), and will never assume again.

Thank-you both.
Joseph P. Smith
Regular Advisor

Re: Email failure, but no message in /var/adm/syslog/mail.log

See above. Just closing things up. Thanks.