Ad Widget

Collapse

Why can't I use item.get on web items?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gleepwurp
    Senior Member
    • Mar 2014
    • 119

    #1

    Why can't I use item.get on web items?

    Hi Folks,

    I know from the Zabbix Docs that we can't use the Zabbix ITEM API to create/update or delete web items. What I can't figure out is why I can't use the ITEM.GET command to get information from a Web Item, as it is only reading the information, and not altering it in any way...?

    My alertscript uses the ITEM's associated Application ID to figure out where it needs to open a ticket and the overall process works well with normal items, but when the Event comes from a Web Item/Trigger, my process stops as the item.get is not able to get Web Item properties.

    I've managed a work-around by editing the API's CItem.php file, and took out the "web item" exclusion from the DB query, however I don't feel comfortable with having to maintain a file and "fix" it every time I upgrade to a new version of Zabbix.

    Does anyone know why there is a restriction on item.get for web items? Should I open a "Bug/Feature" request?

    Thanks!

    Gleepwurp.
  • felix.egli
    Junior Member
    • Nov 2014
    • 7

    #2
    You can access the web items with the web scenario class:

    Comment

    • gleepwurp
      Senior Member
      • Mar 2014
      • 119

      #3
      Hi Felix,

      thanks for the reply... I've looked at the web scenario class and although it does allow you to access Web Scenarios and Scenario steps, I haven't seen anything in there for accessing the information for the "Web Items" generated when you create a Web Scenario:

      ie: "Download speed for scenario xxx" or "Failed step of scenario".

      G.

      Comment

      • felix.egli
        Junior Member
        • Nov 2014
        • 7

        #4
        Are you searching for this?

        Comment

        • gleepwurp
          Senior Member
          • Mar 2014
          • 119

          #5
          Hi Felix,

          no, I'm looking at a way to get the Web Scenario's generated ITEM's associated "ApplicationID" through the Zabbix API, because my alert scripts looks up the trigger item's ApplicationID to route the ticket to the appropriate support group.

          The item.get would give me this applicationID if the item's type was not "9" (Web Item).

          The Web Scenario API also doesn't give any information about generated Web Items.

          I was able to work around it by removing the item type limitation in the Zabbix API. I don't understand why its being explicitly excluded from "ITEM.GET" API function...

          G.

          Comment

          • GArmao
            Zabbix Certified Specialist
            Zabbix Certified Trainer
            Zabbix Certified Specialist
            • Mar 2010
            • 135

            #6
            got the same issue while trying to create custom graphs using web items via API, the workaround of editing CItem.php works as a charm but...you'll them make all the web items visible also on the configuration/hosts/items page, and you are then also able to edit them as single items with unexpected results, so watch out.
            However, being able to edit the webitems also has the nice side effect of being able to set the history and trend retention, otherwise locked to 30 days for history and 90 days for trends.

            Comment

            • gleepwurp
              Senior Member
              • Mar 2014
              • 119

              #7
              ahhh, I didn't notice that these "web" items were not there prior to my changing the Items API...

              If the purpose for these items being left out is to prevent them from being modified in the Zabbix Web console, maybe putting in some "access" flags (RO, RW, etc) might have been a good attribute to include in the API, instead of hiding the item...

              Anyways, since they are rebuilding the API to run directly from zabbix_server instead of relying on the Web component (in Zabbix version 3.0), I'll wait and see if they address this issue, or if we'll need to put in an enhancement request.

              Thanks!

              G.
              Last edited by gleepwurp; 22-06-2015, 16:59. Reason: fixed some typos

              Comment

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

                #8
                https://www.zabbix.com/documentation...rence/item/get - "webitems" (available since 1.8)
                Zabbix 3.0 Network Monitoring book

                Comment

                • gleepwurp
                  Senior Member
                  • Mar 2014
                  • 119

                  #9
                  Ahhh, thanks my friend!

                  I don't know why I didn't notice that before...

                  Will check it out!

                  G.

                  Comment

                  Working...