Giter VIP home page Giter VIP logo

pyzabbixsender's Introduction

pyZabbixSender

Python implementation of zabbix_sender.

Take a look at the wiki page to get in deep details.

This is a module that allows you to send data to a Zabbix server using Python. You don't need the zabbix_sender binary anymore.

Has been tested with Python 2.5.1 and 2.7

Python 2.5.1 doesn't have a json module (needed to implement zabbix protocol), so you can use simplejson instead.

Source code contains samples and comments to allows you start using it in no time. Here's a small example:

# Creating a sender object
z = pyZabbixSender(server="zabbix-server", port=10051)

# Adding data (without timestamp)
z.addData(hostname="test_host", key="test_trap_1", value="12")
z.addData("test_host", "test_trap_2", "2.43")

# Adding data (with timestamp)
z.addData("test_host", "test_trap_2", "2.43", 1365787627)

# Ready to send your data?
results = z.sendData()

# Check if everything was sent as expected
if results[0][0] != z.RC_OK:
  print "oops!"

# Clear internal data to start populating again
z.clearData()

# Wants to send a single data point right now?
z.sendSingle("test_host","test_trap","12")

There are some more options, so take a look and discover how easy is to use it ;)

License

GNU GPLv2

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.