Ad Widget

Collapse

Zabbix web scenario monitor upload image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • minghsieh@qpp.com
    Junior Member
    • Nov 2013
    • 3

    #1

    Zabbix web scenario monitor upload image

    Dear all,

    Just wonder how I could monitor the website upload image(s) speed.

    Basically I have done curl upload part, like this:

    $ curl -F "filecomment=Darth_Vadar file" -F "image=@/Users/admin/Downloads/Darth_Vadar_4096x3072.jpg" http://www.example.com/Uploader/upload_image.aspx

    {"ID":"A66527F9501601FC76528F6D2994EF780718672A"," Exp":"jpg","Owner":"","Path":"http://www.example.com/AttachFiles/UserPhoto/temp","Width":4096,"Height":3072}

    $

    Now I go to Configuration -> Web -> Web scenarios -> (my own test scenarios) -> Steps -> Add:

    Name: TEST_IMAGE
    URL: http://www.example.com/Uploader/upload_image.aspx
    Post: ??? <- What should I put here?
    Timeout: 15
    Required String: {"ID".*}
    Required status codes: 200

    Or is there any other way to do so?

    Thanks.

    Ming
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    Interesting question :-)

    I'm not sure, but you can try this Post value:
    Code:
    filecomment=Darth_Vadar&name=@/<absolute_path>/Darth_Vadar_4096x3072.jpg;type=image/jpeg
    And don't forget upload file Darth_Vadar_4096x3072.jpg with reading permissions for Zabbix to <absolute_path> on your Zabbix server.

    Let me know your result.
    Reference: http://stackoverflow.com/questions/4...t-content-type
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    • minghsieh@qpp.com
      Junior Member
      • Nov 2013
      • 3

      #3
      @jan:

      Thanks for swift reply.

      I've tried your suggestion, but result message:

      Error: Required pattern not found

      I put:

      Name: Test upload huge image
      URL: http://www.example.com/Uploader/upload_image.aspx
      Post: filecomment=Darth_Vadar_XL&name=@/tmp/darth-vader.jpg;type=image/jpeg
      Timeout: 60 secs
      Required string: {\"ID\".*}
      Required status codes: 200

      BTW, my scenario is set to 120 secs.

      Although it came out some graphics in Monitoring -> Web -> (My scenariso).

      Just wonder where should I look into to debug the upload process. Is there any log file for this?

      Comment

      • jan.garaj
        Senior Member
        Zabbix Certified Specialist
        • Jan 2010
        • 506

        #4
        Required pattern not found: Your required string was not matched. It's a feature :-) Use only "ID" (without quotation marks and wildcard chars like *) - only "ID".

        If you have a problem (I expect it, from Zabbix end :-D) please enable DebugLevel=4 in your Zabbix server config, restart server and post related debug lines from your Zabbix server log file.

        Zabbix log files are in:
        /var/log/zabbix
        or
        /tmp
        Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
        My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

        Comment

        • jan.garaj
          Senior Member
          Zabbix Certified Specialist
          • Jan 2010
          • 506

          #5
          Sorry guy, it doesn't work. I've test it in my test environment with last Zabbix version. I checked it also in source code httptest.c.

          Zabbix sends form always with header application/x-www-form-urlencoded, when you send file with @.
          Correct header is multipart/form-data. Also file is sended as raw string, not a binary file

          My final answer: Zabbix is not able to handle web check for file uploading with standard Zabbix web check functionality at the moment - I recommend you to build some custom script in CLI
          Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
          My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

          Comment

          • minghsieh@qpp.com
            Junior Member
            • Nov 2013
            • 3

            #6
            @jan,

            Thanks a lot. At least I know I should head on the bash script way.

            //Ming

            Comment

            Working...