[c-nsp] EEM applets and conditional statements

Rodney Dunn rodunn at cisco.com
Tue Aug 11 22:03:46 EDT 2009


I don't think you can do it with an EEM applet to compare data in the 
output. I think you need to do it via a TCL script where you can save 
the variables.

Rodney



Justin Shore wrote:
> I'm having trouble figuring out how to use the conditional capabilities 
> of EEM applets to do something fairly simple.  I'd like to check for 
> DHCP conflicts on a schedule and if any exist I'd like to generate a 
> syslog message and send an email.  What I can't figure out how to do is 
> parse the output of 'sh ip dh con' and if then perform an action if 
> there are any conflicts (ie, more than just the single header line in 
> the output).  I've gone through some of the EEM community scripts but 
> they all seem to be full blown TCL scripts.  I'm thinking that I can 
> handle this with a simple applet.  The applets have if, for, and while 
> capabilities but I haven't figured out how to apply them to parsing 
> command output?
> 
> Any suggestions or pointers?  Example scripts that demonstrate how to 
> use the EEM logic capabilities would be fine too.  I can build off that 
> to do what I need.
> 
> Thanks
>  Justin
> 
> 
> _______________________________________________
> cisco-nsp mailing list  cisco-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/


More information about the cisco-nsp mailing list