Monday, August 13, 2012

TCL + Cisco IOS + Kron

Task: performance scheduled system health check on a Cisco router and email the result automatically. 

In the sendmail.tcl script, use below statement to save the "Cisco IOS show result" into mail body

set show_clock [exec {show clock}]
set show_ip_interfaces [exec {show interface summary}]

append body "\n" "$show_clock"
append body "\n" "$show_ip_interfaces"

Configuring the router with the Tcl ios_config command

And then you can schedule task using kron

kron occurrence sendmail in 1 oneshot
kron policy-list sendmail
 cli tclsh sendmail.tcl

Cisco Kron +TCL

No comments:

Post a Comment