I have some troubles with the below script.
proc checkUser {userip} {
set search "show users | include "
set search_cmd [concat $search $userip]
exp_send "$search_cmd\r"
expect {
-re "Vi.*" {
set oui "uei.opennms.org/services/passiveServiceStatus"
set host "localhost"
set iface "--interface $userip"
set service "--service Test"
set parm1 "--parm 'passiveNodeLabel [getNodeName $userip]'"
set parm2 "--parm 'passiveIpAddr $userip'"
set parm3 "--parm 'passiveServiceName Test'"
set parm4 "--parm 'passiveStatus Up'"
send_user [ exec perl /opt/opennms/bin/send-event.pl $oui,$host,$iface,$service,$parm1,$parm2,$parm3,$parm4 ]
#send_user [ exec [pwd]]
}
}
}
The whole Expect script executes without error however the perl script called does not seem to execute however when i run the perl script in bash with the same arguments it does what it suppose to do.
Is it the correct way to call a perl script from within the Expect?
Thanks in advance.