Ad Widget

Collapse

Zabbix API and Values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuo
    Junior Member
    • Feb 2010
    • 18

    #1

    Zabbix API and Values

    Heyho Zabbix community,

    maybe a simple question, but I can't find it in the docs.

    How can I send an item-value to the server via the Zabbix API? I am able to create hosts, groups, everything...but I can't find a way to now actually send the values via the API.

    I may use the zabbix_sender, but have problems with it not working correctly with hosts with blanks in their names and with the fact that I can't supply a DNS name.

    any help is greatly appreciated

    best regards

    tuo
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    You can't send item data via the API. The API is only for configuring Zabbix.

    If you need to send a value to Zabbix use the Zabbix Sender.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • tuo
      Junior Member
      • Feb 2010
      • 18

      #3
      The problem I am facing is that when I use Zabbix Sender, I cannot get it to work with host names with blanks in their names, and the second problem is that I cannot use it identify the host via it's DNS name.

      In our environment, we allow users to change the name of the hosts, as this is a needed feature. Thus, if the user changes the name of a host, the sending host send with a wrong hostname, so the data gets dropped.

      Which solutions exist for my problem?

      best regards and thank you for any and all help provided

      tuo

      Comment

      • nelsonab
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2006
        • 1233

        #4
        Have you tried putting the host name in quotes on the command line?

        You can change host names via the api.
        RHCE, author of zbxapi
        Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
        Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

        Comment

        • tuo
          Junior Member
          • Feb 2010
          • 18

          #5
          Yes, tried it with and without quotes, both without success.

          Changing the host name via the api would kinda lead to a cat and mouse game with the user changing it back. Of course I could cache the name the user entered, change it to something without blanks, send the data, and change the name back...but I would prefer a cleaner solution.

          best regards

          tuo

          Comment

          • Tulkis
            Junior Member
            • Feb 2019
            • 7

            #6
            Originally posted by nelsonab
            You can't send item data via the API. The API is only for configuring Zabbix.

            If you need to send a value to Zabbix use the Zabbix Sender.
            Is this still valid?
            Actually is not possible update trapper items with api?
            Thanks.

            Comment

            Working...