SlideShare a Scribd company logo
ZABBIX
www.zabbix.com
How to build zlm-cython module from the
sources
Practical approach to extending Zabbix Server and an Agent
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
AGENDA
Build preparation and dependencies
Building the extension
Installation
Verification
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Build preparation and dependencies
Install or upgrade Cython using python-pip
Verify, that your installed Cython is fairly
recent
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Build preparation and dependencies
Install or upgrade python-devel package
or install python interpreter from the scratch(1).
(1) http://www.python.org
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Build preparation and dependencies
Verify, that the python-config provides you
correct parameters, for building Python
extensions
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Build preparation and dependencies
Install and configure your Zabbix source tree.
Even if you are installing Zabbix from the
binary packages, you will need Zabbix source
tree to compile Zabbix Loadable Module.
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Building the extension
Clone zlm-cython source repository from
the github.com
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Building the extension
Change directory to zlm-cython/src and execute
./BUILD.sh
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Installation
Copy zlm_python.so, zlm_python.ini and
python.cfg to your modules “root”
Pick the directory, which you will use as the
“root” for your loadable modules
Create subdirectories:
- pymodules;
- pymodules/lib;
- pydaemons
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Installation
Make sure, that user zabbix do have an access to
this files and dierctories.
Copy modules located in pymodules/lib of your
source directory to your destination pymodules/lib
Copy modules located in pymodules of your
source directory to your destination pymodules
Copy modules located in pydaemons of your
source directory to your destination pydaemons
only if you want to install sample daemons
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Installation
Filename or Directory name Description
zlm_python.so Python Zabbix Loadable Module.
pymodules Directory for Python modules available to
Python ZLM. Only modules in that directory
will be available for the calls
py[<modulename>, {parameters}]
pymodules/lib Python ZLM-specific Python modules.
pydaemons If the module placed in this directory will
export class Daemon, subclass of the
ZLM_Metric_Collector, Python ZLM will
spawn an instance of this class as separate
thread.
python.cfg Configuration file for Python interpreter
zlm_python.ini Configuration file for Python ZLM
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Installation
Parameter in Config File Description
LoadModulePath Full path to location of agent modules.
The value fo this variable shall be path
name where you loadable modules are
installed.
LoadModule Module to load at agent startup. The
value of this variable will be
zlm_python.so
Adjust Server or Agent configuration files
 zabbix_server.conf
 zabbix_agentd.conf ⁂
⁂ If you are enabling Python ZLM on the Zabbix Agent, please be sure that you are
updating proper configuration file, which is zabbix_agentd.conf, not zabbix_agent.conf
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Installation
Check the Server or Agent log files for any errors
Restart your Zabbix Server or an Agent. Check if
Restart was successful
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Verification
Try to call any py[] item
Call python.ping item
If this call return “1” you Python ZLM on agent
loaded correctly.
ZABBIX
www.zabbix.comHow to build zlm-cython module from the sources
Verification
Author: Vladimir Ulogov
E-mail: vladimir.ulogov@zabbix.com
GitHub.com: https://github.com/vulogov/zlm-cython

More Related Content

What's hot

eZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinareZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinar
Roland Benedetti
 
Speedy TDD with Rails
Speedy TDD with RailsSpeedy TDD with Rails
Speedy TDD with Rails
PatchSpace Ltd
 
What's new on Laravel 5.5
What's new on Laravel 5.5What's new on Laravel 5.5
What's new on Laravel 5.5
Glend Maatita
 
Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetCarl Caum
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
Joe Ferguson
 
2021laravelconftwslides6
2021laravelconftwslides62021laravelconftwslides6
2021laravelconftwslides6
LiviaLiaoFontech
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
James Fuller
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
Kevin Harvey
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
juzten
 
Beyond AEM Curl Commands
Beyond AEM Curl CommandsBeyond AEM Curl Commands
Beyond AEM Curl Commands
Cliffano Subagio
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
Clark Everetts
 
Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?
Kaliop-slide
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
Jackson F. de A. Mafra
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with Serverless
Yan Cui
 
Swagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMSwagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEM
Cliffano Subagio
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
Build website in_django
Build website in_django Build website in_django
Build website in_django swee meng ng
 
10 Laravel packages everyone should know
10 Laravel packages everyone should know10 Laravel packages everyone should know
10 Laravel packages everyone should know
Povilas Korop
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econ
Tom Schindl
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Julian Robichaux
 

What's hot (20)

eZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinareZ Publish Platform 5.4 public webinar
eZ Publish Platform 5.4 public webinar
 
Speedy TDD with Rails
Speedy TDD with RailsSpeedy TDD with Rails
Speedy TDD with Rails
 
