06-13-2012 08:07 AM
Dear all,
My client would like to make use of certain feature within the Nexus 7000 supporting similar to “Smart Call Home” feature. Smart Call Home cannot support individual account and requires to register with the CCO user ID. The client would like to monitor on the fly on any status change between Level 0 to 3 in the syslog with specific message header filter. Do we have any features sending Email alerts to the external Email account?
I have gone in the direction of the EEM script of Nexus 7000. My clients is trying for some sample EEM script to monitor the state change of the switch. These are the link.
Does the EEM script support sending Email to certain Email account? Do you have any sample script showing this particular feature?
It seems EEM script cannot support Email account statement. Please see belows
# sh run | in eem
event manager applet eem_log_monitor
# sh run eem
!Command: show running-config eem
!Time: Mon Jun 11 11:06:45 2012
version 5.2(4)
event manager applet eem_log_monitor
event syslog tag s0 pattern ".*-0-.*"
event syslog tag s1 pattern ".*-1-.*"
event syslog tag s2 pattern ".*-2-.*"
event syslog tag s3 pattern ".*-3-.*"
tag s0 or s1 or s2 or s3 happens 1 in 0
action 1.1 cli show logging last 10
# conf t
Enter configuration commands, one per line. End with CNTL/Z.
ats-tor-core2(config)# event manager applet eem_log_monitor
ats-tor-core2(config-applet)# action 1.2 ?
cli Configure a VSH CLI action
counter Specify the name of the counter
event-default Do default action for the event
forceshut Force the entire switch to shut down
overbudgetshut Shut down the specified LCs due to power over budget
policy-default Do default action(s) of the policy being overridden
reload Reload the system or a specific module
snmp-trap Send out an SNMP trap
syslog Generate a syslog message
I am wondering is it version specific or not. Do you have any recommendations? Or, should the client go for the indirect approach, say, EEM sending to another manager trigger the Email sending?
Your help and assistance is very much appreciated.
Regards,
Adrian
06-14-2012 12:19 AM
There isn't any mail action support in NX-OS EEM. However, EEM 5.x provides the ability to execute a tclsh script from an EEM applet. You could use Tcl to send your email. The tcllib package at http://tcllib.sourceforge.net/ offers an smtp.tcl library in the mime module. You can use this to send your email.
06-18-2012 08:15 AM
Joe,
Thanks for your information. I try to find the smtp.tcl script under http://tcllib.sourceforge.net/. I am running out of luck of it. Can you give me more hints on it?
Your help and assistance is very much appreciated.
Regards,
Adrian
06-18-2012 03:31 PM
It's in the MIME module. You should see an smtp.tcl file. There is an example on how to use this in the smtpd module.
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