Coder Social home page Coder Social logo

Low Level discover about py-zabbix HOT 1 OPEN

adubkov avatar adubkov commented on July 17, 2024
Low Level discover

from py-zabbix.

Comments (1)

dangelovich avatar dangelovich commented on July 17, 2024 1

I'm doing exactly this, by pushing through a string in the correct format to a discovery item, which is a Zabbix Trapper.

        discovery = {}
        data = []
        for item in list(set(items)):
            data.append({"{#APPMETRIC}":item, "{#APPNAME}":item.split('.')[0].upper()})
        discovery['data'] = data
        discoverystring = json.dumps(discovery)
        logging.debug("Discovery String: %s", discoverystring)
        zabbixkey = "v20metrics.discovery[%s]" % (discoverytype)
        logging.debug("Zabbix Key: %s", zabbixkey)
        packet = [ZabbixMetric("myhostname", zabbixkey, discoverystring)]
        result = ZabbixSender(use_config='/etc/zabbix/zabbix_agentd.conf').send(packet)
        logging.debug(pprint.pformat(result))

Only problem I'm finding is that the hostname "-" isn't accepted like it would be with the zabbix_sender binary (where it would just sub in the Hostname= from the agent config). Instead, I have to pass the matching hostname. Not a big deal...

from py-zabbix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.