::cisco::eem::event_register_syslog pattern "%MGBL-CONFIG-6-DB_COMMIT : Configuration committed by user" maxrun_sec 600 # # errorInfo gets set by namespace if any of the auto_path directories do not # contain a valid tclIndex file. It is not an error just left over stuff. # So we set the errorInfo value to null so that we don't have left # over errors in it. # set errorInfo "" namespace import ::cisco::eem::* namespace import ::cisco::lib::* # # errorInf gets set by namespace if any of the auto_path directories do not # contain a valid tclIndex file. It is not an error just left over stuff. # So we set the errorInfo value to null so that we don't have left # over errors in it. # set errorInfo "" #Notify users that we're collecting set output_msg "Collecting commands123" #query the event info array set arr_einfo [event_reqinfo] if {$_cerrno != 0} { set result [format "component=%s; subsys err=%s; posix err=%s;\n%s" \ $_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str] error $result } #Extract the message from the event info and append it to the email body set syslog_msg $arr_einfo(msg) #Extract the location of the message: set location "" set output_msg "xyz" regexp {.*show configuration commit changes ([0-9]*).*} $syslog_msg match commit_id set output_msg "xyz" #open a cli connection if [catch {cli_open} result] { error $result $errorInfo } else { array set cli1 $result } set show_cmd "show config commit changes $commit_id" if [catch {cli_exec $cli1(fd) $show_cmd} result] { error $result $errorInfo } action_syslog priority info msg $result #close the cli connection if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] { error $result $errorInfo }