• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Roger Perkin

Network Automation Consultant

  • Network Automation
    • Network Automation Consultant
    • Network Automation Courses
    • What is NetDevOps?
    • Workflow Orchestration
    • Ansible Automation Platform
    • Ansible Workshop
    • What is Network Automation?
    • Network Automation Tools
    • ContainerLab
    • Ansible Training
      • What is Ansible?
      • Ansible Tutorial for Beginners
      • Ansible Network Automation
      • Ansible Inventory Example
    • Python Network Automation
      • Nornir
      • Python for Network Engineers
      • Python VENV / Virtual Environment Tutorial
      • Python Tutorial for Beginners
      • pyATS
    • Network Source of Truth
      • NetBox Training
      • Infrahub
      • NautoBot
    • NetDevops
    • DevOps Tutorial
      • Git Training
      • Terraform Training
      • Linux Training
      • Kubernetes Training
      • Devops Training Course
      • Azure Devops Training
    • Terraform
    • GIT
      • Git Commands
      • What is GitHub?
    • Docker Training
    • Confluence
    • Microsoft Azure
  • Cisco
    • ISE
    • SD WAN Training
    • Password Recovery
    • Software-Upgrade-Guides
    • BGP
    • Data Center
    • WIRELESS
  • CCIE
  • Blog
  • About
    • My Red Special Guitar
  • Contact

EEM script to monitor routing table

Home » EEM

I have just started to study EEM and look into the amazing power this has. The script below I now use in production to monitor routing changes on the network.  Any change to the routing table is instantly emailed to me, I am just working on tweaking this script as it does email every single change and I need to configure it to bundle all changes in a time period into one email

When I figure how to do this I will post the updated script.

event manager applet route-table-monitor
 event routing network 0.0.0.0/0 ge 1
 action 0.5 set msg "Route changed: Type: $_routing_type, Network: $_routing_network, Mask/Prefix: 
$_routing_mask, Protocol: $_routing_protocol, GW: $_routing_lastgateway, Intf: $_routing_lastinterface"
 action 1.0 syslog msg "$msg"
 action 2.0 cli command "enable"
 action 4.0 info type routername
 action 5.0 mail server "(IP of Mail server)" to "(email address)" from "(device name)" 
subject "Routing Table Change" body "$msg $_cli_result"

Just put this config into the device and ensure your mail server will relay mail and it will work a treat!

 debug event manager action cli

If the script is not working as you expected you can use debug event manager action cli this will show you any errors with your script as it runs.

Category: EEMTag: ccie blog, eem
ansible course for network engineers
Get Access to my Ansible Course NOW
Previous Post:Is CCIE still worth it in 2022?
Next Post:CCIE Prerequisites

Reader Interactions

Comments

  1. Robert Holmes

    October 20, 2015 at 1:02 pm

    Did you ever figure out how to limit the emails?

    • Roger Perkin

      October 23, 2015 at 5:06 pm

      Hi Robert, No I didn’t – I solved the problem with some outlook filters!

  2. Paul K Moore

    February 17, 2016 at 4:28 pm

    Hi Roger,

    This was really useful – thanks for taking the time to write it down.

    Much appreciated

    Paul

Sidebar

Hi I'm Roger Perkin,
Based in the UK working as a Network Automation Architect, CCIE #50038
About Roger | Twitter | Linkedin

Python for Network Engineers Course

Topics

Network Automation
Ansible
Python for Network Automation
CCIE
Cisco ISE
F5 Certification
BGP
OSPF
Network Automation Conferences
auvik promo banner
Pluralsight Trial

Git for Network Engineers

Ansible vs Nornir

Start learning today with my Network Automation Courses

Master Ansible, Python, Git, Nornir, Jenkins and more..


Buy me a coffeeBuy me a coffee

ansible network automation course

Have you seen my YouTube Channel?

YouTube Subscribe

Let’s get started

Take a look at my premium courses on Ansible, Nornir & Git or buy them all with the Network Automation Bundle!

Network Automation Courses

Navigation

Python VENV Tutorial
Python for Network Engineers Course

Network Automation
Network Automation Courses
Network Discovery Tools
Network Automation Conferences
Ansible Training
What is Ansible?
Devops Tutorial
Network Source of Truth
DevOps Glossary
Network Monitoring Software

Contact

Contact

Get in touch with me here

[email protected]

  • Twitter
  • LinkedIn
  • YouTube
Buy me a coffeeBuy me a coffee

Copyright © 2026 · Roger Perkin · All Rights Reserved · Privacy Policy – Terms