What's new on Laravel 5.5
What's new on Laravel 5.5What's new on Laravel 5.5
What's new on Laravel 5.5
 
Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppet
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
2021laravelconftwslides6
2021laravelconftwslides62021laravelconftwslides6
2021laravelconftwslides6
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 
Beyond AEM Curl Commands
Beyond AEM Curl CommandsBeyond AEM Curl Commands
Beyond AEM Curl Commands
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?Web performances : Is It not the right time to (re)consider CMS ?
Web performances : Is It not the right time to (re)consider CMS ?
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with Serverless
 
Swagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMSwagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEM
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Build website in_django
Build website in_django Build website in_django
Build website in_django
 
10 Laravel packages everyone should know
10 Laravel packages everyone should know10 Laravel packages everyone should know
10 Laravel packages everyone should know
 
Java fx smart code econ
Java fx smart code econJava fx smart code econ
Java fx smart code econ
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
 

Similar to zlm-cython

Vladimir Ulogov - Beyond the Loadable Module
Vladimir Ulogov - Beyond the Loadable ModuleVladimir Ulogov - Beyond the Loadable Module
Vladimir Ulogov - Beyond the Loadable Module
Zabbix
 
Beyond the Loadable Module
Beyond the Loadable ModuleBeyond the Loadable Module
Beyond the Loadable ModuleVladimir Ulogov
 
CICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker HubCICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker Hub
Carlos Cavero Barca
 
Introduction to robot framework
Introduction to robot frameworkIntroduction to robot framework
Introduction to robot framework
Chonlasith Jucksriporn
 
How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?
Celine George
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
Markus Zapke-Gründemann
 
Democamp - Munich - Java9
Democamp - Munich - Java9Democamp - Munich - Java9
Democamp - Munich - Java9
Tom Schindl
 
Advanced Malware Analysis Training Session 5 - Reversing Automation
Advanced Malware Analysis Training Session 5 - Reversing AutomationAdvanced Malware Analysis Training Session 5 - Reversing Automation
Advanced Malware Analysis Training Session 5 - Reversing Automation
securityxploded
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with ComposerJason Grimes
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
Adam Englander
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
Haiqi Chen
 
Running Symfony
Running SymfonyRunning Symfony
Running Symfony
Wildan Maulana
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
Lambert Beekhuis
 
Custom Buildpacks and Data Services
Custom Buildpacks and Data ServicesCustom Buildpacks and Data Services
Custom Buildpacks and Data Services
Tom Kranz
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
Celine George
 
HyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdfHyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdf
wonyong hwang
 
PyCon 2005 PyBlosxom
PyCon 2005 PyBlosxomPyCon 2005 PyBlosxom
PyCon 2005 PyBlosxomTed Leung
 
Artem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalkArtem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila
 

Similar to zlm-cython (20)

Vladimir Ulogov - Beyond the Loadable Module
Vladimir Ulogov - Beyond the Loadable ModuleVladimir Ulogov - Beyond the Loadable Module
Vladimir Ulogov - Beyond the Loadable Module
 
Beyond the Loadable Module
Beyond the Loadable ModuleBeyond the Loadable Module
Beyond the Loadable Module
 
CICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker HubCICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker Hub
 
Introduction to robot framework
Introduction to robot frameworkIntroduction to robot framework
Introduction to robot framework
 
How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?How to configure PyCharm for Odoo development in Windows?
How to configure PyCharm for Odoo development in Windows?
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
zas-agent-0.1.1
zas-agent-0.1.1zas-agent-0.1.1
zas-agent-0.1.1
 
Democamp - Munich - Java9
Democamp - Munich - Java9Democamp - Munich - Java9
Democamp - Munich - Java9
 
Advanced Malware Analysis Training Session 5 - Reversing Automation
Advanced Malware Analysis Training Session 5 - Reversing AutomationAdvanced Malware Analysis Training Session 5 - Reversing Automation
Advanced Malware Analysis Training Session 5 - Reversing Automation
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Pythonpresent
PythonpresentPythonpresent
Pythonpresent
 
Running Symfony
Running SymfonyRunning Symfony
Running Symfony
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
 
Custom Buildpacks and Data Services
Custom Buildpacks and Data ServicesCustom Buildpacks and Data Services
Custom Buildpacks and Data Services
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
HyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdfHyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdf
 
PyCon 2005 PyBlosxom
PyCon 2005 PyBlosxomPyCon 2005 PyBlosxom
PyCon 2005 PyBlosxom
 
Artem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalkArtem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalk
 

More from Vladimir Ulogov

Introduction to the core.ns application framework
Introduction to the core.ns application frameworkIntroduction to the core.ns application framework
Introduction to the core.ns application framework
Vladimir Ulogov
 
