An open API service indexing awesome lists of open source software.

https://github.com/sergiotocalini/jenkix

Zabbix Agent - Jenkins
https://github.com/sergiotocalini/jenkix

jenkins monitoring monitoring-plugins monitoring-scripts script shell shell-scripts zabbix zabbix-agent zabbix-templates

Last synced: about 1 month ago
JSON representation

Zabbix Agent - Jenkins

Awesome Lists containing this project

README

        

# jenkix
Jenkins Monitoring

This script is part of a monitoring solution that allows to monitor several
services and applications.

For more information about this monitoring solution please check out this post
on my [site](https://sergiotocalini.github.io/project/monitoring).

# Dependencies
## Packages
* curl
* jq
* ksh
* sudo

### Debian/Ubuntu
```
~# sudo apt install curl jq ksh sudo
~#
```
### Red Hat
```
~# sudo yum install curl jq ksh sudo
~#
```
# Deploy
## Sudoers
The deploy script is not intended to advise which approach you should implemented nor
deploy the sudoers configuration but the user that will run the script needs to have
sudo privileges for some checks.

There are two options to setting up sudoers for the user:
1. Provided sudo all
```bash
~# cat /etc/sudoers.d/user_zabbix
Defaults:zabbix !syslog
Defaults:zabbix !requiretty

zabbix ALL=(ALL) NOPASSWD:ALL
~#
```
2. Limited acccess to run command with sudo
```bash
~# cat /etc/sudoers.d/user_zabbix
Defaults:zabbix !syslog
Defaults:zabbix !requiretty

zabbix ALL=(ALL) NOPASSWD: /usr/bin/lsof *
zabbix ALL=(ALL) NOPASSWD: /bin/ps *
~#
```
## Parameters
The username and the password can be empty if jenkins has the read only option enable.
Default variables:

NAME|VALUE
----|-----
JENKINS_URL|http://localhost:8080
JENKINS_USER|
JENKINS_PASS|
CACHE_DIR|/etc/zabbix/scripts/agentd/jenkix/tmp
CACHE_TTL|5
SCRIPT_DIR|/etc/zabbix/scripts/agentd/jenkix
ZABBIX_INC|/etc/zabbix/zabbix_agentd.d

*__Note:__ this variables has to be saved in the config file (jenkix.conf) in the same directory than the script.*

## Demo Deploy
```
~# git clone https://github.com/sergiotocalini/jenkix.git
~# ./jenkix/deploy_zabbix.sh -H
Usage: [Options]

Options:
-F Force configuration overwrite.
-H Displays this help message.
-P Installation prefix (SCRIPT_DIR).
-Z Zabbix agent include files directory (ZABBIX_INC).
-c Configuration key CACHE_DIR.
-j Configuration key JENKINS_URL.
-p Configuration key JENKINS_PASS.
-t Configuration key CACHE_TTL.
-u Configuration key JENKINS_USER.

Please send any bug reports to [email protected]
~# sudo ./jenkix/deploy_zabbix.sh -j "${JENKINS_URL}" \
-u "${JENKINS_USER}" \
-p "${JENKINS_PASS}"
~# sudo systemctl restart zabbix-agent
```

*__Note:__ the installation has to be executed on the zabbix agent host and you have to import the template on the zabbix web. The default installation directory is /etc/zabbix/scripts/agentd/jenkix*