Ad Widget

Collapse

Trigger checking for returned string - Web Scenario

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • batagy
    Junior Member
    • Sep 2017
    • 9

    #16
    Hi All,

    I'd like to use 'Required string' feature in Zabbix Web Scenario. The wanted web reply content we want is literally "[]" , i.e. opening and closing square bracket.
    But I'm not able to specify properly the regexp field, it seems.

    The webpage answer if I query the same from Powershell is below:
    Code:
    PS C:\Users\user> Invoke-WebRequest -uri [URL]http://hostname/rest/tasks?f.State=Failed[/URL]
    
    StatusCode        : 200
    StatusDescription : OK
    Content           : []
    RawContent        : HTTP/1.1 200 OK
                        Pragma: no-cache
                        BackendHostname: servername
                        Content-Length: 2
                        Cache-Control: no-cache
                        Content-Type: application/json; charset=utf-8
                        Date: Tue, 30 Oct 2018 13:56:20 GMT
                        Expir...
    Forms             : {}
    Headers           : {[Pragma, no-cache], [BackendHostname, servername], [Content-Length, 2], [Cache-Control,
                        no-cache]...}
    Images            : {}
    InputFields       : {}
    Links             : {}
    ParsedHtml        : System.__ComObject
    RawContentLength  : 2
    Please note the Content field , literally []. Zabbix web scenarion should be green if we receive this. If Content not empty bracket, we should trigger alarm.
    How can I specify 'Required string' for this?

    I've tried these:
    []
    \[\]
    "[]"
    \\[\\]

    We use Zabbix 3.0.5.
    Thanks in advance!
    Last edited by batagy; 12-11-2018, 17:53.

    Comment

    • batagy
      Junior Member
      • Sep 2017
      • 9

      #17
      Hi!

      Please ignore my question.
      Escaped bracket is actually working properly in 'Required string': \[\]
      It seems yesterday I made some mistake when testing.

      Comment

      Working...