Forum Discussion

rjonker's avatar
rjonker
Icon for Nimbostratus rankNimbostratus
Nov 19, 2009

Need help. HTTP monitor based on hostname

Hi,

 

When I create a basic HTTP monitor and use a hostname the result is that the actual ip address of the host is used in the monitor. A one time nslookup is done.

 

If the ip address of the host changes, the health monitor will fail.

 

Is there a way to use the hostename only all the time, by doing an nslookup every time?

 

I expect it can be done by an external script, but I was not able to find an example on DevCentral.

 

Please help!:D

3 Replies

  • Does the web server have virtual host or host header definitions that require a specific hostname be inserted in all requests? I wasn't aware that any name resolution would be done for a monitor send string. I would have guessed that the static string would be sent in the monitor request. Can you clarify what you've tested and which version you've tested on?

     

     

    Thanks,

     

    Aaron
  • I use this a health monitor to check the status of the ISP link on a Link Controller. I want to check that some internet web pages are reachable by just doing a "GET /".

     

    If I configure the basic http monitor I type for instance www.nu.nl as the adress to be checked. If the monitor is now created I see that the ip address is put in there instead of www.nu.nl.

     

     

    }

     

    monitor HTTP-Nu {

     

    defaults from http

     

    transparent

     

    dest 62.69.179.231:http

     

    }

     

     

     

    Now if www.nu.nl changes the ip address, the monitor will still check the old address and therefore fails.

     

    So I need a script that can do an dns lookup first and then do the check on the resolved ip address.

     

    BIGIP is running version: 9.4.5 with HF2 (soon to be upgraded to 10.0.1

     

  • I think you might need to use an external monitor. It would be a fairly simple one to implement using curl as long as you have DNS resolution configured. curl accepts a hostname and will perform name resolution before sending the request.

     

     

    The Monitoring Codeshare has several examples of external curl-based HTTP monitors.

     

     

    Aaron