Forum Discussion

Nate_Sternberg_'s avatar
Nate_Sternberg_
Icon for Nimbostratus rankNimbostratus
Jan 14, 2005

Using a monitor with a user-agent string?

This isn't exactly an iControl question, but it seemed relevant. Sorry if this is off-topic.

 

 

We have a web app that expect a user agent string with every request; it considers a missing user agent string to be a bad request and logs an error.

 

 

Our F5 monitors don't supply a user agent string. Is it possible to make it do so, perhaps by using a shell script as an external monitor? Anyone have a sample?
  • bknotwell_12713's avatar
    bknotwell_12713
    Historic F5 Account
    Hi Nate--

     

     

    Assuming I understand your problem correctly, you should be able to do something like the following:

     

     

    bigpipe monitor http2 '{ use http send "GET /index.shtml\r\nUser-Agent: firefox\r\n\r\n" }'

     

     

    FWIW, this is 4.X syntax but I'm pretty sure 9.X should be essentially the same.

     

     

    --Brad
  • Thanks Brad! We didn't try it through the command prompt like that, but your post made us realize that we could probably just change the monitor string in the web GUI. So we set it like this:

     

     

    GET / HTTP/1.1

     

    User-Agent: Mozilla/4.0 (compatible;.MSIE.6.0; Windows NT 5.2; NET CLR 1.1.4322; F5 BipIP V9.0.3)

     

     

    We noticed that if we didn't add the HTTP/1.1 in the string, the user agent wouldn't be picked up by the app. Not sure why that is. Anyway, thanks for the suggestion.