Generating test data for Statistical and ML models
Generating test data for Statistical and ML modelsGenerating test data for Statistical and ML models
Generating test data for Statistical and ML models
Vladimir Ulogov
 
Short presentation of the Bitmasher private-key encryption
Short presentation of the Bitmasher private-key encryptionShort presentation of the Bitmasher private-key encryption
Short presentation of the Bitmasher private-key encryption
Vladimir Ulogov
 
Krabbe - messaging in loose groups
Krabbe - messaging in loose groupsKrabbe - messaging in loose groups
Krabbe - messaging in loose groups
Vladimir Ulogov
 
"the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar."the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar.
Vladimir Ulogov
 
The Bund language
The Bund languageThe Bund language
The Bund language
Vladimir Ulogov
 

More from Vladimir Ulogov (7)

Introduction to the core.ns application framework
Introduction to the core.ns application frameworkIntroduction to the core.ns application framework
Introduction to the core.ns application framework
 
Generating test data for Statistical and ML models
Generating test data for Statistical and ML modelsGenerating test data for Statistical and ML models
Generating test data for Statistical and ML models
 
Short presentation of the Bitmasher private-key encryption
Short presentation of the Bitmasher private-key encryptionShort presentation of the Bitmasher private-key encryption
Short presentation of the Bitmasher private-key encryption
 
Krabbe - messaging in loose groups
Krabbe - messaging in loose groupsKrabbe - messaging in loose groups
Krabbe - messaging in loose groups
 
"the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar."the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar.
 
The Bund language
The Bund languageThe Bund language
The Bund language
 
Vladimir_Ulogov_Resume
Vladimir_Ulogov_ResumeVladimir_Ulogov_Resume
Vladimir_Ulogov_Resume
 

zlm-cython

  • 1. ZABBIX www.zabbix.com How to build zlm-cython module from the sources Practical approach to extending Zabbix Server and an Agent
  • 2. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources AGENDA Build preparation and dependencies Building the extension Installation Verification
  • 3. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Build preparation and dependencies Install or upgrade Cython using python-pip Verify, that your installed Cython is fairly recent
  • 4. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Build preparation and dependencies Install or upgrade python-devel package or install python interpreter from the scratch(1). (1) http://www.python.org
  • 5. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Build preparation and dependencies Verify, that the python-config provides you correct parameters, for building Python extensions
  • 6. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Build preparation and dependencies Install and configure your Zabbix source tree. Even if you are installing Zabbix from the binary packages, you will need Zabbix source tree to compile Zabbix Loadable Module.
  • 7. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Building the extension Clone zlm-cython source repository from the github.com
  • 8. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Building the extension Change directory to zlm-cython/src and execute ./BUILD.sh
  • 9. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Installation Copy zlm_python.so, zlm_python.ini and python.cfg to your modules “root” Pick the directory, which you will use as the “root” for your loadable modules Create subdirectories: - pymodules; - pymodules/lib; - pydaemons
  • 10. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Installation Make sure, that user zabbix do have an access to this files and dierctories. Copy modules located in pymodules/lib of your source directory to your destination pymodules/lib Copy modules located in pymodules of your source directory to your destination pymodules Copy modules located in pydaemons of your source directory to your destination pydaemons only if you want to install sample daemons
  • 11. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Installation Filename or Directory name Description zlm_python.so Python Zabbix Loadable Module. pymodules Directory for Python modules available to Python ZLM. Only modules in that directory will be available for the calls py[<modulename>, {parameters}] pymodules/lib Python ZLM-specific Python modules. pydaemons If the module placed in this directory will export class Daemon, subclass of the ZLM_Metric_Collector, Python ZLM will spawn an instance of this class as separate thread. python.cfg Configuration file for Python interpreter zlm_python.ini Configuration file for Python ZLM
  • 12. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Installation Parameter in Config File Description LoadModulePath Full path to location of agent modules. The value fo this variable shall be path name where you loadable modules are installed. LoadModule Module to load at agent startup. The value of this variable will be zlm_python.so Adjust Server or Agent configuration files  zabbix_server.conf  zabbix_agentd.conf ⁂ ⁂ If you are enabling Python ZLM on the Zabbix Agent, please be sure that you are updating proper configuration file, which is zabbix_agentd.conf, not zabbix_agent.conf
  • 13. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Installation Check the Server or Agent log files for any errors Restart your Zabbix Server or an Agent. Check if Restart was successful
  • 14. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Verification Try to call any py[] item Call python.ping item If this call return “1” you Python ZLM on agent loaded correctly.
  • 15. ZABBIX www.zabbix.comHow to build zlm-cython module from the sources Verification Author: Vladimir Ulogov E-mail: vladimir.ulogov@zabbix.com GitHub.com: https://github.com/vulogov/zlm-cython