Skip to content
Zabbix Agent - Jenkins
Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
jenkix Changing order Nov 28, 2019
LICENSE Initial commit Mar 13, 2018
README.md Update README.md Jan 23, 2020
deploy_zabbix.sh Fixing parameters on deploy_zabbix.sh Nov 4, 2019
zbx3.4_template_app_jenkins.xml Updating zabbix 3.4 template. Mar 15, 2018

README.md

jenkix

Zabbix Agent - Jenkins

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
~# cat /etc/sudoers.d/user_zabbix
Defaults:zabbix !syslog
Defaults:zabbix !requiretty

zabbix	ALL=(ALL)  NOPASSWD:ALL
~#
  1. Limited acccess to run command with sudo
~# 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 sergiotocalini@gmail.com
~# 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

You can’t perform that action at this time.