Forum Discussion

Omarsheriff1980's avatar
Omarsheriff1980
Icon for Nimbostratus rankNimbostratus
Feb 06, 2019

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 } ] } }

2 Replies

  • 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/
    
  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Try the following as "receive string":

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

    .

    [Edited to add escape for "{"]