Ad Widget

Collapse

How to get items details in the loadable module?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Reanimator
    Junior Member
    • May 2017
    • 3

    #1

    How to get items details in the loadable module?

    Hello,
    I want to export specific metrics from Zabbix to Kafka in real time. Looking forward to using a separate loadable module and implement history synchronization but facing the items' filtering problem. Could anyone advise me how to get details of items in it?
  • Luiz Antonio Oliveira
    Member
    • Feb 2007
    • 49

    #2
    only api...

    Explain your problem better

    Comment

    • Reanimator
      Junior Member
      • May 2017
      • 3

      #3
      I need to export items with the specific keys to Kafka. And now trying to figure out how to do this filtering in a loadable module.

      Comment

      • Luiz Antonio Oliveira
        Member
        • Feb 2007
        • 49

        #4
        item.get
        itemid
        search : { key_ : "agent.ping" }


        history.get
        itemid : itemid

        Comment

        • Reanimator
          Junior Member
          • May 2017
          • 3

          #5
          Thank you. But I'd like to use callbacks in loadable modules:

          Code:
          static void	dummy_history_float_cb(const ZBX_HISTORY_FLOAT *history, int history_num)
          {
          	int	i;
           
          	for (i = 0; i < history_num; i++)
          	{
          		/* do something with history[i].itemid, history[i].clock, history[i].ns, history[i].value, ... */
          	}
          }


          Could you please advise me anything for this case?

          Comment

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

            #6
            Maybe DBget_item_value(). How to use it? You have to figure it out. There is no official example. Also usage of any internal zabbix function is not supported officially. Official proper approach: write own DB access/caching layer.

            API usage is very slow and it will add a lot of latency in this case.

            Anyway open feature request + I'll be happy, if you share your proper C solution.
            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

            Working...