[c-nsp] EEM applet, any way to substitute "hostname"?

Peter Rathlev peter at rathlev.dk
Fri Apr 8 06:55:30 EDT 2011


On Fri, 2011-04-08 at 12:42 +0200, Peter Rathlev wrote:
> When writing an EEM applet, is there any way to substitue e.g. the
> hostname into "action cli" commands?

Well, I found out how to. Reading the documentation helps. :-)

 event manager applet Copy-CPU-usage-on-busy-CPU-rising
  event syslog pattern "the value of lsystem.56.0 exceeded"
  action 1.0 info type routername
  action 2.0 cli command "enable"
  action 2.1 cli command "show processes cpu sorted | redirect tftp://192.0.2.10/stash/$_info_routername-cpu-rising.txt"
  action 3.0 syslog msg "CPU stats copied to tftp://192.0.2.10/stash/"
 !

The "action info" is documented here:

http://www.cisco.com/en/US/docs/ios/netmgmt/command/reference/nm_01.html#wp1049891

-- 
Peter




More information about the cisco-nsp mailing list