268 Posts

May 7th, 2014 05:00

Try using below command syntax,

smtpmail -h -s " " -a

Use switch -a and log file name.

See if it helps.

Regards,

Prajith

10 Posts

May 7th, 2014 06:00

I used the –a “ networker directory\log”, but it just hangs, ran it from the command line, got the following;

0 1399468096 2 0 0 11156 9660 0 “server name removed” smtpmail NSR warning 2 %s 1 0 61 protocol failure; got 501 5.1.3 Bad recipient address syntax

4 Operator

 • 

14.4K Posts

May 10th, 2014 12:00

SML099 wrote:

Q - I have created a script to email this log, but I seem to be unable to email the contents,
I am just piping smtpmail on the end of the render cmd;

nsr_render_log ..\logs\daemon.raw > daemon.log|smtpmail -s "Testing email notification" -h "mail server address" "email account"

I seem to be able to send the output of an mminfo cmd when I pipe that to an email;

mminfo -av -q "client="client name",savetime>today"|smtpmail -s "Testing email notification" -h "Testing email notification" "email account"

If someone has done this before, any advice welcome?

First, why would you render log and then have it emailed to yourself?  That's silly.  One of the days log will be big and you will keep sending it to yourself.  If you wish to read the log then read it when necessary.  If you wish to receive proactive log output then grep out all normal messages and pay attention to whatever is left.  But rendering whole log is plain silly. Period.

With that said, take a look again to what you are doing above.  With mminfo you are sending its standard output as input to smptmail.  Is this what you do with nsr_render_log?  No, because its output you already redirected to local file so there is nothing to be passed to smtpmail. And given that you are Windows users, you may wish to explore possibilities with blat which once upon the time used to be more used than smtpmail.

10 Posts

May 12th, 2014 06:00

Sorry maybe I didn’t explain myself correctly, I am not emailing it to myself, but to a group email box and would only be emailing certain messages within the log.

As I can render it any at time and analysis the log myself. The issue I seem to have is the emailing part, I can render the log locally.

But I am unable to send the contents (even if it’s just a  couple of lines), or even sent as an attachment using –a “log filer name”

The mminfo  command was an example to show that the smtpmail command works fine “smtpmail -s "Testing email notification" -h "Testing email notification" "email account"

To be clearer; how would I send the contents of a rendered log file (a small amount of messages!!) via a script using the above smtpmail commands?

4 Operator

 • 

14.4K Posts

May 12th, 2014 07:00

type | smtpmail....

4 Operator

 • 

1.3K Posts

May 12th, 2014 07:00

In your attempt you have actually redirects the output to a file and then piping it to smptmail. This means your are trying to send null. What you should doing is this -> nsr_render_log daemon.raw | smtpmail -s "Testing email notification" -h "mail server address" "email account"

10 Posts

May 13th, 2014 03:00

I thought type command outputs to contents to the screen.

4 Operator

 • 

14.4K Posts

May 13th, 2014 04:00

Why when with pipe you feel smtpmail - this is how any notification with NW works in the first place.  If you look closely at original post it is clear that OP doesn't get anything due to redirecting output to a file thus whole line after that doesn't make sense any longer.

10 Posts

May 13th, 2014 04:00

Sorry typo, there, that is correct, I should of put; nsr_render_log ..\logs\daemon.raw |smtpmail -s "Testing email notification" -h "mail server address" "email account"

Like I said previously it just doesn’t output the email, put when I run it from cmd I get the following;

0 1399468096 2 0 0 11156 9660 0 “server name removed” smtpmail NSR warning 2 %s 1 0 61 protocol failure; got 501 5.1.3 Bad recipient address syntax

215 Posts

May 13th, 2014 04:00

I’m not sure if there are different flavors of smtpmail.exe but the following link documents one showing exact syntax required for various scenarios including attaching of a file.

http://www.smtpinfo.com/

regards,

Adam

215 Posts

May 13th, 2014 04:00

Here’s a sample of how to insert a files (email.tmp) contents into the body of an email using mailx, granted this is not smtpmail.exe but perhaps it would behave similarly.

mailx -s "my subject line" destination-addrs < email.tmp

regards,

Adam

From: Kirkpatrick, Adam

Sent: Tuesday, May 13, 2014 7:24 AM

To: 'jive-682577862-kse-2-hfuw@emc-ecn.hosted.jivesoftware.com'

Subject: RE: - Neworker smtpmail

I’m not sure if there are different flavors of smtpmail.exe but the following link documents one showing exact syntax required for various scenarios including attaching of a file.

http://www.smtpinfo.com/

regards,

Adam

215 Posts

May 13th, 2014 04:00

Yes I am well aware mailx is Unix based, refer to the latter part of my update, I suggested trying the redirection of a files contents as used with mailx which may also work for smtpmail.exe.

4 Operator

 • 

14.4K Posts

May 13th, 2014 04:00

Adam Kirkpatrick wrote:

mailx -s "my subject line"   destination-addrs  <  email.tmp

Adam, mailx is UNIX standard - here we are talking about Windows and utility shipped with NetWorker.

4 Operator

 • 

14.4K Posts

May 13th, 2014 04:00

SML099 wrote:

I thought type command outputs to contents to the screen.

It reads content from file and sends it to standard output which you pipe and feed into smtpmail - same as you would do with nsr_render_log command.  As you filter the things out first, I assume you read content from filtered file.

10 Posts

May 13th, 2014 05:00

Thanks Adam I ran; smtpmail -s "Testing email notification" -h "Testing email notification" "email account" < "Networker directory\daemon.log"

And it email the contents of the log file to my group mail box!!

No Events found!

Top