01-06-2017 12:17 PM
I was testing out an EEM configuration, and cannot find published documentation on one particular step: how to modify TCL templates for e-mails.
In XRv devices I am able to successfully modify the templates by going into the linux filesystem (/pkg/lib/tcl directory) and using vim. On hardware boxes, such as a lab 9K we have running our production 4.3.4, I cannot do the same (I get corrupt file errors) after modifying the template.
These are the templates I speak of:
-rw-r--r-T 1 0 0 185 Apr 08 09:14 email_template_cfg.tm
-rw-r--r-T 1 0 0 147 Apr 08 09:14 email_template_chs.tm
-rw-r--r-T 1 0 0 154 Apr 08 09:14 email_template_cmd.tm
-rw-r--r-T 1 0 0 8 Apr 02 00:33 email_template_sl.tm
-rw-r--r-T 1 0 0 325 Apr 08 09:14 email_template_sm.tm
-rw-r--r-T 1 0 0 135 Apr 08 09:14 email_template_wd.tm
One of the e-mail templates (email_template_cfg.tm) I am trying to modify:
# more email_template_cfg.tm
Mailservername: $_email_server
From: $_email_from
To: $_email_to
Cc: $_email_cc
Subject: From router $routername: syslog msg
syslog msg: $msg
config commands performed:
$config_cmds
Solved! Go to Solution.
01-06-2017 08:08 PM
You don't need to modify these. Just create one of your own with the format you want and feed that to the smtp_subst command.
01-06-2017 08:08 PM
You don't need to modify these. Just create one of your own with the format you want and feed that to the smtp_subst command.
01-09-2017 06:36 AM
Thanks. It seems the default directory it pulls from is /pkg/lib/tcl. If you don't specify a linux-style path starting with / it won't find the right file, i.e /disk0:/email_template_sl.tm works (my final configuration), but disk0:/email_template_sl.tm does not.
Thanks Joe!
Juan
01-14-2017 02:51 PM
Hey Joe. I'm running into a path problem on IOS now. I have a "flash:/", but this path is not working on my script; any ideas?
01-14-2017 05:29 PM
IOS doesn't require the leading '/'. Just use flash:
01-14-2017 09:57 PM
Thanks for the help Joe.
In my previous post I actually posted two different paths: "/flash:/email_template_sl.tcl" and "flash:/email_template_sl.tcl"; please see the second where I tried without the leading flash, but similar to XR, it seems like there is a default path for TCL libraries, and that file isn't found either.
Thanks for reviewing.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide