Auto Email on event - EEM script for NxOS
I generated EEM script for Duplicate IP address detection, but i do not know how to trigger email in NxOS.
event manager environment emailto "[email protected]"
event manager applet Duplicate_IP
description "Detect Duplicate IP and Send Trap"
event syslog pattern "%ARP-2-DUP_SRC_IP"
action 1.0 snmp-trap strdata "Duplicate IP Detected on Host $hostname"
action 2.0 cli sh logg last 100
action 3.0 event-default
Somebody know how to trigger email. There is no good document on EEM email triggering mechanism.
Not sure if this would work in NxOS but I think it would go something like this;
Specify the action of sending a short e-mail when the EEM applet is triggered via the event syslog pattern you already have defined:
Router(config-applet)# action label mail server server-address to to-address from from-address subject subject body body-text
Remember to define the EEM environment variables first when setting up the applet as follows:
event manager environment _email_server
event manager environment _email_to
event manager environment _email_from
Similar Messages
-
Hello,
I'm looking for a simple eem script for enabling an SVI if its goes down. we have some issue is NX-OS running 6.0.2.(1) where we occure a SVI down for itself.
Regard
AdilUnfortunately, this is not possible on NX-OS. EEM on NX-OS is EEM by name only. The feature is very different than it is on IOS. What you could do is use an IOS box as a proxy. That is, send a trap using EEM from your NX-OS box, then have IOS do the telnet to the other NX-OS box to perform the necessary commands.
-
Need EEM script for write mem config details.
Looking for an EEM script that will send an email of config details when a write mem is performed.
Any help would be appreciated as i'm new to EEM.Something like this could work:
event manager applet email-write-mem
event cli pattern "^(write memory|write|copy running-config startup-config)*$" sync no skip no
action 0.5 info type routername
action 1.0 mail from [email protected] to [email protected] server 10.1.1.1 subject "Write mem on $_info_routername" body "A write mem was done on $_info_routername" -
Basic traceroute EEM script (for hop-by-hop network analysis)
I'd like to do a hop-by-hop analysis by running a traceroute script that runs on an interval (say every 5-15 minutes) and puts output to a file.
The goal is to let the script run for a day, and see what kind of hop changes might occur over time, and also monitor for any latency increase or packetloss at certain times of day (peak hours).
If I used an EEM script to do a basic traceroute from one endpoint of the network to a server in the core (for instance), this could show how a client's path may be impacted during peak hours.
I'd want the output stored in a file on the router's flash disk, and then I'd have to find some way to parse and analyze the output later (not sure how I'd do that, perhaps with excel or another diff-like program).Something like this should work for you. In config mode, specify three EEM environment variables:
event manager environment traceroute_timer 600
event manager environment traceroute_target 10.1.1.1
event manager environment traceroute_file flash:/traceroute.txt
Then register this EEM Tcl policy:
::cisco::eem::event_register_timer watchdog time $traceroute_timer
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
array set arr_einfo [event_reqinfo]
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
if [catch {cli_exec $cli1(fd) "enable"} _cli_result] {
error $_cli_result $errorInfo
if [catch {cli_exec $cli1(fd) "traceroute $traceroute_target"} _cli_result] {
error $_cli_result $errorInfo
set fd [open $traceroute_file a]
puts $fd [clock format [clock seconds]]
puts $fd $_cli_result
close $fd
# Close open cli before exit.
catch {cli_close $cli1(fd) $cli1(tty_id)} result -
How to shut no shut interface of switch using(EEM) Script for 3560 switch
Dear community experts,
I'm new for creating scripting for EEM and below is my situation, need your support.
Present I'm using 3560 switch, one of the switch port(FA0/1) has added Cisco Access point(PoE), actually what happening daily this Access point getting struct when I'M doing the switch port (FA0/1) shut then no shut it is working fine .
So my question is i need script, that should continuously ping the IP off the Access point if the IP will drop 4 packets the switch do shut and then no shut for that I need the script, Please help me.
if it is not possible please provide the batch file, which will ping the particular IP if 4 packet drops it will telnet the switch and go to the interface do shut no shut
Note:
instead of mentioned 3560, I mentioned 2960 now corrected it please provide the script.This should work:
ip sla 1
icmp-echo 10.10.10.1
frequency 15
ip sla schedule 1 life forever start now
ip sla enable reaction-alerts
ip sla reaction-configuration 1 react timeout action-type trapOnly threshold-type consecutive 4
event manager applet reset-ap
event ipsla operation-id 1 reaction-type timeout
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "int fa0/1"
action 4.0 cli command "shut"
action 5.0 cli command "no shut"
action 6.0 cli command "end" -
EEM script for SUP failover notification
Hello All- From this thread: https://supportforums.cisco.com/thread/2059622?tstart=0, I have a need for a script which parses the output of show redundancy state, and preferably emails me the result. We are using both 6500s with SUP720/MSFC3, and 4500s with SUP II+ & SUP V.
Many thanx in advance
-michaelExactly what do you want parsed out of this output? That is, what do you want emailed to you?
-
EEM Scripting for error and drop counters
Hi,
We want to check the following counters for drops every 5 minutes and generate an alarm if a certain threshold of errors (example: increment of 100 in the error/drop counters in the last 5 minutes) is overcome:
My sample script is inline, i'm missing how to parse and generate the alarm if the threshold is surpassed:
Example command:
SPLAB_7600_3#remote command module 4 show platform hardware drops | include Selene|drp
------ Selene 0 Channel 0 ------
Selene Ingress Drop Counters Ch[0]
Selene Egress Drop Counters Ch[0]
egr_tot_fifo_drp_ctr 25
Selene Drop Counters
------ Selene 1 Channel 0 ------
Selene Ingress Drop Counters Ch[0]
Selene Egress Drop Counters Ch[0]
Selene Drop Counters
Best Regards,
Afonso
::cisco::eem::event_register_timer watchdog time $check_interval nice 1
# EEM policy to monitor a internal counters
# August 2012, Cisco Systems
# Copyright (c) 2012 by cisco Systems, Inc.
# All rights reserved.
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
# 2. Execute the counter show commands
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
if [catch {cli_exec $cli1(fd) "enable"} result] {
error $result $errorInfo
if [catch {cli_exec $cli1(fd) "cisco"} result] {
error $result $errorInfo
# - - - - - - Interface error counters
if [catch {cli_exec $cli1(fd) "remote command module x show platform hardware selene np-idx 0 counters | include drop"} result] {
error $result $errorInfo
set egr_drp_ctr $result
#- Parsing and conditional programming for the generation of traps based on the drop value extracted from the show command
action_syslog priority info msg "Counter Alarm"
#Exit
if [catch {cli_exec $cli1(fd) "end"} result] {
error $result $errorInfoI believe this is what you are looking for:
set egr_drp_ctr $result
expr {$egr_drp_ctr + 100} sumof
if {$egr_drp_ctr >= $sumof}
puts "Alarm"
It may need correction on the syntax , but thats the logic. -
Need Help with EEM script for monitoring Rx and Tx load on Link
Hello,
I'm trying to implement a script, which monitors the Tx and Rx Load on the Link and sends a syslog in case the load is exceeded 200 mark (i.e If Rx or Tx load > 200)
I have implemented the following script. But it is not giving the required results.
event manager applet test
event interface name Tunnel111 parameter rxload entry-val 200 entry-op gt entry-val-is-increment true poll-interval 5000
action 1.0 syslog msg "Increase Load On the Link"
I'm trying to monitor the load on Tunnel 111 which is mapped to WAN interface.
Router (Cisco 2821) has following IOS
c2800nm-advipservicesk9-mz.124-25g.binHello Joseph,
As per your suggestion, we made some changes in our script and the following script is working fine. Its giving the required syslogs when the load is exceeded.
event manager applet test
event interface name Tunnel111 parameter txload entry-val 200 entry-op gt entry-val-is-increment false poll-interval 5
action 1.0 syslog msg "Increased Load On the Link"
Your prompt assistance is really appriciated. -
I am trying to extract the numerical value from the followng using Embedded event manager(TCL Scripting)
i also have SLA probes running between 2 connected routers
sho ip sla statistics | sec SD Jitter
So i write the the following
conf ter
event manager applet STAT
event none sync yes
action 1 cli command "enable"
action 2 cli command "sho ip sla stat | sec SD Jitter"
action 3 regexp " [0-9]+ " $_cli_result result
action 4 puts "$result"
However it produces result
*Mar 27 16:42:08.806: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: result
*Mar 27 16:42:08.806: %HA_EM-3-FMPD_ERROR: Error executing applet STAT statement 4
pls clarifyDoes the "show ip sla stat | sec SD Jitter" show any output with numbers? If not, then the result variable will not be populated. Try adding line 2 below into your applet so if there is not a match it will not produce an error.
event manager applet STAT
event none sync yes
action 1 cli command "enable"
action 2 set result "No match"
action 3 cli command "sho ip sla stat | sec SD Jitter"
action 4 regexp " [0-9]+ " $_cli_result result
action 5 puts "$result" -
Workflow for auto email generation
Hi all,
Pls help me in creating Workflow to send auto-email from SAP to IThelpesk for Transfer/Position Change employees.
Thanks in advance,
NeelaHai,
Thank u. It was very helpful.
Regards,
Neela -
A script for locating italics?
I need to find all the locations where italic text is in a pdf document. It seems to me that there is not a way to do this with Acrobat X. Would someone please suggest a method to do this. I was referred to this forum after posting in the "creating&editing&exporting_pdfs" forum.
I am saying that a script is not possible and that the only method would be a custom plugin.
If you are unable to write it, and it is important to your business, then you will need to hire someone.
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Sun, 29 Jan 2012 11:41:35 -0800
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: A script for locating italics?
Re: A script for locating italics?
created by fra John<http://forums.adobe.com/people/fra+John> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4172474#4172474 -
Scripting for Required Contingent Questions?
I have a form with a table, and depending on the answer selected in the left-most column, which is a dropdown menu, fields in the will become required. Sounds confusing when I read this, but what I mean is if someone selects YES from the dropdown menu for rows1 and 2 and NO for 3-6, then the rest of the fields in rows 1 and 2 become required and text has to be added or dropdown menus have to have a valid answer selected while the rest of the table does not.
The table looks like this:
Order book? Author Title ISBN\Publisher Total Requested Readopt? Required?
(Dropdown Y/N) (Text) (Text) (2 Sep. Text Fields) (Text) (Dropdown) (Dropdown)
1.
2.
3.
4.
5.
6.
The answers become required in the sense that they have to be filled out before the form can be submitted, and not in the sense that one answer can only be filled in if the previous is answered. It might be too much for the people filling out the form to have to make sure the previous field is entered before moving on to the next one. The entire table is visible already, so I don't need the fields to become visible upon selecting YES, although I see the benefit in this too. Can I have the scripting formulas for both, like, can I make the fields become visible upon selecting YES (so text can't be entered if they select no) and required to fill in before submitting?
Oh, another thing I'd like to do is make 1 selection from a dropdown menu not valid. I have a list of **, YES, and NO. I want to make the ** not recognized as a valid response. Thanks for your time and patience. I realize this question probably belongs in the Scripting forum, so I'll add it there too.If you use a field naming convention that places a row identifier at the beginning of the field name, you can do what you want with a single statement in the Validate event of the column 1 combo box. For example, if the field names for the row are:
row1.author, row1.title, row1.isbn, row1.publisher, row1.total, row1.readopt, row1.required
The following code can be used as the combo box's Validate script:
// Validate script for the column 1 combo box
getField("row1").required = (event.value !== "**");
Set up the combo box options so that "Commit selected value immediately" is selected.
You can then use a similar script for the other combo boxes in the other rows. If you stick to the row1, row2, row3, naming convention, you can create a single document-level function that can be called from all of the combo boxes:
function setRequired() {
// Get the row ID, which is the fourth character of the field name that called this function
var num = event.target.name[3];
// Set the required property of the other fields on the row
getField("row" + num).required = (event.value !== "**");
and call this function like this in the combo box's Validate event:
// Validate script for the column 1 combo box
setRequired();
The problem is setting the required value of a combo box (readopt, required), since a combo box always has a non-blank value, unlike a text field. So a better way to handle this is to create a script that scans all the fields in all the rows and checks for completeness. This allows you to create a more user friendly error message and can handle required combo boxes. Post again if you need more help with this approach. -
Eem applet or script for sending email for syslog denies
I am wanting to have my isr's send an email when a certain number of deny's occur on an ace. So if i have a particular ace set up to log when tcp 3389 denied. Then the eem applet or script would track when that deny entry happens. When the deny hits on that entry reach three times, it will send an email alert. The thing i am wondering about is how to set a variable within an event syslog pattern statement. For instance, how do i say express a variable for the source ip/port in the below
config-applet)# event syslog pattern "SEC-6-IPACCESSLOGP: list 198 denied tcp 201.198.71.51(38531) -> 212.184.81.52(3389)" occurs 3
The source ip and port could rotate or change so i'd need to express that with some kind of variable. How could that be done?(or is there a better approach altogether).I put the below script in and it takes fine but does not send email alert. Is there something more to do for configuring email sending?
event manager applet Intrusion-Tracking
event syslog pattern "SEC-6-IPACCESSLOGP:.*-> 208.195.174.115\(3389\)" occurs 3
action 1.0 mail server "173.16.7.2" to ".[email protected]" from ".eem@company1." subject ".intrusion_alert_from_c2900isr." body "Intrustion alert c2800isr" -
SAVE AS BUTTON WITH JAVA SCRIPT FOR MOUSE UP EVENT
Please any one help with complete code for "SAVE AS" button to auto save the acrobat form in a user specified path
with unique name or incremental name.Please post only full script for MOUSE UP event.Thanks George but i need an example.my actual need is
i have created a SAVE INVOICE button.i have set the action"Mouse up" to run a Java script.
Now i need a scriprt for the same.
If i press that SAVE INVOICE button.the fie should save on "C:\Users\MUNNA\Desktop" automatically
with unique name and the name should not remain same for next Save.because it overwrites the previous
file so please post an example pdf with same. -
Help with EEM TCL / CLI scripting for re-direction/wccp counters
Being new with EEM scripting I wanted to see if I was on the right track and get some help to finish my idea.
Our problem I am trying to fix is our remote sites utilize pairs of Cat3650's for some routing and WCCP redirection. We are encountering ACL denial issues causing slow down and access issues. The fix for the issue we remove the WCCP service groups to break peering with our wan optimizers and re-insert the configuration thus re-establishing peering and restoring service.
My idea is to use a TCL scipt on a watchdog timer to parse the "sh ip wccp | inc denied (or unassign)" output for denial and unassignable error counters. If a counter is found I wanted to create a syslog message that would then kick off a simple EEM CLI script to remove the service groups, wait 10 seconds, then re-add the service groups. Please point me in the right direction if I am off track as I am not sure if I can use the EEM CLI for all this or since I want to retreive specific info from the sh ip wccp output if I do need to utilize TCL. I am also unsure if the "total denied" ascii string pulled via the "sh ip wccp | inc denied" will cause issues when attempting to just pull the counter information.
sh ip wccp | inc Denied Red
Total Packets Denied Redirect: 0
Total Packets Denied Redirect: 0
Script thus far :
TCL
if [catch {context_retrieve "EEM_WCCP_ERROR_COUNTER" "count"} result] {
set wccpcounter 0
} else {
set wccpcounter $result
} if [catch {cli_open} result] {
error $result
} else {
array set cli $result
} if [catch {cli_exec $cli(fd) "show ip wccp | incl Denied"} result] {
error $result
} else {
set cmd_output $result
set count ""
catch [regexp {receive ([0-9]+),} $cmd_output} ignore count]
set count
set diff [expr $count - $wccpcounter]
if {$diff != 0} {
action_syslog priority emergencies msg "WCCP counters showing incremental Denied packet counts"
if [catch {cli_close $cli(fd) $cli(tty_id)} result] {
error $result
context_save EEM_WCCP_ERROR_COUNTER count
CLI
event manager applet WCCP_COUNTER_WATCH
event syslog priority emergencies pattern "WCCP counters showing incremental Denied packet counts"
action 001 cli command "enable"
action 002 cli command "config t"
action 003 cli command "no ip wccp 61"
action 004 cli command "no ip wccp 62"
action 005 wait 10
action 006 cli command "ip wccp 61"
action 007 cli command "ip wccp 62"
action 008 wait 15
action 009 cli command "clear ip wccp"
action 010 cli command "end"
Thanks for all the helpThis won't work as EEM cannot intercept its own syslog messages. However, I'm not sure why you need this form of IPC anyway. Why not just make the Tcl script perform the needed CLI commands?
And, yes, you could use all applets here. But since you've written the hard stuff in Tcl already, it might be best just to add the missing calls to reconfigure WCCP to that script.
Maybe you are looking for
-
Solution Manager Service Desk - Segregation and Customization of HR Tickets
All - The Solution Manager Service Desk is a great tool for incident management in a system landscape that includes SAP, as well as other technologies. I wanted to find out whether tickets that contain sensitive information (HR-related) can be segreg
-
Interchangeable batteries 1.33, 1.5GHz G4 12 inch
I'm about to get a second 12 inch G4, an upgrade from my 1.33Ghz machine. Are the batteries from the two models (1.5Ghz and 1.33GHz) interchangeable? I'd like to use both for my new Powerbook, leaving the 1.33 machine at home on AC. Any advice apprec
-
MG 7120 won't print e-mails. Leaves blue strip across top of page.
Spoke to a Mac advisor last night for setup and thought everything was ok. Won't copy emails and there is no large box that comes up to show what you are printing or how many copies you want.
-
Has anyone had major overheating with iphone 4 running the new google maps app on IOS 6?
Used the app today and the iphone 4 really burned up fast (less than 2 minutes)... Was wondering if it was an app issue or the fact that i may had have a connection problem with my 3G and it warmed up because of that..
-
Price alerts implementation in ATG
Hi, I have a scenario where a user has to get an e-mail when the price of a product drops below some amount. Assuming that a user has registered for price alert for a particular product by selecting a price limit on the product page, he needs to get