Forum Discussion

Aditya_Mehra's avatar
Aug 20, 2018

Can we add a variable reference in a Send String via iApp

Hi,

I have an application running via an iApp. I need to add a https monitor to it.

Now the thing is the fqdn has over 40 ips, so wanted to know if we can add a variable reference in the send string, tried the below but gives an error.

I tried using a variable dest1 and tried to call it in the send string but it does not take the template.

set dest1 \[ lindex \[ RESOLV::lookup @$::dns_recursor -a $::fqdn__dns \] 0 \]

proc create_monitor { } { 
        set monitor_type "https"
        set monitor_name "external_${tmsh::app_name}-monitor"
        set monitor_interval "5"
        set monitor_timeout "16"
        set send {"GET / HTTP/1.1"}
        append send {"\n\n\r\n"}
         set destination /$dest1

        tmsh::create / ltm monitor $monitor_type $monitor_name interval $monitor_interval timeout $monitor_timeout send $send destination $destination
}

can anyone put some light on this.

Thanks, Aditya