Forum Discussion

Pops's avatar
Pops
Icon for Altostratus rankAltostratus
Feb 01, 2024

create monitor with ? in the send string via TMSH

I am trying to create a monitor via CLI on v17.1.1 tmos and can not get the ? to show up no mater what i try.

here is my command: 

create ltm monitor https test_monitor { app-service /Common/test.app/test adaptive disabled defaults-from https send "HEAD /path1/path2/Access/information/script/healthcheck?wsdl HTTP/1.1\r\nHost: Close\r\n\r\n" recv "HTTP/1.(0|1) 200 OK" destination *:* interval 5 time-until-up 0 timeout 16 }

The important bit is the /healthcheck?wsdl.  Because this part is within a larger pair of quotes already it will not let me escape with \.  I also tried closing the first quote, putting the ? in its own quotes and then opening up the last part with a new quote like this ""?"" but nothing works. 

If the ? is in the string, i get a prompt in the CLI to provide a missing value, and if i escape it, the \ shows up in the send string which doesn't work.  And the double quotes just puts in doble quotes and the ? is gone.  

Any ideas of how to do this?

BTW, if i just go back into the GUI and put the ? in after i have done the command all works fine and the pools green up.  

  • ? Completing prompt function conflicts of tmsh view, it can be used by switching to the bash view

    run util bash

    tmsh create ltm monitor https test_monitor { adaptive disabled defaults-from https send "HEAD /path1/path2/Access/information/script/healthcheck?wsdl HTTP/1.1\r\nHost: test.com\r\nConnection: Close\r\n\r\n" recv "HTTP/1.(0|1) 200 OK" destination *:* interval 5 time-until-up 0 timeout 16 }

    exit

  • xuwen's avatar
    xuwen
    Icon for Cumulonimbus rankCumulonimbus

    ? Completing prompt function conflicts of tmsh view, it can be used by switching to the bash view

    run util bash

    tmsh create ltm monitor https test_monitor { adaptive disabled defaults-from https send "HEAD /path1/path2/Access/information/script/healthcheck?wsdl HTTP/1.1\r\nHost: test.com\r\nConnection: Close\r\n\r\n" recv "HTTP/1.(0|1) 200 OK" destination *:* interval 5 time-until-up 0 timeout 16 }

    exit

  • Pops Any particular reason you cannot use the GUI if that's what is working for you? Aside from the previous you should be able to do the following to allow it in the configuration in the CLI.

    create ltm monitor https test_monitor send "HEAD /path1/path2/Access/information/script/healthcheck\?wsdl HTTP/1.1\r\nHost: Close\r\n\r\n"

    • Pops's avatar
      Pops
      Icon for Altostratus rankAltostratus

      We will be doing a large project and i want to semi-automate the task of pool and monitor creation but using TMOS commands rather than the slow GUI method. 

  • Pops's avatar
    Pops
    Icon for Altostratus rankAltostratus

    xuwen, thanks for the pointer.  That definitely worked.

  • To configure inTMSH, I believe you can also replace the "?" character with an escape sequence as per the following article:

    https://my.f5.com/manage/s/article/K4186

    You would replace "?" with "\x3F"

    So, so something like this:

    create ltm monitor https test_monitor { app-service /Common/test.app/test adaptive disabled defaults-from https send "HEAD /path1/path2/Access/information/script/healthcheck\x3Fwsdl HTTP/1.1\r\nHost: Close\r\n\r\n" recv "HTTP/1.(0|1) 200 OK" destination *:* interval 5 time-until-up 0 timeout 16 }