Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

customized HTTP health monitoring

currently configured customized HTTP health monitoring, which mentioned below is not working as it looks for every string appearing on the health page as "status" : "UP"

Request String :- GET /editorial-metadata/v1/health HTTP/1.0\r\nConnection: Close\r\n\r\n
Response String :- /status/ : /UP/

our requirement is from our health check page, we want to grep only the firstly appearing string "status" : "UP", if any word change to mark the member server health down.

health check page { "status" : "Down", "consumerService" : { "status" : "UP", "environment" : "Testing", "startuptime" : "2019-02-01T04:12:35.277", "loggingLevel.root" : "INFO", "loggingLevel.genre" : "Not Set", "loggingLevel.sql" : "debug", "loggingLevel.org.hibernate.type.descriptor.sql.BasicBinder" : "Not Set", "logging.level.org.springframework" : "Not Set", "build.number" : "build3",

  },

"jms" : { "status" : "UP", "provider" : "ActiveMQ" }, "db" : { "status" : "Down", "error" : "org.springframework.jdbc.CannotGetJdbcConnectionException:" }, "refreshScope" : { "status" : "UP" }, "testServer" : { "status" : "UP", "repositories" : [ { "sources" : [ "clone" ], "name" : "app", "profiles" : [ "default" ], "label" : null } ] } }

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

If you want just the first one why not use a Receive String looking for health check page { "status" : "Up"?


Alternatively you can use the Receive Disable String within the monitor to look for something like "status" : "Down"

If it sees this it will make the pool member status as down.

E.g.

Request String :- GET /editorial-metadata/v1/health HTTP/1.0\r\nConnection: Close\r\n\r\n
Receive Disable String :- /status/ : /DOWN/
0
Comments on this Answer
Comment made 1 month ago by Omarsheriff1980 55

Hi Andy,

             Thanks for the response. 

please provide me more details about the configuration - Receive String looking for health check page { "status" : "Up"? - you want me to change the health check page

Alternatively you can use the Receive Disable String within the monitor to look for something like "status" : "Down"

i cant take the string "status" : "Down", sometimes first string will appear "status" : "Up" and some of the down string shows "status" : "Down"

status will differ from application to application

0
Comment made 1 month ago by Stephane Viau 122

As receive strings support regular expressions, you might be able to use the ^ character to look for the beginning of a line but I guess it would only work if the json response shows up on a single line instead of multiple lines.

Otherwise I think your best bet would be to change the health page so that the value of interest to the Big-IP monitor is a unique value that cannot be found anywhere else in the response.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Try the following as "receive string":

^\{\s\"status\"\s:\s\"UP\",

.

[Edited to add escape for "{"]

0
Comments on this Answer
Comment made 1 month ago by Omarsheriff1980 55

i tried the "receive string": ^{\s\"status\"\s:\s\"UP\", it didn't work. it shows an error recv parameter contains an invalid regular expression (Invalid content of repeat range)

0
Comment made 1 month ago by Jie 2732

I have just edited the regex pattern to add an escape character for "{", and it was accepted by the system.

0
Comment made 1 month ago by Omarsheriff1980 55

health check page { "status" : "UP",

Do we have to add like this "receive string": ^"{",\s\"status\"\s:\s\"UP\", please confirm.

0
Comment made 1 month ago by Jie 2732

Please do not add "receive string": ". Just cut-and-paste and use the red-colored string only.

0