Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /opt/cloverleaf/cis6.2/integrator/bin/hcitcl
- #
- #
- #
- ###########################
- proc main { argc argv } {
- set optargs [list {a 1 alert} {e 1 email} {f 1 filename}]
- catch {set args [getopt $argv $optargs]} err
- #echo ALERT:$alert
- #echo FILENAME:$filename
- #set thread [lindex [split $alert " "] 4]
- set thread unknown
- set tlist [split $alert "\{"]
- for { set i 1 } { $i < [llength $tlist] } { incr i } {
- set part [lindex $tlist $i]
- if { [regexp {^([^ ]+) (\d+)\}} $part -> threadm count] } {
- if { $count > 0 } {
- set thread $threadm
- }
- }
- }
- #echo $thread
- set subj "Error Message from PWIM - [clock format [clock seconds] -format "%D %R %p"] $alert"
- foreach flag { o f d } {
- catch {exec yes | hcidbdump -e -L -c -D -$flag $thread | fold} dump
- if {[llength [split $dump \n]] > 6} {
- write_file $filename $dump
- catch {[exec mailx -s $subj $email <$filename]} emailerr
- }
- }
- }
- main $argc $argv
Advertisement
Add Comment
Please, Sign In to add comment