For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

brucecmc_163171's avatar
brucecmc_163171
Icon for Nimbostratus rankNimbostratus
Jul 29, 2014

how to run http get from cli

can somebody toss me how to running an http get from the cli. I'm running a multi-partitioned F5 LTM, version 10.2.4

 

10 Replies

  • shaggy's avatar
    shaggy
    Icon for Nimbostratus rankNimbostratus

    curl is usually the go-to command. There are quite a few options depending on what you're trying to do, so check out the man page.

    curl http://www.site.com

  • maybe I didn't articulate it correctly.

     

    I need to test a specific get http that was setup in the past within a specific partition.

     

    being a relative newb to the cli, i'm not sure that i'm even in the correct partition in which to execute the appropriate command...

     

    that's what i'm looking for is how to bounce between the partitions and then execute the http get syntax that was slung into the monitor to see if it even returns a 200 response.

     

    basically, what is happening is that a monitor was stood up sometime in the past and it does appear to place a pool member in a down state if the monitor doesn't function.

     

    so, I figure first things first - get into the partition that the virtual server config is in, initiate the get from the command line and see if I get a 200 response...

     

    • brucecmc_163171's avatar
      brucecmc_163171
      Icon for Nimbostratus rankNimbostratus
      I should have stated, initiate the get from the cli of the F5 to the pool members...
  • A couple points of clarification:

     

    1. cURL is a command that runs in Bash. If you find yourself inside a partition in the shell, you're likely running the TM shell. You'll need to get into Bash to run the cURL command.

       

    2. The partition you're in is only really relevant if that partition also defines a route domain.

       

    3. Most external monitors are saved by default in the /config/monitors folder. You may what you're looking for there.

       

  • yes sir, I found that to be the case. So, I guess the bigger question is - is the monitor syntax executed correctly, and not being an http person (as well), maybe somebody can shine some light on it

     

    GET / HTTP/1.1\r\nHost: \r\nConnection: Close\r\n\r\n

     

    here is my dilemma...the pool member that was offending did not going into a down state. I believe it is because the URL that the monitor is "monitoring" is the URL of the virtual server site, consisting of 4 pool members. example the monitor is configured as follows on the server pool

     

    GET / HTTP/1.1\r\nHost: \r\nConnection: Close\r\n\r\n

     

    so, naturally, i'm thinking the monitor sees the URL as UP (because the other 3 servers are UP) and never places the offending server in a down state.

     

    //////////////////////////////

     

    (and for anybody wanting to run the commands, here is what I found)

     

    telnet GET / HTTP/1.1 Host: Connection: close

     

    this should render the http 200 success response (or other response if not successful)

     

  • shaggy's avatar
    shaggy
    Icon for Nimbostratus rankNimbostratus

    The monitor will be executed against each pool member individually. So if the monitor is:

    GET / HTTP/1.1\r\nHost: \r\nConnection: Close\r\n\r\n

    Then the F5 will send that request to each pool member, and each pool member will issue a response from its default website (which isn't necessarily the site being load balanced).

    If the monitor is:

    GET / HTTP/1.1\r\nHost: www.hostname.com\r\nConnection: Close\r\n\r\n

    Then the F5 will send that request to each pool member, and each pool member will respond from its "www.hostname.com" site. Regardless of which string is used, the status of other members should not impact the status of the member being checked (in a "normal" design). Also, out of curiosity, do you have 200 OK configured as the return string in your http monitor?

  • I cant speak specifically to the applications config, but i'm guessing yes, since the individual servers respond with 200 OK...

     

    in your 2 descriptions, mine is the second...I left out the url after the host command in my above post.

     

    so, if the monitor fires off a http get, every 5 seconds, to the URL in which the VS and Pool members support, it will hit each of the members with the get, to see that it returns the 200 ok response. IF it does not, it SHOULD place the member OR members, in a down status...

     

    • shaggy's avatar
      shaggy
      Icon for Nimbostratus rankNimbostratus
      correct - the monitor string (URI, HTTP headers, etc) is sent to each pool member every seconds, and if the F5 doesn't receive the expected response in seconds at most, it will mark the member down. cURL and telnet against the pool members are the best starting point for troubleshooting HTTP monitors from CLI. You could try 'curl http://:/healthcheck/status.html -H "Host: www.site.com"
    • brucecmc_163171's avatar
      brucecmc_163171
      Icon for Nimbostratus rankNimbostratus
      roger that...got another issue gotta deal with...will get back to this in the a.m. thanks for the info shaggy.