The tcl proc I’ve written for my experiment is the tclalert template stripped down to bare bones. It does not use any arguments.
proc alert_test { args } {
set retval {}
lappend retval “VALUE 0”
lappend retval “MESSAGE {Tcl alert ‘alert_test’ has fired.}”
return $retval
}
I created a tcl alert with the above proc as the source with no arguments. It looks like this in default.alrt.
# Alert config: default.alrt
#
prologue
who: blubkeman
date: January 15, 2016 1:39:51 PM CST
type: alrt
version: 3.0
end_prologue
#
{ALERT
{ NAME Alert_1 }
{ VALUE tcl }
{ SOURCE {
{ TCL alert_test }
} }
{ WITH -1 }
{ COMP {== 0} }
{ FOR once }
{ WINDOW */*/*/* }
{ ACTION {
{ notify {} }
} }
}
After saving the default.alrt file, I reviewed hcimonitord.log and found an error stating, ‘Tcl Alert Script Error: invalid command name “alert_test”‘.
I next tried putting an argument in the source of the alert just to see if that helped. It did get me past the invalid command name. Apparently, a tcl alert requires the presence of an argument even if the procedure called doesn’t use it. Does that sound right?
My default.alrt now looks like this.
# Alert config: default.alrt
#
prologue
who: blubkeman
date: January 15, 2016 1:46:41 PM CST
type: alrt
version: 3.0
end_prologue
#
{ALERT
{ NAME Alert_1 }
{ VALUE tcl }
{ SOURCE {
{ TCL {alert_test {NONE empty}} }
} }
{ WITH -1 }
{ COMP {== 0} }
{ FOR once }
{ WINDOW */*/*/* }
{ ACTION {
{ notify {} }
} }
}
After saving the default.alrt file, I reviewed hcimonitord.log again and found an error stating, ‘Tcl Alert Script Error: missing close-brace’.
Between the tcl proc code and the default.alrt file, I cannot find a single missing close-brace.
Can anybody point out what I’m missing?
Brian Lubkeman
Technical Analyst III - Integrations
McFarland Clinic, Ames, Iowa