Ad Widget

Collapse

Getting Zabbix Agent Version from an API call

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mczabbix
    Junior Member
    • Sep 2016
    • 2

    #1

    Getting Zabbix Agent Version from an API call

    Is it possible to obtain the agent.version from anywhere in the zabbix api? I've tried looking through items.get and see agent.version but not seeing a numeric value (e.g. 3.2.4) . I was hoping to use the API rather than using zabbix_get .
    I can't seem to find this in the DB either.
    Any help is greatly appreciated, Thanks in advance, :-)
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    You can use agent.version[] key in one of the items defined per host and then check over API what is the last value of the item on exact host.
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • mczabbix
      Junior Member
      • Sep 2016
      • 2

      #3
      This is great, thank you!
      I should be able to loop through a host.get and then get the host specific agent.version key_ from item.get. Does that sound right? It's so weird how I can't see this value in latest data. Hunting for the last value in API now.
      started looking at zapish. Very cool and useful! :-)

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by mczabbix
        This is great, thank you!
        I should be able to loop through a host.get and then get the host specific agent.version key_ from item.get. Does that sound right? It's so weird how I can't see this value in latest data. Hunting for the last value in API now.
        started looking at zapish. Very cool and useful! :-)
        Actually if you will have look on my zabbix agent template https://github.com/kloczek/zabbix-te...Zabbix%20Agent you can find implemented something like this.
        Additionally version of the agent is mapped to "Software Application A" inventory entries so by go to Inventory -> Overview -> (on right side) "Software Application A" you will have list of the hosts aggregated and counted per versions used on all monitored hosts where this template is used.
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • Clecimar
          Junior Member
          • Aug 2023
          • 2

          #5
          Someone here know how to know if the version of the agent is 1 or 2 ?

          Comment

          • solution
            Senior Member
            • Jun 2020
            • 269

            #6
            create an item with the key "agent.variant".


            Wellington​

            Comment

            • Vermizz
              Member
              • Oct 2022
              • 33

              #7
              Hi,
              I writed script to check my zabbix-agent version on all Windows and Linux server using API.
              For filter linux and windows server I use my server groups. In my example is variable: hostgroup_ids = [2, 3]

              Script on my github: https://github.com/Vermiz/Zabbix/tre..._Agent_version

              Comment

              Working...