• Configuration Change Email Notification

Print Friendly, PDF & Email

Using Event-Handler Feature, you can send an email notification whenever the Startup Configuration has been modified.  Below is the basic setup required to configure the email client and Event-Handler.

Email Client

The following email client configuration utilizes Gmail as the SMTP server with user itnetops@example.com as the authorized user to send emails.  It also uses TLS as the transport to Gmail.  Any valid SMTP server can be used for this function.

   from-user itnetops@example.com
   server smtp.gmail.com
   auth username itnetops@example.com
   auth password <password>

You may also specify a different host port to the server (server host:port) if needed.


Event-Handler – Trigger on-startup-config

The below sample event-handler, named “Config_Change” is triggered when the Startup Configuration is modified.  The action calls bash to send the email to a defined destination email (coolitguy@example.com)  The system variable $HOSTNAME is used to indicate what switch’s configuration was just changed.  

event-handler Config_Changed
   trigger on-startup-config
   action bash email -i coolitguy@example.com -s "Config Change on $HOSTNAME"
   delay 10
   timeout 60


Optional use of Email Client

Once the email client is configured you can redirect show commands to send the output to an email versus the standard terminal.  By default, the output is sent as an email attachment. Use the ‘-i’ option to include the output in the email body.

show version | email -i -s "Version Info on $HOSTNAME" opsteam@example.com
show run | email -s "Running Config on $HOSTNAME" opsteam@example.com



Get every new post on this blog delivered to your Inbox.

Join other followers: