Ad Widget

Collapse

Zabbix brower item : screenshot function doesn't wait for the page to be fully loaded

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ThomasP
    Junior Member
    • Jul 2022
    • 3

    #1

    Zabbix brower item : screenshot function doesn't wait for the page to be fully loaded

    Hello,
    We are trying to use the "Website by browser" template to monitor internal web applications.

    We have an issue with one of our applications : loading the page including data (loaded by Javascript) takes some time and Zabbix is only able to a take a screenshot of an empty page (before data got loaded).
    See screenshot below :
    Click image for larger version

Name:	image.png
Views:	117
Size:	9.4 KB
ID:	504555
    Is there a way to tell Zabbix to wait some data to be available before taking a screenshot.

    Thank you

    Thomas
  • ThomasP
    Junior Member
    • Jul 2022
    • 3

    #2
    Hello,
    According to https://www.reddit.com/r/zabbix/comm...wbrowser_item/, it looks like there is no way to delay the screenshot.
    Has anyone played with this feature ?
    Thank you
    Thomas

    Comment

    • STGA
      Junior Member
      • Jul 2025
      • 1

      #3
      Hello,

      You can add this code to delay the screenshot :


      function sleep(ms) {
      const end = Date.now() + ms;
      while (Date.now() < end) { }
      }
      sleep(5000);



      Best regards,
      STGA.

      Comment

      • RenatoSD
        Junior Member
        • Jul 2025
        • 1

        #4
        Originally posted by ThomasP
        Hello,
        According to https://www.reddit.com/r/zabbix/comm...wbrowser_item/, it looks like there is no way to delay the screenshot.
        Has anyone played with this feature ?
        Thank you
        Thomas
        Hello Thomas.
        I faced the same problem. The solution I found was to add a function to only send the data (JSON) when the script encounters an item that only appears at the end of the page load. For example: my page being monitored has a logo (JPEG), which only appears at the end of the page load. I created a function within the script that only sends the data to Zabbix when this image appears. It's simple; with the help of some artificial intelligence, you can solve it, even if you don't have JavaScript experience.

        Comment

        Working...