cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1483
Views
0
Helpful
1
Replies

TCL send email multiple CC addresses

ilirnako1
Level 1
Level 1

I want to use TCL script in ASR9k   to send emails in log event .

I am trying to add munltiple CC adresses ,but I receive error when script is executed :

RP/0/RSP0/CPU0:Sep 16 12:18:42.533 : syslog_dev[92]: noscan: Requested action not taken: mailbox name not allowed 
RP/0/RSP0/CPU0:Sep 16 12:18:42.533 : syslog_dev[92]: noscan:     while executing 
RP/0/RSP0/CPU0:Sep 16 12:18:42.533 : syslog_dev[92]: noscan: "smtp_send_email $mail_msg" 
RP/0/RSP0/CPU0:Sep 16 12:18:42.533 : syslog_dev[92]: noscan:     invoked from within 
RP/0/RSP0/CPU0:Sep 16 12:18:42.533 : syslog_dev[92]: noscan: "if [catch {smtp_send_email $mail_msg} result] { 
RP/0/RSP0/CPU0:Sep 16 12:18:42.533 : syslog_dev[92]: noscan:     error $result $errorInfo 
RP/0/RSP0/CPU0:Sep 16 12:18:42.533 : syslog_dev[92]: noscan: }" 

 

This is the Script

::cisco::eem::event_register_syslog pattern {Line protocol on Interface TenGigE0/0/1/2, changed state to Down }

namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

array set arr_einfo [event_reqinfo]


set mail_pre "Mailservername: $_email_server\n"
append mail_pre "From: $_email_from\n"
append mail_pre "To: $_email_to\n"
append mail_pre "Cc: ip@abc.al ,noc@abc.al\n"
append mail_pre "Sourceaddr: $_ipaddress\n"

 

Which can be the right  syntax for the CC adresses ?

 

Ilir

1 Reply 1

ilirnako1
Level 1
Level 1

I used 

append mail_pre "Cc: $_CCaddress\n"   

 

 

and at the Cisco router :

 

event manager environment _CCadress user1@abc.com user2@abc.com user3@abc.com 

 

 

 

It works !

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: