Community discussions

 
User avatar
ScottReed
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Thu Sep 24, 2009 9:47 pm
Location: Montana / Western Massachusetts

Populating email BODY with output of "/print"

Mon Oct 22, 2012 2:58 am

Trying to do this:
/tool e-mail send tls=yes to="someone@somewhere.com" subject="Current 172.30.6.0s-IN_USE" body="$[/ip firewall address-list print without-paging where list=172.30.6.0s-IN_USE]"
Email comes through fine but BODY is empty. Instead, the printed output is sent to the console.

How can I get the print output into the email BODY?

Thanks,
Scott
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1120
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Populating email BODY with output of "/print"

Mon Oct 22, 2012 7:42 am

Here is an example from one of my routers that works:
send to=mail@domain.com subject="AP down" body="AP down.\r\n\r\nProblem found on $[/system clock get date] at $[/system clock get time]"
Unimus - configuration management, automation and backup solution
Mass Config Push, network-wide RouterOS upgrades, and more!
 
deejayq
Member Candidate
Member Candidate
Posts: 195
Joined: Wed Feb 23, 2011 8:33 am

Re: Populating email BODY with output of "/print"

Mon Oct 22, 2012 11:58 am

i think you should use get instead of print
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5942
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Populating email BODY with output of "/print"

Mon Oct 22, 2012 12:28 pm

You can't gept print output in email body. What you can is print to file and attach file to the email.
 
User avatar
ScottReed
Member Candidate
Member Candidate
Topic Author
Posts: 111
Joined: Thu Sep 24, 2009 9:47 pm
Location: Montana / Western Massachusetts

Re: Populating email BODY with output of "/print"

Mon Oct 22, 2012 8:04 pm

@deejayq - "get" works great, but how do I get all the entries in a list? I'm assuming some "for" loop?

@mrz - That's what I have been doing, but i'm tired of having to open an attachment on my phone when the message arrives.

Thanks,
Scott

Who is online

Users browsing this forum: MSN [Bot] and 26 guests