Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

External Monitor with curl command

Anzine
Nimbostratus
Nimbostratus

Hi expert

i want to write script for external monitor as scenario

i have 3 pools with priority group less than 1 that mean only 1 server should accept traffic and the others are standby

the priority group as expected but the development want only 1 pool should up and others mark down by using 

if send cookie with expexted respond should be OK and API ACTIVE 

how to write this script, send request and respond on the file 

Thanks 

2 REPLIES 2

Kai_Wilke
MVP
MVP

Hey Agus12,

an "External Monitor" based on external BASH-Scripts is most likely used for rather complex monitoring tasks and should not used for simple monitoring tasks. It would just add unnessecary complexity....

The curl commands your DEVs handed out are looking very simplistic and right now I dont see a good reason to put those CURL commands natively into an external monitoring script. A regular HTTP/HTTPS Monitor with tailordered SEND/RECEIVE strings should be able monitor the availability of your application.

Before helping you to create SEND/RECEIVE strings, you should clarify with your development why they included the -cookie directive and why they enabling the -G option (use GET instead of POST requests) if the -d option uses JSON formated params meant for POST payload. The combination of -G and JSON formated payload results in a slighly broken request URI:

 

[itacs@kw-f5-dev:Active:Standalone] config # curl -vvv --cookie session_cookie -G -d '{"request":"ping"}' http://10.0.17.23:81
*   Trying 10.0.17.23...
* Connected to 10.0.17.23 (10.0.17.23) port 81 (#0)
> GET /?{"request":"ping"} HTTP/1.1
> Host: 10.0.17.23:81
> User-Agent: curl/7.47.1
> Accept: */*
> 

 

Cheers, Kai


iRule can do… 😉

Hello @Kai_Wilke 

Thanks for replying

i will confirm to development  why used this curl and is it related cookie on curl command  with login, 

as i know from the develop they used cookie session to login and will mark API  active and server should be up