Ad Widget

Collapse

get.web.regexp problem - no value in UI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hy3n4
    Junior Member
    • Mar 2017
    • 5

    #1

    get.web.regexp problem - no value in UI

    Hi,

    I have issue with web.page.regex.

    Application I need to monitor returns output in JSON format, since this should be easily parsable.

    Output:
    {"monitoring":"cd.smsgateway", "name":"con_status_a01", "value":1}

    Regex:
    \"value\"\\w+)

    But result to ZABBIX UI is []. When I try to getresults with zabbix_agentd or zabbix_get it returns a desired value.
    Eg. command:
    Code:
    zabbix_agentd -t web.page.regexp[127.0.0.1,'monitoring.aspx?repval=con_status_a01&num=1',80,'\"value\"\:(\w+)',,"\1"]
    result into:
    Code:
    web.page.regexp[127.0.0.1,monitoring.aspx?repval=con_status_a01&num=1,80,\"value\"\:(\w+),,"\1"] [B][s|10][/B]
    which is great because 10 is the value I need.

    So why in UI result is []? And how can one debug response (besides zabbix_agentd and zabbix_get)?

    Thanks

    -----

    I just figured it out.

    correct regexp is "(\"value\"(.*)(\})", so it has to be in double quotes and enclosed by brackets.

    So you can close this thread.

    Thanks
    Last edited by Hy3n4; 10-05-2017, 08:54. Reason: Resolution
Working...