Ad Widget

Collapse

Web scenario body

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • troffasky
    Senior Member
    • Jul 2008
    • 565

    #1

    Web scenario body

    I have a web scenario that uses basic auth to a host to fetch a page that returns semicolon-separated values. I have "Retrieve mode" set to "Body" but I can't see the retrieved body anywhere? Does it get set to a macro, or do I have to assign it to a macro with the Variables field, or what? Documentation seems a bit sparse on this specific aspect.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    Web scenario does not record the output...
    https://www.zabbix.com/documentation...web_monitoring
    The following information is collected in any web scenario:
    • average download speed per second for all steps of whole scenario
    • number of the step that failed
    • last error message

    The following information is collected in any web scenario step:
    • download speed per second
    • response time
    • response code
    If you need those retrieved values for something, there is a "http item" ...

    Comment

    • troffasky
      Senior Member
      • Jul 2008
      • 565

      #3
      OK.....that's completely baffling. Not only is it annoying that it doesn't do anything with the body, it's annoying that it doesn't mention this caveat in the documentation, given that it is such an obvious thing that it should be doing!
      Zabbix is great but can be so frustrating at times.

      Comment

      • troffasky
        Senior Member
        • Jul 2008
        • 565

        #4
        This doesn't seem to work how the documentation says it should.
        "Web page source as text (including headers)" is what is supposed to be returned by web.page.get.
        If I look in Latest Data, all I see is the headers:
        Code:
        2022-11-04 11:08:54    
        
        HTTP/1.0 200 OK
        
        Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
        
        Content-type: text/html​
        If I test it with curl [because it's using curl, right?], I get the actual content:

        Code:
        *   Trying 192.168.1.88:80...
        * Connected to inverter (192.168.1.88) port 80 (#0)
        * Server auth using Basic with user 'admin'
        > GET /inverter.cgi HTTP/1.1
        > Host: inverter
        > Authorization: Basic xxxxx
        > User-Agent: curl/7.86.0
        > Accept: */*
        >
        * Mark bundle as not supporting multiuse
        * HTTP 1.0, assume close after body
        < HTTP/1.0 200 OK
        < Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
        < Content-type: text/html
        <
        9a02050f27070714;780036;205;21.0;600;1.300000;d;NO;
        * Closing connection 0

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4806

          #5
          Originally posted by troffasky
          OK.....that's completely baffling. Not only is it annoying that it doesn't do anything with the body, it's annoying that it doesn't mention this caveat in the documentation, given that it is such an obvious thing that it should be doing!
          Zabbix is great but can be so frustrating at times.
          Well.. if docs list all the data it DOES record, then is it really necessary to write down, that "everything else is not recorded"? There is absolutely no need for a web scenario to record all the received data as it does not require it.

          What concerns web.page.get, I dot really know what it uses. It is an agent item and there is no requirement for running anything curl on that host... But I guess it has some compiled in curl support

          I tested here, I did get more than headers back, so you may have some wonky item config there...

          But web.page.get was not exactly the item I suggested... I was referring to the item of type "HTTP item" https://www.zabbix.com/documentation...itemtypes/http It is much more capable than web-page.get...

          Comment

          • troffasky
            Senior Member
            • Jul 2008
            • 565

            #6
            Originally posted by cyber
            Well.. if docs list all the data it DOES record, then is it really necessary to write down, that "everything else is not recorded"?
            Obviously listing all the things it doesn't do would be absurd.
            But given that a) Zabbix is a thing that people use to collect data b) You can tell Zabbix to check the body content in a web scenario c) Some of the data collected by a web scenario is kept, then it seems obvious to me that d) You would be able to do something with the body that was fetched.
            In this case it is a matter of expectations and what is "obvious". I think polling the body to match a "Required string" but then discarding it is worthy of a caveat in the documentation, at least.

            Originally posted by cyber
            There is absolutely no need for a web scenario to record all the received data as it does not require it.
            This is bordering on the tautological - it doesn't record it, because recording it is not implemented.

            Originally posted by cyber
            I tested here, I did get more than headers back, so you may have some wonky item config there...
            Well, as it turns out....I tried all three methods of HTTP fetching and gave up, so ended up using wget in a cron job to collect the body, write it to a file, then using a log[] item to bring it in to Zabbix. Works fine.
            I happened to unintentionally open the log file with vim and can see that there are lots of NULs in the body. This is probably what was throwing it off. The NULs are not apparent when using cat or having wget output to stdout, so I didn't pick up on this earlier.

            Comment

            Working...