cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2468
Views
0
Helpful
12
Replies

Cisco Embedded Event Manager Issue

Hello Experts,

I have taken the following sample EEM from

https://learningnetwork.cisco.com/blogs/network-sheriff/2009/06/19/writing-your-first-eem-applet

The intention is to send a notification to an email address about a network problem. I have modified it bit for illustrative purposes. You will see that there are various show commands.

Can someone please show me how to email the show commands instead just appending them to the directory called "server_unreachable"?

TechWiseTV4506(config)#eve

nt manager environment _email_server 172.16.1.44 (<-my Post Cast server)

TechWiseTV4506(config)#event manager environment _email_to jimmyray@cisco.com

TechWiseTV4506(config)#event manager environment _email_from crapsrv@cisco.com

event manager applet email_server_unreachable

event track 10 state down

action 1.0 syslog msg "Houston we have a problem. Ping failed, server unreachable!"

action 1.1 cli command "enable"

action 1.2 cli command "del /force flash:server_unreachable"

action 1.3 cli command "show clock | append server_unreachable"

action 1.4 cli command "show ip arp 172.16.1.55 | append server_unreachable"

action 1.5 cli command "show ip route 172.16.1.55 | append server_unreachable"

action 1.6 cli command "show interface FastEthernet0/1/1 | append server_unreachable"

action 1.7 cli command "more flash:server_unreachable"

action 1.8 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Server Unreachable: ICMP-Echos Failed" body "$_cli_result

action 1.9 syslog msg "Server unreachable alert has been sent to email server!"

Cheers

Carlton

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

This applet will actually email the results.  However, in order to get all of the output together, it uses the server_unreachable file as an accumulator buffer.  That file could be deleted as action 2.0:

action 2.0 cli command "delete /force flash:server_unreachable"

But that is already there in action 1.2, so it's not really needed.

What will happen is the applet will more the file to collect all of the output.  That aggregated output will be stored in the $_cli_result variable.  The result is that the body of your email will contain the consolidated command output.

View solution in original post

12 Replies 12

Joe Clarke
Cisco Employee
Cisco Employee

This applet will actually email the results.  However, in order to get all of the output together, it uses the server_unreachable file as an accumulator buffer.  That file could be deleted as action 2.0:

action 2.0 cli command "delete /force flash:server_unreachable"

But that is already there in action 1.2, so it's not really needed.

What will happen is the applet will more the file to collect all of the output.  That aggregated output will be stored in the $_cli_result variable.  The result is that the body of your email will contain the consolidated command output.

Hi Joseph,

Thanks for responding.

All I need is a email server that I can get to work. I'm not having any luck with the suggested podcast server.

Do you know of any?

Cheers

Carlton

I don't know of any open SMTP servers (those are generally considered insecure).  Do you not have a corporate SMTP server you can use?

Hi Joseph,

I'm a contractor working from home.

Then your email provider (e.g., Comcast, Time Warner, etc.) must offer an SMTP server.   Can you use that one?

I'm just unsure on what email address I need to place in the 'from box'?

Generally it can be anything you want.  If you're using Comcast, for example, you could do: noreply@comcast.net or myrouter@comcast.net.

Actually, I think its my dns settings.

When I check out the logs I see the following:

PostCast Server 2.6.0
SMTP log started at 11/26/2012 09:41:35 PM

Thread 1: 09:41:51 PM [<-->] : Error: DNS timeout. Unable to resolve (myserver)

My dns ip is 192.168.0.1 (which I'm sure won't resolve anything)

What do you think?

I'm not familiar with PostCast, but typically SMTP servers will want to resolve themselves as well as tne envelope hostname.  You can usually work around the first thing by using a local hosts file.  However, the server's own hostname should be able to be resolved automatically.

Joseph,

I tried entering 192.168.0.3 as the hostname or 127.0.0.1 for the from email address but I keep on getting the same message.

Sorry, I don't have any advice to offer on PostCast.  Perhaps Google can shed some light on how to fix that error.

Hi Joseph,

Thanks for your help.

I don't know how to add 5 star ratings...

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: