Coder Social home page Coder Social logo

pyzabbix-agent's Introduction

pyzabbix-agent

The pyzabbix-agent loadable module is a way to extend zabbix_agentd daemon with Python. The main goal is to avoid costly and slow exec calls and loading of the interpreter.

Installation.

At this moment, I do not recommend to use this module in a production environment. There are bugs. There are undetected issues.

  • Run ./configure script.

  • Check the include path and compilation parameters in Makefile and run make.

  • Copy python.so to the directory defined by LoadModulePath in zabbix_agentd.conf

  • Create subdirectory pymodules in the directory where your configuration file is installed

  • Install the Python Zabbix modules in this directory.

  • Add LoadModule=python.so in your zabbix_agentd.conf.

  • Set the PYTHONPATH as:

export PYTHONPATH=`python -c "import sys; print ':'.join(sys.path)"`
  • Restart zabbix_agentd

Zabbix Python module

This is a regular python module, where you shall define function main(*args). All arguments passed from Zabbix to an agent, will be passed to a main() functions as srings. The return value will be returned to Zabbix. Only Int, Long, Float and String information types are supported as return values.

"Special" Zabbix modules

These modules perform some special actions.

  • ZBX_startup.py - module, which main() function will be executed during zabbix_agentd startup

  • ZBX_finish.py - module, which main() function will be executed during zabbix_agentd finish

Python interface

The following item keys are supported:

  • python.ping - no parameters. Return 1 if embedded Python is initialized
  • python.version - returns version of the embedded Python interpreter
  • python - calling the Python Zabbix module. The first parameter is the name of the module, the next parameters will be passed to the main() function of the module.
  • python.prof - same as python, but instead returning the value, returns execution time of the module in miliseconds.

pyzabbix-agent's People

Contributors

q1x avatar vulogov avatar

Watchers

 avatar  avatar

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.