cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

TCL Script to determine if crashinfo file is less than 24hrs.

719
Views
0
Helpful
0
Comments

This script was created for use on a uBR10012 to check if a crashinfo file is less than 24hrs old.

It can be modified for other platforms (it likely wouldn't need much manipulation in that case), and the first line...

::cisco::eem::event_register_none default 600 maxrun 600 sync yes

...can be changed so that the policy is a cron instead of manually triggered.

After triggering the script, the output would look like this:

091187: Feb 22 13:14:37.090: %HA_EM-6-LOG: tmpsys:/eem_policy/Crashinfo_Finder_v1.tcl: [EEM Event ID 21] started.

091188: Feb 22 13:14:41.322: %HA_EM-6-LOG: tmpsys:/eem_policy/Crashinfo_Finder_v1.tcl: disk0:crashinfo_20120222-051229-EDT is 0 days, 9 hours, 2 minutes, 12 seconds old.

091189: Feb 22 13:14:41.506: %HA_EM-6-LOG: tmpsys:/eem_policy/Crashinfo_Finder_v1.tcl: There are 65 crashinfo files across all filesystems.

091190: Feb 22 13:14:41.510: %HA_EM-6-LOG: tmpsys:/eem_policy/Crashinfo_Finder_v1.tcl: [EEM Event ID 21] finished.

The objective here is to run the script daily and send a trap if a new crashinfo file is detected.