Ad Widget

Collapse

Retrieving a value from a Web Test

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mpureka
    Junior Member
    • Apr 2011
    • 28

    #1

    Retrieving a value from a Web Test

    I have an interesting scenario, where I would like to use Zabbix to fetch data from an external application.

    The application in question makes data available via HTTP request - if I connect to a properly formatted URL, it returns a bunch of values. Is it possible for me to use Zabbix to capture one or more of these values?

    So, for example, if I went to:



    And it returns:

    Status: OK
    Users: 10

    Is there any way that Zabbix can return the value 10?
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    definitely. exact approach would depend on some other factors like amount of values you want to retrieve and how long it takes to open such a url.

    possible solutions :

    1. use external checks on zabbix server to parse the page;
    2. use userparameters on the agent to parse the page;
    3. parse the page with a script and send values with zabbix_sender.
    Zabbix 3.0 Network Monitoring book

    Comment

    • mpureka
      Junior Member
      • Apr 2011
      • 28

      #3
      Right, so this is more of a job for an external check and less of a job for a web scenario. That's the path we're moving down now, performing a wget on the page and parsing the output.

      Comment

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        just beware of external checks tying up zabbix pollers. userparameters might be a better choice, and if you have lots of values, script + zabbix_sender an even better one
        Zabbix 3.0 Network Monitoring book

        Comment

        • mpureka
          Junior Member
          • Apr 2011
          • 28

          #5
          Can you go into a little more detail on those alternatives?

          Comment

          • richlv
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2005
            • 3112

            #6
            http://www.zabbix.com/documentation/...ser_parameters

            http://www.zabbix.com/documentation/.../zabbix_sender
            Zabbix 3.0 Network Monitoring book

            Comment

            • mpureka
              Junior Member
              • Apr 2011
              • 28

              #7
              Resurrecting my own thread here as I'm finally getting around to trying to cut this over to user parameters; The documentation is quite clear on how to set up a user parameter, but seems to contain absolutely no information on how to actually retrieve the data from a user parameter as a Zabbix item.

              This seems like a crucial bit of information - once I've defined my user parameter in the agent config file, how do I actually access that data?

              Comment

              • richlv
                Senior Member
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Oct 2005
                • 3112

                #8
                as any other zabbix agent item, using the key you specified in the config file
                Zabbix 3.0 Network Monitoring book

                Comment

                • mpureka
                  Junior Member
                  • Apr 2011
                  • 28

                  #9
                  Oh. I see. It didn't occur to me to think of the 'key' defined in the user parameter as the same as the 'key' that gets entered when creating an item.

                  Comment

                  Working...