Ad Widget

Collapse

regex on a web check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hyeteck
    Junior Member
    • Oct 2014
    • 9

    #1

    regex on a web check

    I'm trying to create an item web.page.regexp but can't get a match on my desired text.

    This is what i have right now.
    Code:
    web.page.regexp[127.0.0.1,/support-internal/api/health/basic,8080,"basicHealthCheckResult\": \"([.+])\"",,\1]
    The web page contains the following text.
    Code:
    {"timeTaken":0,"basicHealthCheckResult":"OK","extendedHealthCheckResults":{}}
    I'm trying to get the data in quotes where the word "OK" is. There are various values that can be and I want to pull the value so I can create a trigger on it. It doesn't seem to match on that text though. Here is my output when i test the key.

    Code:
    zabbix_agentd -t web.page.regexp[127.0.0.1,/support-internal/api/health/basic,8080,"basicHealthCheckResult\": \"([.+])\"",,\1]
    web.page.regexp[127.0.0.1,/support-internal/api/health/basic,8080,basicHealthCheckResult": "([.+])",,1] [s|]
    Any ideas why its not matching on the string?
  • kustodian
    Member
    • Oct 2012
    • 33

    #2
    Why do you have a space in you regex? I don't see a space in the response:

    Code:
    "basicHealthCheckResult\": \"([.+])\""
    should be:
    Code:
    "basicHealthCheckResult\":\"([.+])\""

    Comment

    Working...