This repository houses the required scripts and configuration to implement Zabbix monitoring for Jenkins jobs.
Explore the documentation »
View Demo
·
Report Bug
·
Request Feature
- About The Project
- Disclaimer
- Getting Started
- Usage
- Roadmap
- Contributing
- License
- Contact
- Acknowledgments
The Zabbix Jenkins Monitoring Solution enables the discovery and monitoring of Jenkins jobs using Zabbix. This solution integrates Low-Level Discovery (LLD) and a Python-based script to query the Jenkins API, allowing real-time monitoring of job statuses, durations, and results.
This project is provided "as is" without any warranties or support. Compatibility has been tested with Zabbix 6.0 LTS and Jenkins latest
, but functionality on other systems may vary. Use at your own risk.
To set up this monitoring solution, upload the Jenkins template to your Zabbix server, configure the Python script for querying the Jenkins API, and set up the required user parameters for Zabbix Agent.
-
Clone the repository:
git clone [email protected]:renaldo-maclons/zabbix-jenkins.git cd zabbix-jenkins
-
Load the template:
- Import the file
resources/zabbix/template/template_app_jenkins.yaml
into your Zabbix server through the Configuration > Templates interface.
- Set Up User Parameters:
-
Copy
resources/zabbix/userparameter/userparameter_jenkins.conf
to your Zabbix Agent configuration directory:sudo cp resources/zabbix/userparameter/userparameter_jenkins.conf /etc/zabbix/zabbix_agent2.d/plugins.d
-
Restart Zabbix Agent:
systemctl restart zabbix-agent2
-
Update Python Script:
-
Edit the zabbix-jenkins.py script to configure the Jenkins API URL, user, and token:
JENKINS_URL = "https://jenkins.example.com" API_USER = "[email protected]" API_TOKEN = "your_api_token"
- Test the Integration:
-
Verify that the Python script outputs LLD data by running:
python3 zabbix-jenkins.py
Once the template is applied, the Zabbix Jenkins Monitoring Solution will begin collecting data from the Jenkins API, providing valuable insights into job performance and statuses.
- Job Name: The name of each Jenkins job.
- Job URL: Direct link to the Jenkins job in the Jenkins UI.
- Job Duration: The actual time taken for the last build of the job (in seconds).
- Estimated Duration: Average time the job is expected to take, based on historical builds (in seconds).
- Job Result: The result of the last build (e.g., SUCCESS, FAILURE).
- Implement Low-Level Discovery (LLD) for Jenkins jobs.
- Add support for querying job durations and statuses.
- Implement credential parsing via Zabbix Macros
- Enhance metrics collection to include build trends and queue times.
- Add alerting for failed or long-running jobs.
- Integrate visualization tools for Jenkins job performance.
See the open issues for a full list of proposed features (and known issues).
Contributions are welcome! Please fork this repository and submit pull requests to propose changes or improvements. For major changes, open an issue to discuss them first.
Distributed under the MIT License. See LICENSE.md
for more information.
Renaldo Maclons - GitHub
Project Link: Zabbix Jenkins Monitoring