Again, thank you John, David, et. al.

My full solution is posted for reference.  Please feel free to include in
documentation.

/etc/sec/friendlynames.txt
====================
GigabitEthernet1/37=TEST SERVER
GigabitEthernet3/39=IMPORTANT SERVER

/etc/sec/testing.sec
===============
type=Single
desc=Load hashes at startup
ptype=SubStr
continue=TakeNext
pattern=SEC_STARTUP|SEC_RESTART
context=SEC_INTERNAL_EVENT
action=eval %a ( open(FILE, "</etc/sec/friendlynames.txt"); \
    while (<FILE>) { chomp; my ($key, $val) = split /=/; $hash{"$key"} =
$val; })

#Aug  1 12:14:54 switchname 362351: %LINK-3-UPDOWN: Interface
GigabitEthernet1/37, changed state to down
type=Single
desc=Fire Event
ptype=RegExp
pattern=%LINK-3-UPDOWN: Interface ([\w\/]+), changed state to down
context= =($hash{"$1"})
action=eval %host ( return $hash{"$1"}; ); logonly **** Uh-oh! Problem with
%host ****

>From here, you can do what you want with %host as normal.

(P.S. - David, since a reload will reload the hashes, does that count as
completing the extra credit? Do contexts persist a  'kill $PID -HUP'?)
---
Justin J. Novack
Official Disturber of the Peace
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to